Skip to content

Commit

Permalink
ensure that commit_hash.h is included in the source tarball
Browse files Browse the repository at this point in the history
  • Loading branch information
ksedgwic committed Oct 2, 2024
1 parent f014af3 commit afaed81
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -680,16 +680,21 @@ BUILT_SOURCES = commit_hash.h

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..."; \
if [ ! -f $(srcdir)/commit_hash.h ] || [ $(srcdir)/.git/logs/HEAD -nt $(srcdir)/commit_hash.h ]; then \
echo "Regenerating $(srcdir)/commit_hash.h..."; \
$(SHELL) $(srcdir)/generate_commit_hash.sh; \
else \
echo "commit_hash.h is up-to-date."; \
echo "$(srcdir)/commit_hash.h is up-to-date."; \
fi \
else \
echo "Using existing commit_hash.h"; \
echo "Using existing $(srcdir)/commit_hash.h"; \
fi

# Ensure that commit_hash.h is included in the source tarball.
dist-hook:
test -f $(srcdir)/commit_hash.h || $(MAKE) commit_hash.h
test -f $(distdir)/commit_hash.h || cp $(srcdir)/commit_hash.h $(distdir)/

FORCE:

.PHONY: FORCE
Expand Down

0 comments on commit afaed81

Please sign in to comment.