Skip to content

Commit

Permalink
Auto-add COMMIT if building from git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
adsr committed Apr 16, 2024
1 parent b827afd commit 5a1904f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ php_path?=php
sinclude config.mk

has_phpconf := $(shell command -v php-config >/dev/null 2>&1 && echo :)
git_sha := $(shell test -d .git && command -v git >/dev/null && git rev-parse --short HEAD)

ifdef USE_ZEND
$(or $(has_phpconf), $(error Need php-config))
Expand All @@ -24,6 +25,8 @@ endif

ifdef COMMIT
phpspy_defines:=$(phpspy_defines) -DCOMMIT=$(COMMIT)
else ifneq ($(git_sha),)
phpspy_defines:=$(phpspy_defines) -DCOMMIT=$(git_sha)
endif

all: phpspy
Expand Down

0 comments on commit 5a1904f

Please sign in to comment.