From 34e133bd0e2d5bb4eed5d5091d14d9e6fce1ff2b Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 29 May 2024 13:19:20 -0400 Subject: Embed more configuration info in bfs --version --- Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e256ac7..2679c85 100644 --- a/Makefile +++ b/Makefile @@ -66,22 +66,20 @@ ${OBJS}: gen/config.mk ${MSG} "[ CC ] ${CSRC}" ${CC} ${_CPPFLAGS} ${_CFLAGS} -c ${CSRC} -o $@ # Save the version number to this file, but only update version.c if it changes -gen/version.c.new:: +gen/version.i.new:: @${MKDIR} ${@D} - @printf 'const char bfs_version[] = "' >$@ @if [ "$$VERSION" ]; then \ printf '%s' "$$VERSION"; \ elif test -e src/../.git && command -v git >/dev/null 2>&1; then \ git -C src/.. describe --always --dirty; \ else \ echo "3.3.1"; \ - fi | tr -d '\n' >>$@ - @printf '";\n' >>$@ + fi | tr -d '\n' | build/embed.sh >$@ -gen/version.c: gen/version.c.new - @test -e $@ && cmp -s $@ ${.ALLSRC} && rm ${.ALLSRC} || mv ${.ALLSRC} $@ +gen/version.i: gen/version.i.new + @test -e $@ && cmp -s $@ ${.ALLSRC} && ${RM} ${.ALLSRC} || mv ${.ALLSRC} $@ -obj/gen/version.o: gen/version.c +obj/src/version.o: gen/version.i ## Test phase (`make check`) -- cgit v1.2.3