diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-05-29 13:19:20 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-06-08 12:36:30 -0400 |
commit | 34e133bd0e2d5bb4eed5d5091d14d9e6fce1ff2b (patch) | |
tree | 2abf64518759de4a84d4ac08e218021e9643d3f8 /Makefile | |
parent | 778295321928767552ebc577f15e88c17da4c1c9 (diff) | |
download | bfs-34e133bd0e2d5bb4eed5d5091d14d9e6fce1ff2b.tar.xz |
Embed more configuration info in bfs --version
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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`) |