From 926c8ad88a5cce707fe1025f3551aa1c03318b32 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 14 Apr 2007 13:01:55 +0000 Subject: Included Lua 5.1.2 source tree in crawl-ref/source/util. This is so we can use Lua in core Crawl code without making Crawl harder to build (than it is already). Crawl's makefiles will call the Lua makefile if necessary (i.e., if liblua.a doesn't already exist). CLUA_BINDINGS is still not enabled by default (and will not be enabled by default in the source tree). Crawl will use two different Lua interpreter instances - one for user scripts (if CLUA_BINDINGS is defined), the other (not #ifdef conditionalised) for core game Lua glue. Lua is statically linked by default. We could change this if necessary, although the added size is only 200k. The Lua sources are almost unmodified; I've only added new targets for Crawl's platform-specific makefiles to call into to build liblua.a; I've not modified any existing targets, and all Lua READMEs and copyright notices are intact. Needs integration with Xcode build. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1305 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/makefile.mgw | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) (limited to 'crawl-ref/source/makefile.mgw') diff --git a/crawl-ref/source/makefile.mgw b/crawl-ref/source/makefile.mgw index f1bc19f861..3e590089e8 100644 --- a/crawl-ref/source/makefile.mgw +++ b/crawl-ref/source/makefile.mgw @@ -18,14 +18,26 @@ OS_TYPE = WIN32CONSOLE INSTALLDIR := $(OPATH) -LIB = -lwinmm -static +# If you don't have flex or bison, set DOYACC to N or empty. +DOYACC := n + +LEX := flex +YACC := bison -y + +ifeq ($(LUASRC),) +LUASRC := util\lua\src\\ +endif + +LUALIB = lua +LUALIBA = lib$(LUALIB).a + +LIB = -static -lwinmm -L$(LUASRC) -l$(LUALIB) +INCLUDES := -Iutil -I. -I$(LUASRC) CFWARN := -Wall -Wwrite-strings \ -Wshadow \ -Werror \ - -pedantic - -INCLUDES := -Iutil -I. + -pedantic CFOTHERS := -fsigned-char \ -fstrict-aliasing \ @@ -44,12 +56,6 @@ LDFLAGS = UTIL = util/ -# If you don't have flex or bison, set DOYACC to N or empty. -DOYACC := n - -LEX := flex -YACC := bison -y - YTABC := levcomp.tab.c YTABH := levcomp.tab.h @@ -68,7 +74,7 @@ OBJECTS := levcomp.tab.o levcomp.lex.o levcomp.o \ OBJECTS := $(foreach file,$(OBJECTS),$(OPATH)/$(file)) -GAME_DEPENDS := prepare $(OBJECTS) +GAME_DEPENDS := prepare $(LUASRC)$(LUALIBA) $(OBJECTS) ########################################################################## @@ -127,7 +133,10 @@ clean: $(subst /,\,$(DELETE) $(UTIL)*.tab.c) $(subst /,\,$(DELETE) *.ixx) -distclean: clean +clean-lua: + cd $(LUASRC) && $(MAKE) clean_win + +distclean: clean clean-lua $(DELETE) $(OPATH)\*.o $(DELETE) *.o $(DELETE) bones.* @@ -162,3 +171,10 @@ $(OPATH)/%.o: %.cc $(OPATH)/%.o: $(UTIL)%.cc $(CXX) $(YCFLAGS) -o $@ -c $< + +############################################################################# +# Build Lua + +$(LUASRC)$(LUALIBA): + @echo Building Lua... + @cd $(LUASRC) && $(MAKE) crawl_mingw -- cgit v1.2.3-54-g00ecf