From 39fb1eb12b87c4caae2ac8953c60b2d2a7f93262 Mon Sep 17 00:00:00 2001 From: nlanza Date: Tue, 7 Nov 2006 05:36:55 +0000 Subject: makefile.lnx -> makefile.unix git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@351 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/makefile | 2 +- crawl-ref/source/makefile.lnx | 190 ----------------------------------------- crawl-ref/source/makefile.unix | 190 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 191 insertions(+), 191 deletions(-) delete mode 100644 crawl-ref/source/makefile.lnx create mode 100644 crawl-ref/source/makefile.unix diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile index a887eec812..b4de52a08c 100644 --- a/crawl-ref/source/makefile +++ b/crawl-ref/source/makefile @@ -4,7 +4,7 @@ #Makefile chooser. Choose one: -MAKEFILE = makefile.lnx +MAKEFILE = makefile.unix #MAKEFILE = makefile.dos #MAKEFILE = makefile.osx #MAKEFILE = makefile.mgw diff --git a/crawl-ref/source/makefile.lnx b/crawl-ref/source/makefile.lnx deleted file mode 100644 index 75abff9d5b..0000000000 --- a/crawl-ref/source/makefile.lnx +++ /dev/null @@ -1,190 +0,0 @@ -# -*- Makefile -*- for Dungeon Crawl (linux) - -# -# Modified for Crawl Reference by $Author$ on $Date$ -# - -GAME = crawl - -# this file contains a list of the libraries. -# it will make a variable called OBJECTS that contains all the libraries -include makefile.obj - -OBJECTS += libunix.o - -CXX = g++ -DELETE = rm -f -COPY = cp -OS_TYPE = UNIX - -CFLAGS = -Wall -Wwrite-strings -fsigned-char \ - -Wshadow -pedantic \ - -g -D$(OS_TYPE) $(EXTRA_FLAGS) - -MCHMOD = 2755 - -# [dshaligram] More common location than /opt/crawl/bin - this is from the -# Debian patch. -INSTALLDIR = /usr/games -LIB = -lncurses - -# Include for Linux -INCLUDES = -I/usr/include/ncurses - -# If you have lex and yacc, set DOYACC to y (lowercase y). -DOYACC := y - -UTIL = util/ - -LEX := lex -YACC := bison -y - -YTABC := levcomp.tab.c -YTABH := levcomp.tab.h - -ifeq ($(LEX),) -DOYACC := -endif - -ifeq ($(YACC),) -DOYACC := -endif - -GAME_DEPENDS := compile-levels $(OBJECTS) -SRC_PKG_BASE := stone_soup -SRC_VERSION := $(shell egrep 'VERSION ".*"' version.h | \ - egrep -o '[0-9]\.[0-9](\.[0-9])?') -PKG_SRC_DIR := $(SRC_PKG_BASE)-$(SRC_VERSION)-src -SRC_PKG_TAR := $(PKG_SRC_DIR).tbz2 -SRC_PKG_ZIP := $(PKG_SRC_DIR).zip - -LEVCOMP := $(UTIL)levcomp - -PKG_TIDY_LIST := $(UTIL)*.o $(LEVCOMP) *.o $(LEVCOMP)*.cc $(LEVCOMP)*.h *.ixx -PKG_EXCLUDES := $(PWD)/misc/src-pkg-excludes.lst - -########################################################################## - -all: $(GAME) - -########################################################################## -# The level compiler -# -compile-levels: $(LEVCOMP) mapdefs.ixx - -mapdefs.ixx: dat/vaults.des dat/splev.des $(LEVCOMP) - $(LEVCOMP) $@ < dat/vaults.des - $(LEVCOMP) -a $@ < dat/splev.des - -$(LEVCOMP): $(UTIL)levcomp.tab.o $(UTIL)levcomp.lex.o mapdef.o $(UTIL)levcomp.o - $(CXX) -o $@ $^ - -ifeq ($(DOYACC),y) - -prebuildyacc: mapdefs.ixx $(UTIL)levcomp.tab.cc $(UTIL)levcomp.tab.h $(UTIL)levcomp.lex.cc - cp $^ prebuilt/ - -$(UTIL)levcomp.tab.cc: $(UTIL)levcomp.ypp - cd $(UTIL) && $(YACC) -d -b levcomp levcomp.ypp \ - && mv $(YTABC) levcomp.tab.cc - -$(UTIL)levcomp.lex.cc: $(UTIL)levcomp.lpp - cd $(UTIL) && $(LEX) -olevcomp.lex.cc levcomp.lpp - -else - -# Pull the level-compiler stuff up from prebuilt/ - -$(UTIL)levcomp.tab.cc: prebuilt/levcomp.tab.cc - cp prebuilt/*.h $(UTIL) - cp $< $@ - - -$(UTIL)levcomp.lex.cc: prebuilt/levcomp.lex.cc - cp $< $@ - -endif - -########################################################################## - - -########################################################################## -# The actual build targets -# - -install: $(GAME) - $(COPY) $(GAME) ${INSTALLDIR} - chmod ${MCHMOD} ${INSTALLDIR}/$(GAME) - -clean: - $(DELETE) *.o - $(DELETE) $(UTIL)*.o - $(DELETE) $(LEVCOMP) - $(DELETE) $(UTIL)*.tab.cc $(UTIL)*.tab.c $(UTIL)*.tab.h $(UTIL)*.lex.cc - $(DELETE) *.ixx - -distclean: - $(DELETE) *.o - $(DELETE) bones.* - $(DELETE) morgue.txt - $(DELETE) scores - $(DELETE) $(GAME) - $(DELETE) *.sav - $(DELETE) core - $(DELETE) *.0* - $(DELETE) *.lab - -$(GAME): $(GAME_DEPENDS) - ${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB) - chmod ${MCHMOD} $(GAME) - -debug: $(GAME_DEPENDS) - ${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB) - -profile: $(GAME_DEPENDS) - ${CXX} -g -p ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB) - -# [ds] maps.cc now includes mapdefs.ixx, so add a dependency. -$(OPATH)/maps.o: mapdefs.ixx - -.cc.o: - ${CXX} ${CFLAGS} -c $< ${INCLUDE} - -# [ds] Note we don't use the standard CFLAGS here; that's intentional, most -# flex/bison combos I've tried don't produce code that passes the warnings -# test. -$(UTIL)%.o: $(UTIL)%.cc - $(CXX) -I$(UTIL) -I. -o $@ -c $< - -.h.cc: - touch $@ - -############################################################################# -# 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 removeold vlink pkgtarbz2 pkgzip - -pkgtidy: - $(DELETE) $(PKG_TIDY_LIST) - -removeold: - if [ -f ../../$(SRC_PKG_TAR) ]; then $(DELETE) ../../$(SRC_PKG_TAR); fi - if [ -f ../../$(SRC_PKG_ZIP) ]; then $(DELETE) ../../$(SRC_PKG_ZIP); fi - -# [ds] Existing directory names could produce a bad package! -vlink: - cd .. && WHERE=$$PWD && cd .. && \ - ( [ -e $(PKG_SRC_DIR) ] || ln -sf $$WHERE $(PKG_SRC_DIR) ) - -pkgtarbz2: - cd ../.. && tar -ch --bzip2 -f $(SRC_PKG_TAR) \ - -X $(PKG_EXCLUDES) $(PKG_SRC_DIR) - -pkgzip: - cd ../.. && zip -rq $(SRC_PKG_ZIP) $(PKG_SRC_DIR) \ - -x@$(PKG_EXCLUDES) - -endif diff --git a/crawl-ref/source/makefile.unix b/crawl-ref/source/makefile.unix new file mode 100644 index 0000000000..75abff9d5b --- /dev/null +++ b/crawl-ref/source/makefile.unix @@ -0,0 +1,190 @@ +# -*- Makefile -*- for Dungeon Crawl (linux) + +# +# Modified for Crawl Reference by $Author$ on $Date$ +# + +GAME = crawl + +# this file contains a list of the libraries. +# it will make a variable called OBJECTS that contains all the libraries +include makefile.obj + +OBJECTS += libunix.o + +CXX = g++ +DELETE = rm -f +COPY = cp +OS_TYPE = UNIX + +CFLAGS = -Wall -Wwrite-strings -fsigned-char \ + -Wshadow -pedantic \ + -g -D$(OS_TYPE) $(EXTRA_FLAGS) + +MCHMOD = 2755 + +# [dshaligram] More common location than /opt/crawl/bin - this is from the +# Debian patch. +INSTALLDIR = /usr/games +LIB = -lncurses + +# Include for Linux +INCLUDES = -I/usr/include/ncurses + +# If you have lex and yacc, set DOYACC to y (lowercase y). +DOYACC := y + +UTIL = util/ + +LEX := lex +YACC := bison -y + +YTABC := levcomp.tab.c +YTABH := levcomp.tab.h + +ifeq ($(LEX),) +DOYACC := +endif + +ifeq ($(YACC),) +DOYACC := +endif + +GAME_DEPENDS := compile-levels $(OBJECTS) +SRC_PKG_BASE := stone_soup +SRC_VERSION := $(shell egrep 'VERSION ".*"' version.h | \ + egrep -o '[0-9]\.[0-9](\.[0-9])?') +PKG_SRC_DIR := $(SRC_PKG_BASE)-$(SRC_VERSION)-src +SRC_PKG_TAR := $(PKG_SRC_DIR).tbz2 +SRC_PKG_ZIP := $(PKG_SRC_DIR).zip + +LEVCOMP := $(UTIL)levcomp + +PKG_TIDY_LIST := $(UTIL)*.o $(LEVCOMP) *.o $(LEVCOMP)*.cc $(LEVCOMP)*.h *.ixx +PKG_EXCLUDES := $(PWD)/misc/src-pkg-excludes.lst + +########################################################################## + +all: $(GAME) + +########################################################################## +# The level compiler +# +compile-levels: $(LEVCOMP) mapdefs.ixx + +mapdefs.ixx: dat/vaults.des dat/splev.des $(LEVCOMP) + $(LEVCOMP) $@ < dat/vaults.des + $(LEVCOMP) -a $@ < dat/splev.des + +$(LEVCOMP): $(UTIL)levcomp.tab.o $(UTIL)levcomp.lex.o mapdef.o $(UTIL)levcomp.o + $(CXX) -o $@ $^ + +ifeq ($(DOYACC),y) + +prebuildyacc: mapdefs.ixx $(UTIL)levcomp.tab.cc $(UTIL)levcomp.tab.h $(UTIL)levcomp.lex.cc + cp $^ prebuilt/ + +$(UTIL)levcomp.tab.cc: $(UTIL)levcomp.ypp + cd $(UTIL) && $(YACC) -d -b levcomp levcomp.ypp \ + && mv $(YTABC) levcomp.tab.cc + +$(UTIL)levcomp.lex.cc: $(UTIL)levcomp.lpp + cd $(UTIL) && $(LEX) -olevcomp.lex.cc levcomp.lpp + +else + +# Pull the level-compiler stuff up from prebuilt/ + +$(UTIL)levcomp.tab.cc: prebuilt/levcomp.tab.cc + cp prebuilt/*.h $(UTIL) + cp $< $@ + + +$(UTIL)levcomp.lex.cc: prebuilt/levcomp.lex.cc + cp $< $@ + +endif + +########################################################################## + + +########################################################################## +# The actual build targets +# + +install: $(GAME) + $(COPY) $(GAME) ${INSTALLDIR} + chmod ${MCHMOD} ${INSTALLDIR}/$(GAME) + +clean: + $(DELETE) *.o + $(DELETE) $(UTIL)*.o + $(DELETE) $(LEVCOMP) + $(DELETE) $(UTIL)*.tab.cc $(UTIL)*.tab.c $(UTIL)*.tab.h $(UTIL)*.lex.cc + $(DELETE) *.ixx + +distclean: + $(DELETE) *.o + $(DELETE) bones.* + $(DELETE) morgue.txt + $(DELETE) scores + $(DELETE) $(GAME) + $(DELETE) *.sav + $(DELETE) core + $(DELETE) *.0* + $(DELETE) *.lab + +$(GAME): $(GAME_DEPENDS) + ${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB) + chmod ${MCHMOD} $(GAME) + +debug: $(GAME_DEPENDS) + ${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB) + +profile: $(GAME_DEPENDS) + ${CXX} -g -p ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(GAME) $(LIB) + +# [ds] maps.cc now includes mapdefs.ixx, so add a dependency. +$(OPATH)/maps.o: mapdefs.ixx + +.cc.o: + ${CXX} ${CFLAGS} -c $< ${INCLUDE} + +# [ds] Note we don't use the standard CFLAGS here; that's intentional, most +# flex/bison combos I've tried don't produce code that passes the warnings +# test. +$(UTIL)%.o: $(UTIL)%.cc + $(CXX) -I$(UTIL) -I. -o $@ -c $< + +.h.cc: + touch $@ + +############################################################################# +# 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 removeold vlink pkgtarbz2 pkgzip + +pkgtidy: + $(DELETE) $(PKG_TIDY_LIST) + +removeold: + if [ -f ../../$(SRC_PKG_TAR) ]; then $(DELETE) ../../$(SRC_PKG_TAR); fi + if [ -f ../../$(SRC_PKG_ZIP) ]; then $(DELETE) ../../$(SRC_PKG_ZIP); fi + +# [ds] Existing directory names could produce a bad package! +vlink: + cd .. && WHERE=$$PWD && cd .. && \ + ( [ -e $(PKG_SRC_DIR) ] || ln -sf $$WHERE $(PKG_SRC_DIR) ) + +pkgtarbz2: + cd ../.. && tar -ch --bzip2 -f $(SRC_PKG_TAR) \ + -X $(PKG_EXCLUDES) $(PKG_SRC_DIR) + +pkgzip: + cd ../.. && zip -rq $(SRC_PKG_ZIP) $(PKG_SRC_DIR) \ + -x@$(PKG_EXCLUDES) + +endif -- cgit v1.2.3-54-g00ecf