diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-09-29 19:54:02 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-09-30 17:23:30 -0700 |
commit | 9f438b1bccca459e484560232e5b6e7dfdbacd61 (patch) | |
tree | b8984d62a6efc36754477d3e4b16ff9fc2eef827 /real.make | |
parent | 7f2a6be58f6c100a8784e5cbca884108160c0f48 (diff) | |
download | tmwa-9f438b1bccca459e484560232e5b6e7dfdbacd61.tar.gz tmwa-9f438b1bccca459e484560232e5b6e7dfdbacd61.tar.bz2 tmwa-9f438b1bccca459e484560232e5b6e7dfdbacd61.tar.xz tmwa-9f438b1bccca459e484560232e5b6e7dfdbacd61.zip |
Automatically generate version information
Diffstat (limited to 'real.make')
-rw-r--r-- | real.make | 28 |
1 files changed, 24 insertions, 4 deletions
@@ -223,7 +223,7 @@ s: ${ASSEMBLED} o: ${OBJECTS} mostlyclean: - rm -rf obj + rm -rf obj conf-raw clean: mostlyclean rm -rf bin distclean: clean @@ -235,12 +235,10 @@ distclean: clean %.cpp %.hpp: %.ypp $(MKDIR_FIRST) ${BISON} -d -o $*.cpp $< -%.hpp: ; -# hpp rule is needed for disappearing headers obj/%.d: src/%.cpp $(MKDIR_FIRST) set -o pipefail; \ - ${CXX} ${CPPFLAGS} ${CXXFLAGS} -MM $< \ + ${CXX} ${CPPFLAGS} ${CXXFLAGS} -MG -MP -MM $< \ -MT '$@ $(patsubst %.d,%.o,$@)' \ | sed -e ':again; s:/[^/ ]*/../:/:; t again' \ -e 's: ${SRC_DIR}/: :g' \ @@ -310,3 +308,25 @@ tags: ${SOURCES} ${HEADERS} Makefile: ${SRC_DIR}/Makefile.in @echo Makefile.in updated, you must rerun configure @false + +include ${SRC_DIR}/version.make + +# TODO - fix pattern priority bug so I can make these .hpp +# +# This is complicated and still isn't optimal. +conf-raw/int-%.h: FORCE + $(MKDIR_FIRST) + @grep -s -q '^$(value $*)$$' $@ \ + || { \ + echo "#define $* \\"; \ + echo '$(value $*)'; \ + } > $@ +conf-raw/str-%.h: FORCE + $(MKDIR_FIRST) + @grep -s -q '^"$(value $*)"$$' $@ \ + || { \ + echo "#define $* \\"; \ + echo '"$(value $*)"'; \ + } > $@ +FORCE: ; +override CPPFLAGS += -I . |