]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Fix build system to be compatible with BSD pmake
authorTheodore Ts'o <tytso@mit.edu>
Sat, 2 Jan 2016 02:44:12 +0000 (21:44 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 2 Jan 2016 06:29:55 +0000 (01:29 -0500)
This fixes a number of incompatibilities which caused maint branch to
fail to build on on FreeBSD.  Also fix the Makefile in the tests
directory so that "make -jN check" works correctly on FreeBSD.

Previously the Makefile in the tests directory used a construct which
was specific to GNU Make, which which silently expanded to an empty
list, which caused "make check" to be a no-op when running using BSD's
pmake.  This Makefile has been changed to use the != macro assignment
syntax which is common to GNU make and BSD pmake.  It's technically
not completely portable (it will not be recognized by Solaris's ccs
make, for example), but most other operating systems ship GNU make
(Solaris, AIX), or BSD pmake (*BSD, Mac OS) as either the primary or
alternative make utility that this should an acceptable compromise,
since it makes running all of tests using something like "make -j8
check" or "make -j16 check" run *much* faster.

There are still some caveats if using BSD pmake; in particular, if the
configure script is run on a system which has GNU make (installed as
gmake on FreeBSD for example), the configure script will find it, and
enable some GNU make features in the Makefile, and the generated
makefiles *must* be built using gmake.  However, if isolated build
jail / chroot is used which only has pmake, the Makefiles should now
work with pmake.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
MCONFIG.in
Makefile.in
misc/Makefile.in
tests/Makefile.in

index f1003cfa6f982b7604b87fe4855ffacb43ebfa41..10c3025b385d7affc201be06162837e9bc90c0d4 100644 (file)
@@ -59,11 +59,11 @@ pkgconfigdir = $(libdir)/pkgconfig
 @ifGNUmake@   ifeq ("$(C)", "1")
 @ifGNUmake@     CHECK_CMD=$(CHECK) $(CHECK_OPTS)
 @ifGNUmake@    else
-@ifGNUmake@     CHECK_CMD=@true
+@ifGNUmake@     CHECK_CMD=true
 @ifGNUmake@   endif
 @ifGNUmake@ endif
 
-@ifNotGNUmake@ CHECK_CMD=@true
+@ifNotGNUmake@ CHECK_CMD=true
 
 CC = @CC@
 BUILD_CC = @BUILD_CC@
index f5727a807967459909099458c46f01990a3052c9..f443fba598c27fa72bc41c120c498b381015f171 100644 (file)
@@ -19,7 +19,7 @@ LIB_SUBDIRS=lib/et lib/ss lib/e2p $(UUID_LIB_SUBDIR) $(BLKID_LIB_SUBDIR) $(QUOTA
 PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
 SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
 
-SUBS= util/subst.conf lib/config.h lib/dirpaths.h \
+SUBS= util/subst.conf lib/config.h $(top_builddir)/lib/dirpaths.h \
        lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h
 
 TAR=tar
@@ -34,6 +34,7 @@ subs: $(DEP_SUBSTITUTE)
                then $(MAKE) $$i || exit $$? ; fi ; done
        @(if test -d lib/et ; then cd lib/et && $(MAKE) compile_et; fi)
        @(if test -d lib/ext2fs ; then cd lib/ext2fs && $(MAKE) ext2_err.h; fi)
+       @(if test -d e2fsck ; then cd e2fsck && $(MAKE) prof_err.h; fi)
 
 progs: all-progs-recursive
 libs: all-libs-recursive
index c203fb43af27963b55a06cded386bca40572422f..e7642c6980c5081f4d54a5e2618c642885133912 100644 (file)
@@ -123,8 +123,8 @@ prof_err.c prof_err.h: $(srcdir)/../e2fsck/prof_err.et
        $(Q) $(COMPILE_ET) $(srcdir)/../e2fsck/prof_err.et
 
 profile.h: $(top_srcdir)/e2fsck/profile.h
-       $(E) "  CP $<"
-       $(Q) cp $< $@
+       $(E) "  CP $@"
+       $(Q) cp $(top_srcdir)/e2fsck/profile.h $@
 
 mke2fs.conf: $(srcdir)/mke2fs.conf.in
        if test -f $(srcdir)/mke2fs.conf.custom.in ; then \
index 37a043ea657e6e292f450f83c8447295a7c1cf64..d98455103d6d6b1ea6e10c37ad2fc9fb9b222dad 100644 (file)
@@ -35,10 +35,16 @@ mke2fs.conf: $(srcdir)/mke2fs.conf.in
 
 .PHONY : test_pre test_post check always_run
 
-TESTS=$(wildcard $(srcdir)/[a-z]_*)
+always_run:
+
+TESTS != echo $(srcdir)/[a-z]_*
+
 $(TESTS):: test_one always_run
        @./test_one $@
 
+foo:
+       echo $(TESTS)
+
 test_pre:
        @$(RM) -f *.failed
        @echo "Running e2fsprogs test suite..."