]> err.no Git - util-linux/commitdiff
build-sys: factor out common parts from mount/Makefile.am
authorStepan Kasal <skasal@redhat.com>
Tue, 22 May 2007 11:00:23 +0000 (13:00 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 22 May 2007 21:38:06 +0000 (23:38 +0200)
Signed-off-by: Stepan Kasal <skasal@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
mount/Makefile.am

index fa60830d2862302bd4cdbd693f0024751a9840b8..f40bdd7f7b6ad1be6b62bfaa96b45e0f14ce7527 100644 (file)
@@ -6,12 +6,14 @@ bin_PROGRAMS = mount umount
 sbin_PROGRAMS = losetup swapon
 man_MANS = fstab.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8
 
-MNTHDRS = fstab.h linux_fs.h mount_mntent.h mount_constants.h my_dev_t.h \
+utils_common = sundries.c xmalloc.c realpath.c fsprobe.c
+
+headers_common = fstab.h linux_fs.h mount_mntent.h mount_constants.h my_dev_t.h \
        mount_paths.h lomount.h fsprobe.h realpath.h xmalloc.h \
        getusername.h loop.h sundries.h
 
-mount_common = fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
-       fsprobe.c getusername.c lomount.c $(MNTHDRS) ../lib/env.c
+mount_common = fstab.c mount_mntent.c getusername.c lomount.c \
+       $(utils_common) $(headers_common) ../lib/env.c
 
 mount_SOURCES = mount.c $(mount_common) ../lib/setproctitle.c
 mount_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
@@ -21,23 +23,20 @@ umount_SOURCES = umount.c $(mount_common)
 umount_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
 umount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
 
-swapon_SOURCES = swapon.c xmalloc.c \
-       swap_constants.h realpath.c fsprobe.c sundries.c
+swapon_SOURCES = swapon.c swap_constants.h $(utils_common)
 
 losetup_SOURCES = lomount.c loop.h lomount.h
 losetup_CPPFLAGS = -DMAIN $(AM_CPPFLAGS)
 
-mount_LDADD =
-umount_LDADD =
-swapon_LDADD =
+mount_LDADD = $(LDADD_common)
+umount_LDADD = $(LDADD_common)
+swapon_LDADD = $(LDADD_common)
+
+LDADD_common =
 
 if HAVE_BLKID
-mount_SOURCES += fsprobe_blkid.c
-umount_SOURCES += fsprobe_blkid.c
-swapon_SOURCES += fsprobe_blkid.c
-mount_LDADD += -lblkid -luuid
-umount_LDADD += -lblkid -luuid
-swapon_LDADD += -lblkid -luuid
+utils_common += fsprobe_blkid.c
+LDADD_common += -lblkid -luuid
 endif
 
 if HAVE_SELINUX
@@ -45,12 +44,8 @@ mount_LDADD += -lselinux
 endif
 
 if HAVE_VOLUME_ID
-mount_SOURCES += fsprobe_volumeid.c
-umount_SOURCES += fsprobe_volumeid.c
-swapon_SOURCES += fsprobe_volumeid.c
-mount_LDADD += -lvolume_id
-umount_LDADD += -lvolume_id
-swapon_LDADD += -lvolume_id
+utils_common += fsprobe_volumeid.c
+LDADD_common += -lvolume_id
 endif
 
 if HAVE_PIVOT_ROOT
@@ -59,7 +54,7 @@ man_MANS += pivot_root.8
 endif
 
 noinst_PROGRAMS = mtab_lock_test
-mtab_lock_test_SOURCES = fstab.c sundries.c xmalloc.c $(MNTHDRS)
+mtab_lock_test_SOURCES = fstab.c sundries.c xmalloc.c $(headers_common)
 mtab_lock_test_CPPFLAGS = -DMAIN_TEST_MTABLOCK $(AM_CPPFLAGS)
 
 install-exec-hook: