summaryrefslogtreecommitdiffstats
path: root/build/config.mk
diff options
context:
space:
mode:
Diffstat (limited to 'build/config.mk')
-rw-r--r--build/config.mk27
1 files changed, 8 insertions, 19 deletions
diff --git a/build/config.mk b/build/config.mk
index 153838d..663926c 100644
--- a/build/config.mk
+++ b/build/config.mk
@@ -10,19 +10,12 @@ include build/exports.mk
config: gen/config.mk gen/config.h
.PHONY: config
-# Makefile fragments generated by `./configure`
-MKS := \
- gen/vars.mk \
- gen/flags.mk \
- gen/deps.mk \
- gen/pkgs.mk
-
# The main configuration file, which includes the others
-gen/config.mk: ${MKS}
+gen/config.mk: gen/vars.mk gen/flags.mk gen/pkgs.mk
${MSG} "[ GEN] $@"
@printf '# %s\n' "$@" >$@
- @printf 'include %s\n' ${.ALLSRC} >>$@
- ${VCAT} gen/config.mk
+ @printf 'include %s\n' $^ >>$@
+ ${VCAT} $@
.PHONY: gen/config.mk
# Saves the configurable variables
@@ -38,25 +31,21 @@ gen/vars.mk::
@printf 'MKDIR := %s\n' "$$XMKDIR" >>$@
@printf 'PKG_CONFIG := %s\n' "$$XPKG_CONFIG" >>$@
@printf 'RM := %s\n' "$$XRM" >>$@
+ @test -z "$$VERSION" || printf 'export VERSION=%s\n' "$$VERSION" >>$@
${VCAT} $@
# Sets the build flags. This depends on vars.mk and uses a recursive make so
# that the default flags can depend on variables like ${OS}.
gen/flags.mk: gen/vars.mk
- @+${MAKE} -sf build/flags.mk $@
+ @+XMAKEFLAGS="$$MAKEFLAGS" ${MAKE} -sf build/flags.mk $@
.PHONY: gen/flags.mk
-# Check for dependency generation support
-gen/deps.mk: gen/flags.mk
- @+${MAKE} -sf build/deps.mk $@
-.PHONY: gen/deps.mk
-
# Auto-detect dependencies and their build flags
gen/pkgs.mk: gen/flags.mk
- @+${MAKE} -sf build/pkgs.mk $@
+ @+XMAKEFLAGS="$$MAKEFLAGS" ${MAKE} -sf build/pkgs.mk $@
.PHONY: gen/pkgs.mk
# Compile-time feature detection
-gen/config.h: gen/config.mk
- @+${MAKE} -sf build/header.mk $@
+gen/config.h: gen/pkgs.mk
+ @+XMAKEFLAGS="$$MAKEFLAGS" ${MAKE} -sf build/header.mk $@
.PHONY: gen/config.h