diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-04-26 17:42:44 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-04-26 17:43:54 -0400 |
commit | e061b6da5ee46a334169d4e6a52e49857ae22f55 (patch) | |
tree | 54be48f77a01ef3dce27e2e7df812e0846ddcd12 /config/pkgs.mk | |
parent | 83dd04452498408c1d46b7282ed08e9f5a1e76a8 (diff) | |
download | bfs-e061b6da5ee46a334169d4e6a52e49857ae22f55.tar.xz |
config: Move .c files into config/{use,has} subdirectories
Diffstat (limited to 'config/pkgs.mk')
-rw-r--r-- | config/pkgs.mk | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/config/pkgs.mk b/config/pkgs.mk index 2c100ab..898f262 100644 --- a/config/pkgs.mk +++ b/config/pkgs.mk @@ -8,15 +8,9 @@ include ${GEN}/vars.mk include ${GEN}/flags.mk include config/exports.mk -# External dependencies -USE_PKGS := \ - ${GEN}/libacl.use \ - ${GEN}/libcap.use \ - ${GEN}/libselinux.use \ - ${GEN}/liburing.use \ - ${GEN}/oniguruma.use +HEADERS := ${ALL_PKGS:%=${GEN}/use/%.h} -${GEN}/pkgs.mk: ${USE_PKGS} +${GEN}/pkgs.mk: ${HEADERS} ${MSG} "[ GEN] ${TGT}" printf '# %s\n' "${TGT}" >$@ gen() { \ @@ -25,18 +19,18 @@ ${GEN}/pkgs.mk: ${USE_PKGS} printf 'LDFLAGS += %s\n' "$$(config/pkgconf.sh --ldflags "$$@")"; \ printf 'LDLIBS := %s $${LDLIBS}\n' "$$(config/pkgconf.sh --ldlibs "$$@")"; \ }; \ - gen $$(cat ${.ALLSRC}) >>$@ + gen $$(grep -l ' true$$' ${.ALLSRC} | sed 's|.*/\(.*\)\.h|\1|') >>$@ ${VCAT} $@ + .PHONY: ${GEN}/pkgs.mk -# Convert ${GEN}/foo.use to foo -PKG = ${@:${GEN}/%.use=%} +# Convert ${GEN}/use/foo.h to foo +PKG = ${@:${GEN}/use/%.h=%} -${USE_PKGS}:: - if config/pkgconf.sh ${PKG} 2>$@.log; then \ - printf '%s\n' ${PKG} >$@; \ - test "${IS_V}" || printf '[ CC ] %-${MSG_WIDTH}s ✔\n' config/${PKG}.c; \ +${HEADERS}:: + ${MKDIR} ${@D} + if config/define-if.sh use/${PKG} config/pkgconf.sh ${PKG} >$@ 2>$@.log; then \ + test "${IS_V}" || printf '[ CC ] %-${MSG_WIDTH}s ✔\n' use/${PKG}.c; \ else \ - : >$@; \ - test "${IS_V}" || printf '[ CC ] %-${MSG_WIDTH}s ✘\n' config/${PKG}.c; \ + test "${IS_V}" || printf '[ CC ] %-${MSG_WIDTH}s ✘\n' use/${PKG}.c; \ fi |