Skip to content

Commit

Permalink
generate .gitrevision file if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Apr 15, 2014
1 parent 8ad936f commit eb06db1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -393,7 +393,7 @@ dbg: $(NAME)

dist: tar

tar:
tar: $(NEWREVISION)
$(TAR) -C .. \
--exclude=$(notdir $(CURDIR))/tmp* \
--exclude=$(notdir $(CURDIR))/debian* \
Expand Down
33 changes: 16 additions & 17 deletions Makefile.defs
Expand Up @@ -301,29 +301,20 @@ ifneq ($(VERSIONTYPE),)
GETVERSIONOPTS = rev-parse --short HEAD
endif
endif

ifeq ($(OLDREVISION),)
OLDREVISION = $(shell if [ -f ".$(VERSIONTYPE)revision" ] ; then \
cat .$(VERSIONTYPE)revision ;\
fi )
cat .$(VERSIONTYPE)revision ;\
fi )
endif

ifeq ($(THISREVISION),)
THISREVISION = $(shell if [ -f main.c -a -f Makefile.defs ] ; then \
if [ -x "$(GETVERSION)" ] ; then \
$(GETVERSION) $(GETVERSIONOPTS) ;\
fi ;\
fi )
endif

ifneq ($(THISREVISION),)
NEWREVISION = $(shell if [ "$(THISREVISION)" != "$(OLDREVISION)" ] ; then \
echo "dosetrev" ; \
fi )
else
THISREVISION = unknown
if [ -x "$(GETVERSION)" ] ; then \
$(GETVERSION) $(GETVERSIONOPTS) ;\
fi ;\
fi )
endif

else
# git is the default versioning method
VERSIONTYPE = $(shell [ -f ".gitrevision" ] && echo "git")
Expand All @@ -332,6 +323,14 @@ else
endif
endif

ifneq ($(THISREVISION),)
NEWREVISION = $(shell if [ "$(THISREVISION)" != "$(OLDREVISION)" ] ; then \
echo "dosetrev" ; \
fi )
else
THISREVISION = unknown
endif


ifeq ($(DBXML2HTML),)
DBXML2HTML = $(shell which xsltproc)
Expand Down

0 comments on commit eb06db1

Please sign in to comment.