summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMadCamel <madcamel@gmail.com>2010-05-05 07:34:05 -0400
committerMadCamel <madcamel@gmail.com>2010-05-05 07:34:05 -0400
commit51e87379c9d532cafc98b96178709b8b8c88e1ae (patch)
treedb80f2e1a758b2739ab79218a88a3def501f362d /Makefile
parentae73f3122063048b3a5a2d1c48f6c13b02fd4e1f (diff)
downloadtmwa-51e87379c9d532cafc98b96178709b8b8c88e1ae.tar.gz
tmwa-51e87379c9d532cafc98b96178709b8b8c88e1ae.tar.bz2
tmwa-51e87379c9d532cafc98b96178709b8b8c88e1ae.tar.xz
tmwa-51e87379c9d532cafc98b96178709b8b8c88e1ae.zip
Fixed up and slightly simplified the build system
It's now possible to run 'make' in any of the src/ subdirs and have it build properly. Moved some tools including eathena-monitor to src/tools - run 'make tools' to build. CFLAGS, etc are now in the 'make.defs' file. Requires GNU make.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile48
1 files changed, 3 insertions, 45 deletions
diff --git a/Makefile b/Makefile
index 50e8ff2..a6b9350 100644
--- a/Makefile
+++ b/Makefile
@@ -1,33 +1,7 @@
# $Id$
+include make.defs
-ifeq ($(shell uname -m), x86_64)
-M32=-m32
-endif
-
-CC = gcc ${M32}
-
-PLATFORM = $(shell uname)
-
-ifeq ($(findstring FreeBSD,$(PLATFORM)), FreeBSD)
-MAKE = gmake
-else
-MAKE = make
-endif
-
-OPT = -pipe -g -fno-strict-aliasing -O2 -Wall
-
-ifeq ($(findstring CYGWIN,$(PLATFORM)), CYGWIN)
-OS_TYPE = -DCYGWIN
-CFLAGS = $(OPT) -DFD_SETSIZE=4096 -I../common $(PACKETDEF) $(OS_TYPE)
-else
-OS_TYPE =
-CFLAGS = $(OPT) -fstack-protector -Wno-pointer-sign -I../common $(PACKETDEF) $(OS_TYPE)
-endif
-
-MKDEF = CC="$(CC)" CFLAGS="$(CFLAGS)"
-
-
-all clean: src/common/GNUmakefile src/login/GNUmakefile src/char/GNUmakefile src/map/GNUmakefile src/ladmin/GNUmakefile
+all clean: src/common/Makefile src/login/Makefile src/char/Makefile src/map/Makefile src/ladmin/Makefile
cd src ; cd common ; $(MAKE) $(MKDEF) $@ ; cd ..
cd src ; cd login ; $(MAKE) $(MKDEF) $@ ; cd ..
cd src ; cd char ; $(MAKE) $(MKDEF) $@ ; cd ..
@@ -35,20 +9,4 @@ all clean: src/common/GNUmakefile src/login/GNUmakefile src/char/GNUmakefile src
cd src ; cd ladmin ; $(MAKE) $(MKDEF) $@ ; cd ..
tools:
- cd tool && $(MAKE) $(MKDEF) && cd ..
- $(CC) -o setupwizard setupwizard.c
-
-src/common/GNUmakefile: src/common/Makefile
- sed -e 's/$$>/$$^/' src/common/Makefile > src/common/GNUmakefile
-src/login/GNUmakefile: src/login/Makefile
- sed -e 's/$$>/$$^/' src/login/Makefile > src/login/GNUmakefile
-src/char/GNUmakefile: src/char/Makefile
- sed -e 's/$$>/$$^/' src/char/Makefile > src/char/GNUmakefile
-src/map/GNUmakefile: src/map/Makefile
- sed -e 's/$$>/$$^/' src/map/Makefile > src/map/GNUmakefile
-src/ladmin/GNUmakefile: src/ladmin/Makefile
- sed -e 's/$$>/$$^/' src/ladmin/Makefile > src/ladmin/GNUmakefile
-src/txt-converter/login/GNUmakefile: src/txt-converter/login/Makefile
- sed -e 's/$$>/$$^/' src/txt-converter/login/Makefile > src/txt-converter/login/GNUmakefile
-src/txt-converter/char/GNUmakefile: src/txt-converter/char/Makefile
- sed -e 's/$$>/$$^/' src/txt-converter/char/Makefile > src/txt-converter/char/GNUmakefile
+ cd src/tool && $(MAKE) $(MKDEF) && cd ..