diff --git a/.gitignore b/.gitignore index 917b01bc9c..af2a670aeb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ version.ent blfs-bootscripts* xxx *.swp +build-env diff --git a/Makefile b/Makefile index fca84c630f..5841d1f58f 100644 --- a/Makefile +++ b/Makefile @@ -34,12 +34,6 @@ ifneq ($(REV), sysv) endif endif -# Let's get the previous REV: it'll be used to see if we should -# rebuild version.ent -PREVREV != if [ -f conditional.ent ]; then \ - gawk '/INCLUDE/{ print $$3 }' conditional.ent; \ - fi - ifeq ($(REV), sysv) BASEDIR ?= $(HOME)/public_html/blfs-book NOCHUNKS_OUTPUT ?= blfs-book.html @@ -279,12 +273,7 @@ $(DUMPDIR): $(RENDERTMP)/$(BLFSFULL) validate profile-html blfs-patch-list wget-list \ test-links dump-commands bootscripts systemd-units -# make version.ent unconditionally if we have changed REV -ifneq ($(REV), $(PREVREV)) - .PHONY: version.ent -endif - -version.ent: general.ent packages.ent gnome.ent $(ALLXML) $(ALLXSL) +version.ent: general.ent packages.ent gnome.ent $(ALLXML) $(ALLXSL) build-env $(Q)./git-version.sh $(REV) #ALL_PYTHON_DEPS := $(filter-out $(PYHOSTED), \ @@ -309,3 +298,12 @@ version.ent: general.ent packages.ent gnome.ent $(ALLXML) $(ALLXSL) # stylesheets/pythonhosted.xsl \ # general/prog/python-modules.xml # $(Q)mv temp.xml $@ + +.PHONY: update-build-env +update-build-env: + $(Q)echo REV=$(REV) > $@.new + $(Q)echo BASEDIR=$(BASEDIR) >> $@.new + $(Q)diff $@.new $@ 2>/dev/null >/dev/null || mv $@.new $@ + $(Q)rm -f $@.new + +build-env: update-build-env