sbin_PROGRAMS = losetup swapon
dist_man_MANS = fstab.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8
- utils_common = sundries.c xmalloc.c realpath.c fsprobe.c
-
- if !HAVE_VERSIONSORT
- fallback = ../lib/strverscmp.c
- endif
-
- headers_common = fstab.h mount_mntent.h mount_constants.h \
- lomount.h fsprobe.h realpath.h xmalloc.h \
- getusername.h loop.h sundries.h
-
- mount_common = fstab.c mount_mntent.c getusername.c lomount.c rmd160.c \
- $(utils_common) $(headers_common) ../lib/env.c ../lib/linux_version.c \
- ../lib/blkdev.c $(fallback)
-
-
- mount_SOURCES = mount.c $(mount_common) ../lib/setproctitle.c
- mount_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
+ # generic sources for all programs (mount, umount, losetup)
-srcs_common = sundries.c xmalloc.c ../lib/canonicalize.c sundries.h xmalloc.h
++srcs_common = sundries.c xmalloc.c ../lib/canonicalize.c sundries.h xmalloc.h rmd160.c
+
+ # generic header for mount and umount
+ hdrs_mount = fstab.h mount_mntent.h mount_constants.h \
+ lomount.h getusername.h loop.h
+
+ # generic sources for mount and umount
+ srcs_mount = fstab.c mount_mntent.c getusername.c lomount.c devname.c devname.h \
+ $(srcs_common) $(hdrs_mount) ../lib/env.c ../lib/linux_version.c \
+ ../lib/blkdev.c ../lib/fsprobe.c
+
+ # generic flags for all programs (except losetup)
+ # -- note that pkg-config autoconf macros (pkg.m4) does not differentiate
+ # between CFLAGS and CPPFLAGS, we follow this behaviour and use CFLAGS only.
+ ldadd_common =
+ ldadd_static =
+ cflags_common =
+
+ # generic libtool options for all static programs
+ ldflags_static ="-all-static"
+
+ mount_SOURCES = mount.c $(srcs_mount) ../lib/setproctitle.c
+ mount_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) $(cflags_common)
mount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
+ mount_LDADD = $(ldadd_common)
- umount_SOURCES = umount.c $(mount_common)
- umount_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
+ umount_SOURCES = umount.c $(srcs_mount)
+ umount_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) $(cflags_common)
umount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
+ umount_LDADD = $(ldadd_common)
- swapon_SOURCES = swapon.c swap_constants.h $(utils_common) \
- ../lib/linux_version.c ../lib/blkdev.c
+ swapon_SOURCES = swapon.c swap_constants.h ../lib/linux_version.c \
+ ../lib/blkdev.c ../lib/fsprobe.c ../lib/canonicalize.c
+ swapon_CFLAGS = $(cflags_common)
+ swapon_LDADD = $(ldadd_common)
- losetup_SOURCES = lomount.c sundries.c xmalloc.c realpath.c \
- loop.h lomount.h xmalloc.h sundries.h realpath.h rmd160.c $(fallback)
+ losetup_SOURCES = lomount.c $(srcs_common) loop.h lomount.h
losetup_CPPFLAGS = -DMAIN $(AM_CPPFLAGS)
-
- mount_LDADD = $(LDADD_common)
- umount_LDADD = $(LDADD_common)
- swapon_LDADD = $(LDADD_common)
-
- LDADD_common =
- LDADD_common_static =
mount_static_LDADD =
if HAVE_STATIC_MOUNT