Skip to content

Commit

Permalink
Improve commit_hash.h dependencies and generation
Browse files Browse the repository at this point in the history
The previous setup was not regenerating commit_hash.h correctly when
the dev tree was modified by git operations.
  • Loading branch information
ksedgwic committed Aug 22, 2024
1 parent 103201e commit 35c3cbe
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,21 @@ create-tarball: create-tarball.in Makefile
chmod +x create-tarball

BUILT_SOURCES = commit_hash.h
CLEANFILES += commit_hash.h

commit_hash.h:
./generate_commit_hash.sh
commit_hash.h: FORCE
@if test -e $(srcdir)/.git/logs/HEAD; then \
if [ ! -f $@ ] || [ $(srcdir)/.git/logs/HEAD -nt $@ ]; then \
echo "Regenerating commit_hash.h..."; \
$(SHELL) $(srcdir)/generate_commit_hash.sh; \
else \
echo "commit_hash.h is up-to-date."; \
fi \
else \
echo "Using existing commit_hash.h"; \
fi

FORCE:

.PHONY: FORCE

clboss libclboss.la: $(BUILT_SOURCES)

0 comments on commit 35c3cbe

Please sign in to comment.