Fix makefile not rebuilding rbversion.h in some cases

For example when running make VERSION="bla"

Change-Id: I8f8833f0fb200828346ed0a6842a9340e3653932
This commit is contained in:
Amaury Pouly 2016-09-23 21:51:28 +01:00 committed by Gerrit Rockbox
parent 92450a9924
commit 50c1de7092
2 changed files with 8 additions and 4 deletions

View file

@ -46,7 +46,10 @@ $(BUILDDIR)/sysfont.o: $(SYSFONT) $(BUILDDIR)/sysfont.h
$(call PRINTS,CONVBDF $(subst $(ROOTDIR)/,,$<))$(TOOLSDIR)/convbdf -l $(MAXCHAR) -c -o $(BUILDDIR)/sysfont.c $<
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$(BUILDDIR)/sysfont.c))$(CC) $(CFLAGS) -c $(BUILDDIR)/sysfont.c -o $@
SVNVERSION:=$(shell $(TOOLSDIR)/version.sh $(ROOTDIR))
# GNU make (at least) has a bug/feature that exported variable are not available
# in the shell function (but are in recipe). Thus we need to explicitely pass
# the VERSION environement variable
SVNVERSION:=$(shell VERSION='$(VERSION)' $(TOOLSDIR)/version.sh $(ROOTDIR))
OLDSVNVERSION:=$(shell grep 'RBVERSION' $(BUILDDIR)/rbversion.h 2>/dev/null|cut -d '"' -f 2 || echo "NOREVISION")
ifneq ($(SVNVERSION),$(OLDSVNVERSION))
@ -54,4 +57,4 @@ ifneq ($(SVNVERSION),$(OLDSVNVERSION))
endif
$(BUILDDIR)/rbversion.h:
$(call PRINTS,GEN $(@F))$(TOOLSDIR)/genversion.sh $(BUILDDIR) $(TOOLSDIR)/version.sh $(ROOTDIR)
$(call PRINTS,GEN $(@F))$(TOOLSDIR)/genversion.sh $(BUILDDIR) $(SVNVERSION)