diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-14 13:01:55 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-14 13:01:55 +0000 |
commit | 926c8ad88a5cce707fe1025f3551aa1c03318b32 (patch) | |
tree | 9d0c7d3102578adca5ab7381e3b1296f218270f8 /crawl-ref/source/makefile.unix | |
parent | 72560e17acd9fd40a9dcc969c14f3b1fd60fe96c (diff) | |
download | crawl-ref-926c8ad88a5cce707fe1025f3551aa1c03318b32.tar.gz crawl-ref-926c8ad88a5cce707fe1025f3551aa1c03318b32.zip |
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
Diffstat (limited to 'crawl-ref/source/makefile.unix')
-rw-r--r-- | crawl-ref/source/makefile.unix | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/crawl-ref/source/makefile.unix b/crawl-ref/source/makefile.unix index e1516fb05e..709421c090 100644 --- a/crawl-ref/source/makefile.unix +++ b/crawl-ref/source/makefile.unix @@ -41,9 +41,16 @@ INSTALLDIR := /usr/games # SAVEDIR := /usr/games/crawl-saves/ # DATADIR := /usr/games/crawl-data/ -LIB = -lncurses +ifeq ($(LUASRC),) +LUASRC := util/lua/src +endif + +LUALIB = lua +LUALIBA = l$(LUALIB).a -INCLUDES := $(INCLUDES) -Iutil -I. +LIB = -lncurses -L$(LUASRC) -l$(LUALIB) + +INCLUDES := $(INCLUDES) -Iutil -I. -I$(LUASRC) CFWARN := -Wall -Wwrite-strings \ -Wshadow -pedantic @@ -173,7 +180,10 @@ clean: $(DELETE) $(UTIL)*.tab.cc $(UTIL)*.tab.c $(UTIL)*.tab.h $(UTIL)*.lex.cc $(DELETE) *.ixx -distclean: clean +clean-lua: + cd $(LUASRC) && $(MAKE) clean + +distclean: clean clean-lua $(DELETE) bones.* $(DELETE) morgue.txt $(DELETE) scores @@ -184,7 +194,7 @@ distclean: clean $(DELETE) *.lab $(DELETE) $(DEPENDENCY_MKF) -$(GAME): $(GAME_DEPENDS) +$(GAME): $(LUASRC)$(LUALIBA) $(GAME_DEPENDS) ${CXX} ${LDFLAGS} $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB) debug: $(GAME_DEPENDS) @@ -203,12 +213,20 @@ $(UTIL)%.o: $(UTIL)%.cc $(CXX) $(YCFLAGS) -o $@ -c $< ############################################################################# +# Build Lua + +$(LUASRC)$(LUALIBA): + echo Building Lua... + cd $(LUASRC) && $(MAKE) crawl_unix + +############################################################################# # Packaging a source tarball for release # # To package, you *must* have lex and yacc to generate the intermediates. ifeq ($(DOYACC),y) -package-source: distclean prebuildyacc pkgtidy depend removeold vlink pkgtarbz2 pkgzip +package-source: distclean prebuildyacc pkgtidy depend removeold vlink \ + pkgtarbz2 pkgzip pkgtidy: $(DELETE) $(PKG_TIDY_LIST) @@ -230,4 +248,4 @@ pkgzip: cd ../.. && zip -rq $(SRC_PKG_ZIP) $(PKG_SRC_DIR) \ -x@$(PKG_EXCLUDES) -endif +endif
\ No newline at end of file |