diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2025-05-26 23:30:28 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2025-05-26 23:30:28 -0400 |
commit | 397181df7c7372bdf4897296dabe386fa4212ea8 (patch) | |
tree | d07bfd677de2511c478f2a1e41c68914236914ab | |
parent | 7e92bc9d00db4bb35b491881f54484b24d3ed97d (diff) | |
download | bfs-397181df7c7372bdf4897296dabe386fa4212ea8.tar.xz |
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | build/config.mk | 2 | ||||
-rw-r--r-- | build/flags.mk | 4 | ||||
-rw-r--r-- | build/header.mk | 4 | ||||
-rw-r--r-- | build/pkgs.mk | 2 | ||||
-rw-r--r-- | build/prelude.mk | 8 |
6 files changed, 11 insertions, 13 deletions
@@ -92,7 +92,7 @@ OBJS += obj/src/main.o ${BINS}: @${MKDIR} ${@D} - +${MSG} "[ LD ] $@" ${CC} ${_CFLAGS} ${_LDFLAGS} ${.ALLSRC} ${_LDLIBS} -o $@ + +${MSG} "[ LD ] $@" ${CC} ${_CFLAGS} ${_LDFLAGS} $^ ${_LDLIBS} -o $@ ${POSTLINK} # Get the .c file for a .o file @@ -105,7 +105,7 @@ gen/version.i.new:: .SILENT: gen/version.i.new gen/version.i: gen/version.i.new - test -e $@ && cmp -s $@ ${.ALLSRC} && ${RM} ${.ALLSRC} || mv ${.ALLSRC} $@ + test -e $@ && cmp -s $@ $^ && ${RM} $^ || mv $^ $@ .SILENT: gen/version.i obj/src/version.o: gen/version.i diff --git a/build/config.mk b/build/config.mk index 7f8662a..663926c 100644 --- a/build/config.mk +++ b/build/config.mk @@ -14,7 +14,7 @@ config: gen/config.mk gen/config.h gen/config.mk: gen/vars.mk gen/flags.mk gen/pkgs.mk ${MSG} "[ GEN] $@" @printf '# %s\n' "$@" >$@ - @printf 'include %s\n' ${.ALLSRC} >>$@ + @printf 'include %s\n' $^ >>$@ ${VCAT} $@ .PHONY: gen/config.mk diff --git a/build/flags.mk b/build/flags.mk index fbdf8cf..3748a8a 100644 --- a/build/flags.mk +++ b/build/flags.mk @@ -110,8 +110,8 @@ gen/flags.mk: ${AUTO_FLAGS} @printf '_LDLIBS := %s\n' "$$XLDLIBS" >>$@ @printf 'NOLIBS := %s\n' "$$XNOLIBS" >>$@ @test "${OS}-${SAN}" != FreeBSD-y || printf 'POSTLINK = elfctl -e +noaslr $$@\n' >>$@ - @cat ${.ALLSRC} >>$@ - @cat ${.ALLSRC:%=%.log} >gen/flags.log + @cat $^ >>$@ + @cat ${^:%=%.log} >gen/flags.log ${VCAT} $@ .PHONY: gen/flags.mk diff --git a/build/header.mk b/build/header.mk index 13672ba..f15829a 100644 --- a/build/header.mk +++ b/build/header.mk @@ -70,9 +70,9 @@ gen/config.h: ${PKG_HEADERS} ${HEADERS} @printf '// %s\n' "$@" >$@ @printf '#ifndef BFS_CONFIG_H\n' >>$@ @printf '#define BFS_CONFIG_H\n' >>$@ - @cat ${.ALLSRC} >>$@ + @cat $^ >>$@ @printf '#endif // BFS_CONFIG_H\n' >>$@ - @cat gen/flags.log ${.ALLSRC:%=%.log} >gen/config.log + @cat gen/flags.log ${^:%=%.log} >gen/config.log ${VCAT} $@ @printf '%s' "$$CONFFLAGS" | build/embed.sh >gen/confflags.i @printf '%s' "$$XCC" | build/embed.sh >gen/cc.i diff --git a/build/pkgs.mk b/build/pkgs.mk index 5de9ac2..f692739 100644 --- a/build/pkgs.mk +++ b/build/pkgs.mk @@ -19,7 +19,7 @@ gen/pkgs.mk: ${HEADERS} printf '_LDFLAGS += %s\n' "$$(build/pkgconf.sh --ldflags "$$@")"; \ printf '_LDLIBS := %s $${_LDLIBS}\n' "$$(build/pkgconf.sh --ldlibs "$$@")"; \ }; \ - gen $$(grep -l ' true$$' ${.ALLSRC} | sed 's|.*/\(.*\)\.h|\1|') >>$@ + gen $$(grep -l ' true$$' $^ | sed 's|.*/\(.*\)\.h|\1|') >>$@ ${VCAT} $@ .PHONY: gen/pkgs.mk diff --git a/build/prelude.mk b/build/prelude.mk index c25dea4..6250d73 100644 --- a/build/prelude.mk +++ b/build/prelude.mk @@ -9,11 +9,9 @@ # We don't use any suffix rules .SUFFIXES: -# GNU make has $^ for the full list of targets, while BSD make has $> and the -# long-form ${.ALLSRC}. We could write $^ $> to get them both, but that would -# break if one of them implemented support for the other. So instead, bring -# BSD's ${.ALLSRC} to GNU. -.ALLSRC ?= $^ +# GNU make has $^ for the full list of targets, while BSD make has $> (and the +# long-form ${.ALLSRC}). We use the GNU version, bringing it to BSD like this: +^ ?= $> # Installation paths DESTDIR ?= |