From 4bc06bd999786da359a05801bf9106597fe57298 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 21 Jun 2024 11:57:18 -0400 Subject: build: Generate config.mk after config.h That way if ./configure fails, make will complain about it directly. --- build/config.mk | 8 ++++---- build/header.mk | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build/config.mk b/build/config.mk index 24873ec..80206c7 100644 --- a/build/config.mk +++ b/build/config.mk @@ -7,7 +7,7 @@ include build/prelude.mk include build/exports.mk # All configuration steps -config: gen/config.mk gen/config.h +config: gen/config.mk .PHONY: config # Makefile fragments generated by `./configure` @@ -18,10 +18,10 @@ MKS := \ gen/pkgs.mk # The main configuration file, which includes the others -gen/config.mk: ${MKS} +gen/config.mk: ${MKS} gen/config.h ${MSG} "[ GEN] $@" @printf '# %s\n' "$@" >$@ - @printf 'include %s\n' ${.ALLSRC} >>$@ + @printf 'include %s\n' ${MKS} >>$@ ${VCAT} gen/config.mk .PHONY: gen/config.mk @@ -57,6 +57,6 @@ gen/pkgs.mk: gen/flags.mk .PHONY: gen/pkgs.mk # Compile-time feature detection -gen/config.h: gen/config.mk +gen/config.h: gen/pkgs.mk @+XMAKEFLAGS="$$MAKEFLAGS" ${MAKE} -sf build/header.mk $@ .PHONY: gen/config.h diff --git a/build/header.mk b/build/header.mk index 632afb6..65e95cb 100644 --- a/build/header.mk +++ b/build/header.mk @@ -4,7 +4,10 @@ # Makefile that generates gen/config.h include build/prelude.mk -include gen/config.mk +include gen/vars.mk +include gen/flags.mk +include gen/deps.mk +include gen/pkgs.mk include build/exports.mk # All header fragments we generate -- cgit v1.2.3