Skip to content

Commit

Permalink
Add VPATH and remove $(top_srcdir)/... to make sure it's possible to
Browse files Browse the repository at this point in the history
do the build in a different directory and not clutter the source with
build results (such as Makefiles, *.o and *.a files etc).

Closes: openzfs/zfs#1082
  • Loading branch information
FransUrbo committed Jun 11, 2014
1 parent 1e929b9 commit dc06fdb
Show file tree
Hide file tree
Showing 24 changed files with 192 additions and 146 deletions.
11 changes: 6 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
VPATH = @abs_top_srcdir@

ACLOCAL_AMFLAGS = -I config

include $(top_srcdir)/config/rpm.am
include $(top_srcdir)/config/deb.am
include $(top_srcdir)/config/tgz.am
include config/rpm.am
include config/deb.am
include config/tgz.am

SUBDIRS = include rpm
if CONFIG_USER
Expand Down Expand Up @@ -40,11 +41,11 @@ dist-hook:
$(distdir)/META

ctags:
$(RM) $(top_srcdir)/tags
$(RM) tags
find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags

etags:
$(RM) $(top_srcdir)/TAGS
$(RM) TAGS
find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a

tags: ctags etags
Expand Down
8 changes: 5 additions & 3 deletions cmd/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
VPATH = @abs_top_srcdir@

include $(top_srcdir)/config/Rules.am

DEFAULT_INCLUDES += \
Expand All @@ -6,9 +8,9 @@ DEFAULT_INCLUDES += \
noinst_PROGRAMS = spl
sbin_PROGRAMS = splat

spl_SOURCES = spl.c
spl_SOURCES = $(top_srcdir)/cmd/spl.c

splat_SOURCES = splat.c
splat_SOURCES = $(top_srcdir)/cmd/splat.c
splat_LDFLAGS = $(top_builddir)/lib/libcommon.la

EXTRA_DIST = splat.h
EXTRA_DIST = $(top_srcdir)/cmd/splat.h
16 changes: 9 additions & 7 deletions include/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
VPATH = @abs_top_srcdir@

SUBDIRS = fs linux rpc sharefs sys util vm

COMMON_H =

KERNEL_H = \
$(top_srcdir)/include/splat-ctl.h \
$(top_srcdir)/include/spl-ctl.h \
$(top_srcdir)/include/spl-debug.h \
$(top_srcdir)/include/spl-device.h \
$(top_srcdir)/include/spl-trace.h \
$(top_srcdir)/include/strings.h \
$(top_srcdir)/include/unistd.h
include/splat-ctl.h \
include/spl-ctl.h \
include/spl-debug.h \
include/spl-device.h \
include/spl-trace.h \
include/strings.h \
include/unistd.h

USER_H =

Expand Down
4 changes: 3 additions & 1 deletion include/fs/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
VPATH = @abs_top_srcdir@

COMMON_H =

KERNEL_H = \
$(top_srcdir)/include/fs/fs_subr.h
include/fs/fs_subr.h

USER_H =

Expand Down
36 changes: 19 additions & 17 deletions include/linux/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
VPATH = @abs_top_srcdir@

COMMON_H =

KERNEL_H = \
$(top_srcdir)/include/linux/bitops_compat.h \
$(top_srcdir)/include/linux/compiler_compat.h \
$(top_srcdir)/include/linux/delay_compat.h \
$(top_srcdir)/include/linux/file_compat.h \
$(top_srcdir)/include/linux/kallsyms_compat.h \
$(top_srcdir)/include/linux/list_compat.h \
$(top_srcdir)/include/linux/math64_compat.h \
$(top_srcdir)/include/linux/mm_compat.h \
$(top_srcdir)/include/linux/module_compat.h \
$(top_srcdir)/include/linux/mutex_compat.h \
$(top_srcdir)/include/linux/proc_compat.h \
$(top_srcdir)/include/linux/rwsem_compat.h \
$(top_srcdir)/include/linux/smp_compat.h \
$(top_srcdir)/include/linux/sysctl_compat.h \
$(top_srcdir)/include/linux/time_compat.h \
$(top_srcdir)/include/linux/uaccess_compat.h \
$(top_srcdir)/include/linux/zlib_compat.h
include/linux/bitops_compat.h \
include/linux/compiler_compat.h \
include/linux/delay_compat.h \
include/linux/file_compat.h \
include/linux/kallsyms_compat.h \
include/linux/list_compat.h \
include/linux/math64_compat.h \
include/linux/mm_compat.h \
include/linux/module_compat.h \
include/linux/mutex_compat.h \
include/linux/proc_compat.h \
include/linux/rwsem_compat.h \
include/linux/smp_compat.h \
include/linux/sysctl_compat.h \
include/linux/time_compat.h \
include/linux/uaccess_compat.h \
include/linux/zlib_compat.h

USER_H =

Expand Down
6 changes: 4 additions & 2 deletions include/rpc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
VPATH = @abs_top_srcdir@

COMMON_H =

