Skip to content

Commit

Permalink
build: Fix building clboss as a git submodule
Browse files Browse the repository at this point in the history
When clboss is a git submodule, the current Makefile fails because
it assumes that because the `$(srcdir)/.git/logs/HEAD` file does
not exist, that we must be inside the release zip and therefore
already have the commit_hash.h file present.

Here we update the Makefile to detect the case where clboss is
a git submodule (by detecting that `.git` is a regular file and
not a directory), and run generate_commit_hash.sh in that case.
  • Loading branch information
chrisguida committed Oct 24, 2024
1 parent 88ba9f2 commit a5c1f04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ create-tarball: create-tarball.in Makefile
BUILT_SOURCES = commit_hash.h

commit_hash.h: FORCE
@if test -e $(srcdir)/.git/logs/HEAD; then \
@if test -e $(srcdir)/.git/logs/HEAD || test -f $(srcdir)/.git; then \
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; \
Expand Down

0 comments on commit a5c1f04

Please sign in to comment.