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#1082
  • Loading branch information
FransUrbo committed Jun 11, 2014
1 parent 21b446a commit fbf2338
Show file tree
Hide file tree
Showing 53 changed files with 406 additions and 294 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 @@ -45,11 +46,11 @@ checkstyle:
! -name '*.mod.c' -type f -exec scripts/cstyle.pl {} \+

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
2 changes: 2 additions & 0 deletions cmd/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
VPATH = @abs_top_srcdir@

SUBDIRS = zfs zpool zdb zhack zinject zstreamdump ztest zpios
SUBDIRS += mount_zfs fsck_zfs zvol_id vdev_id arcstat dbufstat zed
4 changes: 3 additions & 1 deletion cmd/arcstat/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
bin_SCRIPTS = arcstat.py
VPATH = @abs_top_srcdir@

bin_SCRIPTS = $(top_srcdir)/cmd/arcstat/arcstat.py
EXTRA_DIST = $(bin_SCRIPTS)
4 changes: 3 additions & 1 deletion cmd/dbufstat/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
bin_SCRIPTS = dbufstat.py
VPATH = @abs_top_srcdir@

bin_SCRIPTS = $(top_srcdir)/cmd/dbufstat/dbufstat.py
EXTRA_DIST = $(bin_SCRIPTS)
4 changes: 3 additions & 1 deletion cmd/fsck_zfs/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dist_sbin_SCRIPTS = fsck.zfs
VPATH = @abs_top_srcdir@

dist_sbin_SCRIPTS = $(top_srcdir)/cmd/fsck_zfs/fsck.zfs
4 changes: 3 additions & 1 deletion cmd/vdev_id/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dist_udev_SCRIPTS = vdev_id
VPATH = @abs_top_srcdir@

dist_udev_SCRIPTS = $(top_srcdir)/cmd/vdev_id/vdev_id
2 changes: 2 additions & 0 deletions config/Rules.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
VPATH = @abs_top_srcdir@

DEFAULT_INCLUDES = -include ${top_builddir}/zfs_config.h

AM_LIBTOOLFLAGS = --silent
Expand Down
10 changes: 6 additions & 4 deletions dracut/90zfs/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
VPATH = @abs_top_srcdir@

pkgdracutdir = $(dracutdir)/modules.d/90zfs
pkgdracut_SCRIPTS = \
$(top_srcdir)/dracut/90zfs/module-setup.sh \
$(top_srcdir)/dracut/90zfs/mount-zfs.sh \
$(top_srcdir)/dracut/90zfs/parse-zfs.sh
module-setup.sh \
mount-zfs.sh \
parse-zfs.sh

EXTRA_DIST = \
$(top_srcdir)/dracut/90zfs/module-setup.sh.in \
Expand All @@ -15,7 +17,7 @@ $(pkgdracut_SCRIPTS):
-e 's,@udevdir\@,$(udevdir),g' \
-e 's,@udevruledir\@,$(udevruledir),g' \
-e 's,@sysconfdir\@,$(sysconfdir),g' \
'[email protected]' >'$@'
"$(abs_top_srcdir)/dracut/90zfs/$@.in' >'$@'

distclean-local::
-$(RM) $(pkgdracut_SCRIPTS)
2 changes: 2 additions & 0 deletions dracut/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
VPATH = @abs_top_srcdir@

SUBDIRS = 90zfs

EXTRA_DIST = README.dracut.markdown
2 changes: 2 additions & 0 deletions etc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
VPATH = @abs_top_srcdir@

SUBDIRS = zfs $(ZFS_INIT_SYSTEMD) $(ZFS_INIT_SYSV) $(ZFS_MODULE_LOAD)
DIST_SUBDIRS = init.d zfs systemd modules-load.d
12 changes: 7 additions & 5 deletions etc/init.d/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
VPATH = @abs_top_srcdir@

initdir = $(DEFAULT_INIT_DIR)
init_SCRIPTS = zfs

EXTRA_DIST = \
$(top_srcdir)/etc/init.d/zfs.fedora.in \
$(top_srcdir)/etc/init.d/zfs.gentoo.in \
$(top_srcdir)/etc/init.d/zfs.lsb.in \
$(top_srcdir)/etc/init.d/zfs.lunar.in \
$(top_srcdir)/etc/init.d/zfs.redhat.in
etc/init.d/zfs.fedora.in \
etc/init.d/zfs.gentoo.in \
etc/init.d/zfs.lsb.in \
etc/init.d/zfs.lunar.in \
etc/init.d/zfs.redhat.in

$(init_SCRIPTS):
-$(SED) -e 's,@bindir\@,$(bindir),g' \
Expand Down
6 changes: 4 additions & 2 deletions etc/modules-load.d/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
VPATH = @abs_top_srcdir@

modulesload_DATA = \
$(top_srcdir)/etc/modules-load.d/zfs.conf
zfs.conf

EXTRA_DIST = \
$(top_srcdir)/etc/modules-load.d/zfs.conf.in