KERNEL_H = \
$(top_srcdir)/include/rpc/types.h \
$(top_srcdir)/include/rpc/xdr.h
include/rpc/types.h \
include/rpc/xdr.h

USER_H =

Expand Down
4 changes: 3 additions & 1 deletion include/sharefs/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
VPATH = @abs_top_srcdir@

COMMON_H =

KERNEL_H = \
$(top_srcdir)/include/sharefs/share.h
include/sharefs/share.h

USER_H =

Expand Down
194 changes: 98 additions & 96 deletions include/sys/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,104 +1,106 @@
VPATH = @abs_top_srcdir@

SUBDIRS = fm fs sysevent

COMMON_H =

KERNEL_H = \
$(top_srcdir)/include/sys/acl.h \
$(top_srcdir)/include/sys/acl_impl.h \
$(top_srcdir)/include/sys/atomic.h \
$(top_srcdir)/include/sys/attr.h \
$(top_srcdir)/include/sys/bitmap.h \
$(top_srcdir)/include/sys/bootconf.h \
$(top_srcdir)/include/sys/bootprops.h \
$(top_srcdir)/include/sys/buf.h \
$(top_srcdir)/include/sys/byteorder.h \
$(top_srcdir)/include/sys/callb.h \
$(top_srcdir)/include/sys/callo.h \
$(top_srcdir)/include/sys/cmn_err.h \
$(top_srcdir)/include/sys/compress.h \
$(top_srcdir)/include/sys/condvar.h \
$(top_srcdir)/include/sys/conf.h \
$(top_srcdir)/include/sys/console.h \
$(top_srcdir)/include/sys/cpupart.h \
$(top_srcdir)/include/sys/cpuvar.h \
$(top_srcdir)/include/sys/crc32.h \
$(top_srcdir)/include/sys/cred.h \
$(top_srcdir)/include/sys/ctype.h \
$(top_srcdir)/include/sys/ddi.h \
$(top_srcdir)/include/sys/debug.h \
$(top_srcdir)/include/sys/dirent.h \
$(top_srcdir)/include/sys/disp.h \
$(top_srcdir)/include/sys/dkio.h \
$(top_srcdir)/include/sys/dklabel.h \
$(top_srcdir)/include/sys/dnlc.h \
$(top_srcdir)/include/sys/dumphdr.h \
$(top_srcdir)/include/sys/efi_partition.h \
$(top_srcdir)/include/sys/errno.h \
$(top_srcdir)/include/sys/extdirent.h \
$(top_srcdir)/include/sys/fcntl.h \
$(top_srcdir)/include/sys/file.h \
$(top_srcdir)/include/sys/idmap.h \
$(top_srcdir)/include/sys/int_limits.h \
$(top_srcdir)/include/sys/int_types.h \
$(top_srcdir)/include/sys/inttypes.h \
$(top_srcdir)/include/sys/isa_defs.h \
$(top_srcdir)/include/sys/kidmap.h \
$(top_srcdir)/include/sys/kmem.h \
$(top_srcdir)/include/sys/kobj.h \
$(top_srcdir)/include/sys/kstat.h \
$(top_srcdir)/include/sys/list.h \
$(top_srcdir)/include/sys/mkdev.h \
$(top_srcdir)/include/sys/mntent.h \
$(top_srcdir)/include/sys/modctl.h \
$(top_srcdir)/include/sys/mode.h \
$(top_srcdir)/include/sys/mount.h \
$(top_srcdir)/include/sys/mutex.h \
$(top_srcdir)/include/sys/note.h \
$(top_srcdir)/include/sys/open.h \
$(top_srcdir)/include/sys/param.h \
$(top_srcdir)/include/sys/pathname.h \
$(top_srcdir)/include/sys/policy.h \
$(top_srcdir)/include/sys/pool.h \
$(top_srcdir)/include/sys/priv_impl.h \
$(top_srcdir)/include/sys/processor.h \
$(top_srcdir)/include/sys/proc.h \
$(top_srcdir)/include/sys/pset.h \
$(top_srcdir)/include/sys/random.h \
$(top_srcdir)/include/sys/refstr.h \
$(top_srcdir)/include/sys/resource.h \
$(top_srcdir)/include/sys/rwlock.h \
$(top_srcdir)/include/sys/sdt.h \
$(top_srcdir)/include/sys/sid.h \
$(top_srcdir)/include/sys/signal.h \
$(top_srcdir)/include/sys/stat.h \
$(top_srcdir)/include/sys/stropts.h \
$(top_srcdir)/include/sys/sunddi.h \
$(top_srcdir)/include/sys/sunldi.h \
$(top_srcdir)/include/sys/sysdc.h \
$(top_srcdir)/include/sys/sysevent.h \
$(top_srcdir)/include/sys/sysmacros.h \
$(top_srcdir)/include/sys/systeminfo.h \
$(top_srcdir)/include/sys/systm.h \
$(top_srcdir)/include/sys/taskq.h \
$(top_srcdir)/include/sys/thread.h \
$(top_srcdir)/include/sys/time.h \
$(top_srcdir)/include/sys/timer.h \
$(top_srcdir)/include/sys/t_lock.h \
$(top_srcdir)/include/sys/tsd.h \
$(top_srcdir)/include/sys/types32.h \
$(top_srcdir)/include/sys/types.h \
$(top_srcdir)/include/sys/u8_textprep.h \
$(top_srcdir)/include/sys/uio.h \
$(top_srcdir)/include/sys/unistd.h \
$(top_srcdir)/include/sys/utsname.h \
$(top_srcdir)/include/sys/va_list.h \
$(top_srcdir)/include/sys/varargs.h \
$(top_srcdir)/include/sys/vfs.h \
$(top_srcdir)/include/sys/vfs_opreg.h \
$(top_srcdir)/include/sys/vmsystm.h \
$(top_srcdir)/include/sys/vnode.h \
$(top_srcdir)/include/sys/zmod.h \
$(top_srcdir)/include/sys/zone.h
include/sys/acl.h \
include/sys/acl_impl.h \
include/sys/atomic.h \
include/sys/attr.h \
include/sys/bitmap.h \
include/sys/bootconf.h \
include/sys/bootprops.h \
include/sys/buf.h \
include/sys/byteorder.h \
include/sys/callb.h \
include/sys/callo.h \
include/sys/cmn_err.h \
include/sys/compress.h \
include/sys/condvar.h \
include/sys/conf.h \
include/sys/console.h \
include/sys/cpupart.h \
include/sys/cpuvar.h \
include/sys/crc32.h \
include/sys/cred.h \
include/sys/ctype.h \
include/sys/ddi.h \
include/sys/debug.h \
include/sys/dirent.h \
include/sys/disp.h \
include/sys/dkio.h \
include/sys/dklabel.h \
include/sys/dnlc.h \
include/sys/dumphdr.h \
include/sys/efi_partition.h \
include/sys/errno.h \
include/sys/extdirent.h \
include/sys/fcntl.h \
include/sys/file.h \
include/sys/idmap.h \
include/sys/int_limits.h \
include/sys/int_types.h \
include/sys/inttypes.h \
include/sys/isa_defs.h \
include/sys/kidmap.h \
include/sys/kmem.h \
include/sys/kobj.h \
include/sys/kstat.h \
include/sys/list.h \
include/sys/mkdev.h \
include/sys/mntent.h \
include/sys/modctl.h \
include/sys/mode.h \
include/sys/mount.h \
include/sys/mutex.h \
include/sys/note.h \
include/sys/open.h \
include/sys/param.h \
include/sys/pathname.h \
include/sys/policy.h \
include/sys/pool.h \
include/sys/priv_impl.h \
include/sys/processor.h \
include/sys/proc.h \
include/sys/pset.h \
include/sys/random.h \
include/sys/refstr.h \
include/sys/resource.h \
include/sys/rwlock.h \
include/sys/sdt.h \
include/sys/sid.h \
include/sys/signal.h \
include/sys/stat.h \
include/sys/stropts.h \
include/sys/sunddi.h \
include/sys/sunldi.h \
include/sys/sysdc.h \
include/sys/sysevent.h \
include/sys/sysmacros.h \
include/sys/systeminfo.h \
include/sys/systm.h \
include/sys/taskq.h \
include/sys/thread.h \
include/sys/time.h \
include/sys/timer.h \
include/sys/t_lock.h \
include/sys/tsd.h \
include/sys/types32.h \
include/sys/types.h \
include/sys/u8_textprep.h \
include/sys/uio.h \
include/sys/unistd.h \
include/sys/utsname.h \
include/sys/va_list.h \
include/sys/varargs.h \
include/sys/vfs.h \
include/sys/vfs_opreg.h \
include/sys/vmsystm.h \
include/sys/vnode.h \
include/sys/zmod.h \
include/sys/zone.h

USER_H =

Expand Down
6 changes: 4 additions & 2 deletions include/sys/fm/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
VPATH = @abs_top_srcdir@

COMMON_H =

KERNEL_H = \
$(top_srcdir)/include/sys/fm/protocol.h \
$(top_srcdir)/include/sys/fm/util.h
include/sys/fm/protocol.h \
include/sys/fm/util.h

USER_H =

Expand Down
4 changes: 3 additions & 1 deletion include/sys/fs/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
VPATH = @abs_top_srcdir@

COMMON_H =

KERNEL_H = \
$(top_srcdir)/include/sys/fs/swapnode.h
include/sys/fs/swapnode.h

USER_H =

Expand Down
4 changes: 3 additions & 1 deletion include/sys/sysevent/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
VPATH = @abs_top_srcdir@

COMMON_H =

KERNEL_H = \
$(top_srcdir)/include/sys/sysevent/eventdefs.h
include/sys/sysevent/eventdefs.h

USER_H =

Expand Down
Loading

0 comments on commit dc06fdb

Please sign in to comment.