Fix build system to be compatible with BSD pmake

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>
test-maint
Theodore Ts'o 2016-01-01 21:44:12 -05:00
parent d030908bfc
commit 0355d6d047
4 changed files with 13 additions and 6 deletions

View 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@

View 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

View 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 \

View 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..."