Commit 6a53fffd authored by Måns Rullgård's avatar Måns Rullgård

Improve version.h generation

Force to run whenever the version might have changed,
regardless of what is being built.  This is done by attaching the
dependencies to a dummy file (.version) which is included from the
makefile.  As make will always attempt to rebuild any included files
before considering other rules, this ensures that the real version.h
is (re-)created before it is required by any source file.

Originally committed as revision 22420 to svn://
parent 93bff1de
......@@ -85,7 +85,18 @@ tools/%.o: tools/%.c
ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
cmdutils.o cmdutils.d: version.h
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
.version: $(wildcard $(SVN_ENTRIES)) $(VERSION_SH) config.mak
.version: M=@
version.h .version:
$(Q)touch .version
# force to run whenever version might have changed
-include .version
alltools: $(TOOLS)
......@@ -54,14 +54,6 @@ CFLAGS += $(ECFLAGS)
%.c %.h: MSG = GEN
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
$(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/ config.mak
install: install-libs install-headers
install-libs: install-libs-yes
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment