diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-11-06 16:38:43 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-11-06 16:38:43 +0000 |
commit | a09b382df5689377f1bf5d5d359dca4c9e1aa240 (patch) | |
tree | d0ab78185855623bd0b8b47c6cf1fb013c193bfe | |
parent | 5c4a140a2673daa366696d03de0eefd7c69e8d1f (diff) | |
download | crawl-ref-a09b382df5689377f1bf5d5d359dca4c9e1aa240.tar.gz crawl-ref-a09b382df5689377f1bf5d5d359dca4c9e1aa240.zip |
More makefile rearrangement; pre-generated parser goes into source/prebuilt.
Updated Linux/Windows makefiles to use prebuilt/foo if DOYACC=n.
Anyone updating levcomp.l / levcomp.y or the .des files must run make prebuild
and check in the prebuilt files so that folks compiling stone_soup svn are not
greatly inconvenienced.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@345 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/makefile | 3 | ||||
-rw-r--r-- | crawl-ref/source/makefile.lnx | 32 | ||||
-rw-r--r-- | crawl-ref/source/makefile.mgw | 26 | ||||
-rw-r--r-- | crawl-ref/source/prebuilt/levcomp.h (renamed from crawl-ref/source/util/levcomp.h) | 0 | ||||
-rw-r--r-- | crawl-ref/source/prebuilt/levcomp_lex.cc (renamed from crawl-ref/source/util/levcomp_lex.cc) | 0 | ||||
-rw-r--r-- | crawl-ref/source/prebuilt/levcomp_yacc.cc (renamed from crawl-ref/source/util/levcomp_yacc.cc) | 0 | ||||
-rw-r--r-- | crawl-ref/source/prebuilt/mapdefs.ixx (renamed from crawl-ref/source/mapdefs.ixx) | 0 |
7 files changed, 46 insertions, 15 deletions
diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile index a4ebcf8870..f61f141f1b 100644 --- a/crawl-ref/source/makefile +++ b/crawl-ref/source/makefile @@ -44,6 +44,9 @@ debug: package-source: $(MAKE) -f $(MAKEFILE) package-source +prebuildyacc: + $(MAKE) -f $(MAKEFILE) prebuildyacc + # DO NOT DELETE THIS LINE -- $(MAKE) depend depends on it. diff --git a/crawl-ref/source/makefile.lnx b/crawl-ref/source/makefile.lnx index 383d4232c9..0ad19bb49b 100644 --- a/crawl-ref/source/makefile.lnx +++ b/crawl-ref/source/makefile.lnx @@ -61,7 +61,7 @@ SRC_PKG_ZIP := $(PKG_SRC_DIR).zip LEVCOMP := $(UTIL)levcomp -PKG_TIDY_LIST := $(UTIL)*.o $(LEVCOMP) *.o +PKG_TIDY_LIST := $(UTIL)*.o $(LEVCOMP) *.o $(LEVCOMP)*.cc $(LEVCOMP)*.h *.ixx PKG_EXCLUDES := $(PWD)/misc/src-pkg-excludes.lst ########################################################################## @@ -82,16 +82,33 @@ $(LEVCOMP): $(UTIL)levcomp_yacc.o $(UTIL)levcomp_lex.o mapdef.o ifeq ($(DOYACC),y) +prebuildyacc: mapdefs.ixx $(UTIL)levcomp_yacc.cc $(UTIL)levcomp_lex.cc \ + $(UTIL)levcomp.h + cp $^ prebuilt/ + $(UTIL)levcomp_yacc.cc: $(UTIL)levcomp.y cd $(UTIL) && $(YACC) -d levcomp.y \ - && mv $(YTABC) levcomp_yacc.cc \ - && mv $(YTABH) levcomp.h + && mv $(YTABH) levcomp.h \ + && mv $(YTABC) levcomp_yacc.cc $(UTIL)levcomp_lex.cc: $(UTIL)levcomp.l cd $(UTIL) && $(LEX) levcomp.l \ && mv $(LEXYYC) levcomp_lex.cc +else + +# Pull the level-compiler stuff up from prebuilt/ + +$(UTIL)levcomp_yacc.cc: prebuilt/levcomp_yacc.cc + cp prebuilt/*.h . + cp $< $@ + + +$(UTIL)levcomp_lex.cc: prebuilt/levcomp_lex.cc + cp $< $@ + endif + ########################################################################## @@ -107,6 +124,8 @@ clean: $(DELETE) *.o $(DELETE) $(UTIL)*.o $(DELETE) $(LEVCOMP) + $(DELETE) $(UTIL)*.cc $(UTIL)*.c $(UTIL)*.h + $(DELETE) *.ixx distclean: $(DELETE) *.o @@ -118,11 +137,6 @@ distclean: $(DELETE) core $(DELETE) *.0* $(DELETE) *.lab -ifeq ($(DOYACC),y) - $(DELETE) $(UTIL)*.cc $(UTIL)*.c $(UTIL)*.h - $(DELETE) *.ixx -endif - $(GAME): $(GAME_DEPENDS) ${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB) @@ -155,7 +169,7 @@ $(UTIL)%.o: $(UTIL)%.cc # To package, you *must* have lex and yacc to generate the intermediates. ifeq ($(DOYACC),y) -package-source: distclean mapdefs.ixx pkgtidy removeold vlink pkgtarbz2 pkgzip +package-source: distclean prebuildyacc pkgtidy removeold vlink pkgtarbz2 pkgzip pkgtidy: $(DELETE) $(PKG_TIDY_LIST) diff --git a/crawl-ref/source/makefile.mgw b/crawl-ref/source/makefile.mgw index 8075742122..f85ade2814 100644 --- a/crawl-ref/source/makefile.mgw +++ b/crawl-ref/source/makefile.mgw @@ -77,16 +77,31 @@ $(UTIL)levcomp.exe: $(UTIL)levcomp_yacc.o $(UTIL)levcomp_lex.o $(OPATH)/mapdef.o ifeq ($(DOYACC),y) +# [ds] A plague on the broken copy command on Windoze. +prebuildyacc: mapdefs.ixx $(UTIL)levcomp_lex.cc $(UTIL)levcomp_yacc.cc \ + $(UTIL)levcomp.h + $(subst /,\,for %%f in ($^) do $(COPY) %%f prebuilt) + $(UTIL)levcomp_yacc.cc: $(UTIL)levcomp.y $(subst /,\, cd $(UTIL)) && $(YACC) -d levcomp.y - $(subst /,\, cd $(UTIL)) && move $(YTABC) levcomp_yacc.cc $(subst /,\, cd $(UTIL)) && move $(YTABH) levcomp.h + $(subst /,\, cd $(UTIL)) && move $(YTABC) levcomp_yacc.cc $(UTIL)levcomp_lex.cc: $(UTIL)levcomp.l $(subst /,\, cd $(UTIL) && $(LEX) levcomp.l) $(subst /,\, cd $(UTIL) && move $(LEXYYC) levcomp_lex.cc) +else + +$(UTIL)levcomp_yacc.cc: prebuilt/levcomp_yacc.cc + $(subst /,\,$(COPY) prebuilt/*.h .) + $(subst /,\,$(COPY) $< $@) + +$(UTIL)levcomp_lex.cc: prebuilt/levcomp_lex.cc + $(subst /,\,$(COPY) $< $@) + endif + ########################################################################## install: $(APPNAME) @@ -96,6 +111,10 @@ clean: $(DELETE) $(OPATH)\*.o $(subst /,\,$(DELETE) $(UTIL)*.o) $(subst /,\,$(DELETE) $(UTIL)*.exe) + $(subst /,\,$(DELETE) $(UTIL)*.cc) + $(subst /,\,$(DELETE) $(UTIL)*.h) + $(subst /,\,$(DELETE) $(UTIL)*.c) + $(subst /,\,$(DELETE) *.ixx) distclean: $(DELETE) $(OPATH)\*.o @@ -116,11 +135,6 @@ distclean: $(DELETE) $(OPATH)\*.0* $(DELETE) *.lab $(DELETE) $(OPATH)\*.lab -ifeq ($(DOYACC),y) - $(subst /,\,$(DELETE) $(UTIL)*.cc) - $(subst /,\,$(DELETE) $(UTIL)*.h) - $(subst /,\,$(DELETE) $(UTIL)*.c) -endif $(APPNAME): $(GAME_DEPENDS) ${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(APPNAME) $(LIB) diff --git a/crawl-ref/source/util/levcomp.h b/crawl-ref/source/prebuilt/levcomp.h index ae44292ce6..ae44292ce6 100644 --- a/crawl-ref/source/util/levcomp.h +++ b/crawl-ref/source/prebuilt/levcomp.h diff --git a/crawl-ref/source/util/levcomp_lex.cc b/crawl-ref/source/prebuilt/levcomp_lex.cc index 61c26aef8c..61c26aef8c 100644 --- a/crawl-ref/source/util/levcomp_lex.cc +++ b/crawl-ref/source/prebuilt/levcomp_lex.cc diff --git a/crawl-ref/source/util/levcomp_yacc.cc b/crawl-ref/source/prebuilt/levcomp_yacc.cc index 1ec6b01be2..1ec6b01be2 100644 --- a/crawl-ref/source/util/levcomp_yacc.cc +++ b/crawl-ref/source/prebuilt/levcomp_yacc.cc diff --git a/crawl-ref/source/mapdefs.ixx b/crawl-ref/source/prebuilt/mapdefs.ixx index 9e2d3956e2..9e2d3956e2 100644 --- a/crawl-ref/source/mapdefs.ixx +++ b/crawl-ref/source/prebuilt/mapdefs.ixx |