diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-04-17 12:32:22 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-04-17 12:32:22 -0400 |
commit | 9f1107cf041d44e79f566f41fc117321fb42881f (patch) | |
tree | 6dc927bfaf1a2b79fcf259d02a059599dba5447a /config/config.mk | |
parent | 94f26cec62be7f0d766f80f7376ea5e0040948ae (diff) | |
download | bfs-9f1107cf041d44e79f566f41fc117321fb42881f.tar.xz |
build: Directly generate version.c
Diffstat (limited to 'config/config.mk')
-rw-r--r-- | config/config.mk | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/config/config.mk b/config/config.mk index 9d64eec..4771a5e 100644 --- a/config/config.mk +++ b/config/config.mk @@ -17,7 +17,7 @@ MKS := \ # The main configuration file, which includes the others ${CONFIG}: ${MKS} ${MSG} "[ GEN] ${TGT}" - @printf '# %s\n' "$@" >$@ + @printf '# %s\n' "${TGT}" >$@ @printf 'include $${GEN}/%s\n' ${.ALLSRC:${GEN}/%=%} >>$@ ${VCAT} ${CONFIG} .PHONY: ${CONFIG} @@ -26,7 +26,7 @@ ${CONFIG}: ${MKS} ${GEN}/vars.mk:: @${MKDIR} ${@D} ${MSG} "[ GEN] ${TGT}" - @printf '# %s\n' "$@" >$@ + @printf '# %s\n' "${TGT}" >$@ @printf 'PREFIX := %s\n' "$$XPREFIX" >>$@ @printf 'MANDIR := %s\n' "$$XMANDIR" >>$@ @printf 'OS := %s\n' "$${OS:-$$(uname)}" >>$@ @@ -54,8 +54,10 @@ ${GEN}/deps.mk: ${GEN}/flags.mk ${GEN}/objs.mk:: @${MKDIR} ${@D} ${MSG} "[ GEN] ${TGT}" - @printf '# %s\n' "$@" >$@ - @for obj in ${OBJS:${OBJ}/%.o=%}; do printf '$${OBJ}/%s.o: %s.c\n' "$$obj" "$$obj"; done >>$@ + @printf '# %s\n' "${TGT}" >$@ + @for obj in ${OBJS:${OBJ}/%.o=%}; do \ + printf '$${OBJ}/%s.o: %s.c\n' "$$obj" "$$obj"; \ + done | sed 's|: gen/|: $${GEN}/|' >>$@ # External dependencies PKG_MKS := \ @@ -67,7 +69,7 @@ PKG_MKS := \ # Auto-detect dependencies and their build flags ${GEN}/pkgs.mk: ${PKG_MKS} - @printf '# %s\n' "$@" >$@ + @printf '# %s\n' "${TGT}" >$@ @printf 'include $${GEN}/%s\n' ${.ALLSRC:${GEN}/%=%} >>$@ @+${MAKE} -sf config/pkgs.mk .PHONY: ${GEN}/pkgs.mk |