Skip to content

Commit

Permalink
Fix GNUism in Makefile.am handling of NODISTHOOK
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Nov 4, 2011
1 parent 9847f68 commit 617b2b9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Makefile.am
Expand Up @@ -37,20 +37,21 @@ version.c: $(filter-out version.c, $(libopenconnect_la_SOURCES)) \
@$(srcdir)/version.sh

tmp-dist: uncommitted-check
$(MAKE) $(AM_MAKEFLAGS) VERSION=$(patsubst v%,%,$(shell git describe --tags)) NODISTHOOK=1 dist
$(MAKE) $(AM_MAKEFLAGS) VERSION=$(patsubst v%,%,$(shell git describe --tags)) DISTHOOK=0 dist

uncommitted-check:
@if ! git update-index --refresh --unmerged || \
! git diff-index --name-only --exit-code HEAD; then \
echo "*** ERROR: Uncommitted changes in above files"; exit 1; fi

DISTHOOK=1
dist-hook: uncommitted-check
ifndef NODISTHOOK
@if ! git rev-parse --verify v$(VERSION) &> /dev/null; then \
echo "*** ERROR: Version v$(VERSION) is not tagged"; exit 1; fi
@if ! git diff --name-only --exit-code v$(VERSION) HEAD > /dev/null; then \
echo "*** ERROR: Git checkout not at version v$(VERSION)"; exit 1; fi
endif
@if [ $(DISTHOOK) = 1 ]; then \
if ! git rev-parse --verify v$(VERSION) &> /dev/null; then \
echo "*** ERROR: Version v$(VERSION) is not tagged"; exit 1; fi ; \
if ! git diff --name-only --exit-code v$(VERSION) HEAD > /dev/null; then \
echo "*** ERROR: Git checkout not at version v$(VERSION)"; exit 1; fi ; \
fi

tag: uncommitted-check
@if git rev-parse --verify v$(VERSION) &> /dev/null; then \
Expand Down

0 comments on commit 617b2b9

Please sign in to comment.