diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-08-19 15:50:24 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-08-19 15:50:24 +0000 |
commit | 48a024086ecc4a55541220bfbc313f884012ee06 (patch) | |
tree | dd4c915bf42150e3d03e7be24eba2bfda2e1d9bc | |
parent | f49a7e537b416bd6fe65959607a5304dbb401849 (diff) | |
download | crawl-ref-48a024086ecc4a55541220bfbc313f884012ee06.tar.gz crawl-ref-48a024086ecc4a55541220bfbc313f884012ee06.zip |
r66@ODIN: dshaligram | 2006-08-19 21:21:39 +051800
Fixed MinGW makefile (and main makefile) to make life easier when you're
building debug and non-debug builds and you don't want to keep running clean
between builds.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@22 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/makefile | 2 | ||||
-rw-r--r-- | crawl-ref/source/makefile.mgw | 43 |
2 files changed, 33 insertions, 12 deletions
diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile index 1f7dac1cb0..7b2856786f 100644 --- a/crawl-ref/source/makefile +++ b/crawl-ref/source/makefile @@ -36,7 +36,7 @@ wizard: # DEBUG mode includes WIZARD mode as well as copious debugging input debug: - $(MAKE) $(OTHER) -f $(MAKEFILE) debug EXTRA_FLAGS='-g -DFULLDEBUG -DWIZARD' + $(MAKE) $(OTHER) -f $(MAKEFILE) DEBUG_CRAWL=y debug EXTRA_FLAGS='-g -DFULLDEBUG -DWIZARD' # DO NOT DELETE THIS LINE -- $(MAKE) depend depends on it. diff --git a/crawl-ref/source/makefile.mgw b/crawl-ref/source/makefile.mgw index 750e25a6c7..9626ce5c58 100644 --- a/crawl-ref/source/makefile.mgw +++ b/crawl-ref/source/makefile.mgw @@ -1,13 +1,21 @@ -# Make file for Dungeon Crawl (dos) +# Make file for Dungeon Crawl (Win32, MinGW) # this file contains a list of the libraries. # it will make a variable called OBJECTS that contains all the libraries include makefile.obj +ifeq ($(DEBUG_CRAWL),) +OPATH := rel/ +else +OPATH := dbg/ +endif + +OBPATH = $(subst /,\,$(OPATH)) + # need .exe so make will find the right file -APPNAME = crawl.exe +APPNAME = $(OPATH)crawl.exe CXX = g++ -DELETE = rm +DELETE = del COPY = copy OS_TYPE = WIN32CONSOLE CFLAGS = -Wall -Wwrite-strings -Wstrict-prototypes \ @@ -15,7 +23,8 @@ CFLAGS = -Wall -Wwrite-strings -Wstrict-prototypes \ -D$(OS_TYPE) $(EXTRA_FLAGS) -DCLUA_BINDINGS \ -DWINMM_PLAY_SOUNDS -DREGEX_PCRE -OBJECTS := $(OBJECTS) libw32c.o +OBJNAMES := $(OBJECTS) $(OPATH)libw32c.o +OBJECTS = $(foreach file,$(OBJNAMES),$(OPATH)$(file)) LDFLAGS = INSTALLDIR = . @@ -24,32 +33,44 @@ LIB = -lwinmm -static -lpcre -llua -llualib all: $(APPNAME) +prepare: + if not exist $(OPATH) mkdir $(OBPATH) + install: $(APPNAME) $(COPY) $(APPNAME) ${INSTALLDIR} clean: - $(DELETE) *.o + $(DELETE) $(OBPATH)*.o distclean: - $(DELETE) *.o + $(DELETE) $(OBPATH)*.o + $(DELETE) *.o $(DELETE) bones.* + $(DELETE) $(OBPATH)bones.* $(DELETE) morgue.txt + $(DELETE) $(OBPATH)morgue.txt $(DELETE) scores - $(DELETE) $(APPNAME) + $(DELETE) $(OBPATH)scores + $(DELETE) crawl.exe + $(DELETE) $(subst /,\,$(APPNAME)) $(DELETE) *.sav + $(DELETE) $(OBPATH)*.sav $(DELETE) core + $(DELETE) $(OBPATH)core $(DELETE) *.0* + $(DELETE) $(OBPATH)*.0* $(DELETE) *.lab + $(DELETE) $(OBPATH)*.lab -$(APPNAME): $(OBJECTS) +$(APPNAME): prepare $(OBJECTS) ${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(APPNAME) $(LIB) strip $(APPNAME) -debug: $(OBJECTS) +debug: prepare $(OBJECTS) ${CXX} ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(APPNAME) $(LIB) profile: $(OBJECTS) ${CXX} -g -p ${LDFLAGS} $(INCLUDES) $(CFLAGS) $(OBJECTS) -o $(APPNAME) $(LIB) -.cc.o: - ${CXX} ${CFLAGS} -c $< ${INCLUDE} +$(OPATH)%.o: %.cc + ${CXX} ${CFLAGS} ${INCLUDES} -o $@ -c $< |