]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
build: populate include/xfs before building
authorDave Chinner <dchinner@redhat.com>
Tue, 30 Jun 2015 01:21:25 +0000 (11:21 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 30 Jun 2015 01:21:25 +0000 (11:21 +1000)
To avoid conflicts between dependency generation and header
installation, we need to separate the header installation out into a
separate step in the build that needs to be done before the actual
build.

Add a "HEADER_SUBDIRS" list to indicate which directories we need
to build headers in, and iterate it before the SUBDIRS build target.
Replace the implicit header installation rules in makefiles with
explict header targets so this will work.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Makefile
include/Makefile
include/buildrules
libxfs/Makefile

index 24b9e2e11c22a2f674ecc54d9de2be34a573c6a5..6d6803bbc5c5cff8e4c31eb7298e5403ccafc680 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -40,6 +40,8 @@ LDIRDIRT = $(SRCDIR)
 LDIRT += $(SRCTAR)
 endif
 
+# header install rules to populate include/xfs correctly
+HDR_SUBDIRS = include libxfs
 
 DLIB_SUBDIRS = libxlog libxcmd libhandle libdisk
 LIB_SUBDIRS = libxfs $(DLIB_SUBDIRS)
@@ -53,6 +55,7 @@ default: include/builddefs include/platform_defs.h
 ifeq ($(HAVE_BUILDDEFS), no)
        $(Q)$(MAKE) $(MAKEOPTS) -C . $@
 else
+       $(Q)$(MAKE) $(MAKEOPTS) headers
        $(Q)$(MAKE) $(MAKEOPTS) $(SUBDIRS)
 endif
 
index 6b9c7f0bfe713e69294923b179244265149fbaf2..a0a6554d6a9add1e329003b281eebd9f53abeb23 100644 (file)
@@ -54,14 +54,14 @@ LSRCFILES += $(DKHFILES) $(LIBHFILES)
 LDIRT = disk
 LDIRDIRT = xfs
 
-default install: .xfs disk
+default install: disk
 
 disk:
        @echo "    [LN]     $@"
        $(Q)$(LN_S) . $@
 
 # set up include/xfs header directory
-.xfs: $(addsuffix -hdrs, $(HFILES) $(QAHFILES) $(PHFILES) $(DKHFILES) $(LIBHFILES))
+headers: $(addsuffix -hdrs, $(HFILES) $(QAHFILES) $(PHFILES) $(DKHFILES) $(LIBHFILES))
 
 %-hdrs: xfs
        $(Q)$(LN_S) -f $(PWD)/include/$* xfs/$*
index dbd9e10a7045ffe08b2fb5d206e583c9e1993c27..1c9fe2819b238fc576ae9784bb76d5dfa1eef446 100644 (file)
@@ -13,6 +13,11 @@ clean clobber : $(addsuffix -clean,$(SUBDIRS))
        @echo "Cleaning $*"
        $(Q)$(MAKE) $(MAKEOPTS) -C $* clean
 
+headers: $(addsuffix -headers, $(HDR_SUBDIRS))
+%-headers:
+       @echo "   [HEADERS] $*"
+       $(Q)$(MAKE) $(MAKEOPTS) -C $* headers
+
 # Never blow away subdirs
 ifdef SUBDIRS
 .PRECIOUS: $(SUBDIRS)
index a3c9ab53a2884c1595a639d988abd1e5455092b5..afd0af3d4832fbd6070e456e32375710298f583c 100644 (file)
@@ -102,7 +102,7 @@ DEBUG = -DNDEBUG
 
 LDIRT = gen_crc32table crc32table.h crc32selftest
 
-default: xfs crc32selftest ltdepend $(LTLIBRARY)
+default: crc32selftest ltdepend $(LTLIBRARY)
 
 crc32table.h: gen_crc32table.c
        @echo "    [CC]     gen_crc32table"
@@ -121,7 +121,7 @@ crc32selftest: gen_crc32table.c crc32table.h crc32.c
        $(Q) ./$@
 
 # set up include/xfs header directory
-xfs: $(addsuffix -hdrs, $(PKGHFILES) $(QAHFILES))
+headers: $(addsuffix -hdrs, $(PKGHFILES) $(QAHFILES))
 
 %-hdrs:
        $(Q)$(LN_S) -f $(PWD)/libxfs/$* $(TOPDIR)/include/xfs/$*