summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-05-29 13:19:20 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-06-08 12:36:30 -0400
commit34e133bd0e2d5bb4eed5d5091d14d9e6fce1ff2b (patch)
tree2abf64518759de4a84d4ac08e218021e9643d3f8 /Makefile
parent778295321928767552ebc577f15e88c17da4c1c9 (diff)
downloadbfs-34e133bd0e2d5bb4eed5d5091d14d9e6fce1ff2b.tar.xz
Embed more configuration info in bfs --version
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 5 insertions, 7 deletions
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`)