$(modulesload_DATA):
-$(SED) \
-e '' \
'$@.in' >'$@'
"$(top_srcdir)/etc/modules-load.d/$@.in" >'$@'

distclean-local::
-$(RM) $(modulesload_DATA)
2 changes: 2 additions & 0 deletions etc/systemd/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
VPATH = @abs_top_srcdir@

SUBDIRS = system
30 changes: 16 additions & 14 deletions etc/systemd/system/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
VPATH = @abs_top_srcdir@

systemdpreset_DATA = \
$(top_srcdir)/etc/systemd/system/50-zfs.preset
etc/systemd/system/50-zfs.preset
systemdunit_DATA = \
$(top_srcdir)/etc/systemd/system/zed.service \
$(top_srcdir)/etc/systemd/system/zfs-import-cache.service \
$(top_srcdir)/etc/systemd/system/zfs-import-scan.service \
$(top_srcdir)/etc/systemd/system/zfs-mount.service \
$(top_srcdir)/etc/systemd/system/zfs-share.service \
$(top_srcdir)/etc/systemd/system/zfs.target
etc/systemd/system/zed.service \
etc/systemd/system/zfs-import-cache.service \
etc/systemd/system/zfs-import-scan.service \
etc/systemd/system/zfs-mount.service \
etc/systemd/system/zfs-share.service \
etc/systemd/system/zfs.target

EXTRA_DIST = \
$(top_srcdir)/etc/systemd/system/zed.service.in \
$(top_srcdir)/etc/systemd/system/zfs-import-cache.service.in \
$(top_srcdir)/etc/systemd/system/zfs-import-scan.service.in \
$(top_srcdir)/etc/systemd/system/zfs-mount.service.in \
$(top_srcdir)/etc/systemd/system/zfs-share.service.in \
$(top_srcdir)/etc/systemd/system/zfs.target.in \
$(top_srcdir)/etc/systemd/system/50-zfs.preset.in
etc/systemd/system/zed.service.in \
etc/systemd/system/zfs-import-cache.service.in \
etc/systemd/system/zfs-import-scan.service.in \
etc/systemd/system/zfs-mount.service.in \
etc/systemd/system/zfs-share.service.in \
etc/systemd/system/zfs.target.in \
etc/systemd/system/50-zfs.preset.in

$(systemdunit_DATA):
-$(SED) -e 's,@bindir\@,$(bindir),g' \
Expand Down
10 changes: 6 additions & 4 deletions etc/zfs/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
VPATH = @abs_top_srcdir@

pkgsysconfdir = $(sysconfdir)/zfs

pkgsysconf_DATA = \
vdev_id.conf.alias.example \
vdev_id.conf.sas_direct.example \
vdev_id.conf.sas_switch.example \
vdev_id.conf.multipath.example
etc/zfs/vdev_id.conf.alias.example \
etc/zfs/vdev_id.conf.sas_direct.example \
etc/zfs/vdev_id.conf.sas_switch.example \
etc/zfs/vdev_id.conf.multipath.example

EXTRA_DIST = $(pkgsysconf_DATA)
32 changes: 17 additions & 15 deletions include/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
VPATH = @abs_top_srcdir@

SUBDIRS = linux sys

COMMON_H = \
$(top_srcdir)/include/zfeature_common.h \
$(top_srcdir)/include/zfs_comutil.h \
$(top_srcdir)/include/zfs_deleg.h \
$(top_srcdir)/include/zfs_fletcher.h \
$(top_srcdir)/include/zfs_namecheck.h \
$(top_srcdir)/include/zfs_prop.h \
$(top_srcdir)/include/zpios-ctl.h
include/zfeature_common.h \
include/zfs_comutil.h \
include/zfs_deleg.h \
include/zfs_fletcher.h \
include/zfs_namecheck.h \
include/zfs_prop.h \
include/zpios-ctl.h

KERNEL_H = \
$(top_srcdir)/include/zpios-internal.h
include/zpios-internal.h

USER_H = \
$(top_srcdir)/include/libnvpair.h \
$(top_srcdir)/include/libuutil_common.h \
$(top_srcdir)/include/libuutil.h \
$(top_srcdir)/include/libuutil_impl.h \
$(top_srcdir)/include/libzfs.h \
$(top_srcdir)/include/libzfs_core.h \
$(top_srcdir)/include/libzfs_impl.h
include/libnvpair.h \
include/libuutil_common.h \
include/libuutil.h \
include/libuutil_impl.h \
include/libzfs.h \
include/libzfs_core.h \
include/libzfs_impl.h

EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)

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

COMMON_H =

KERNEL_H = \
$(top_srcdir)/include/linux/dcache_compat.h \
$(top_srcdir)/include/linux/xattr_compat.h \
$(top_srcdir)/include/linux/vfs_compat.h \
$(top_srcdir)/include/linux/blkdev_compat.h
include/linux/dcache_compat.h \
include/linux/xattr_compat.h \
include/linux/vfs_compat.h \
include/linux/blkdev_compat.h

USER_H =

Expand Down
Loading

0 comments on commit fbf2338

Please sign in to comment.