From 0035cc4ff492cab91adeb49d0c577fe5982064bd Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 18 Apr 2024 15:27:27 -0400 Subject: config: Check for program_invocation_short_name This lets us pick it up on musl too, since there's no __MUSL__ macro. Link: https://wiki.musl-libc.org/faq#Q:-Why-is-there-no-%3Ccode%3E__MUSL__%3C/code%3E-macro? --- config/config.mk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'config/config.mk') diff --git a/config/config.mk b/config/config.mk index 5a6f8d2..5750b49 100644 --- a/config/config.mk +++ b/config/config.mk @@ -6,6 +6,10 @@ include config/prelude.mk include config/exports.mk +# All configuration steps +config: ${CONFIG} ${GEN}/config.h +.PHONY: config + # Makefile fragments generated by `make config` MKS := \ ${GEN}/vars.mk \ @@ -17,7 +21,7 @@ MKS := \ ${CONFIG}: ${MKS} ${MSG} "[ GEN] ${TGT}" @printf '# %s\n' "${TGT}" >$@ - @printf 'include $${GEN}/%s\n' ${.ALLSRC:${GEN}/%=%} >>$@ + @printf 'include $${GEN}/%s\n' ${MKS:${GEN}/%=%} >>$@ ${VCAT} ${CONFIG} .PHONY: ${CONFIG} @@ -67,3 +71,8 @@ ${GEN}/pkgs.mk: ${PKG_MKS} ${PKG_MKS}: ${GEN}/flags.mk @+${MAKE} -sf config/pkg.mk TARGET=$@ .PHONY: ${PKG_MKS} + +# Compile-time feature detection +${GEN}/config.h: ${CONFIG} + @+${MAKE} -sf config/header.mk $@ +.PHONY: ${GEN}/config.h -- cgit v1.2.3