summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2011-04-02 22:00:46 -0700
committerBen Longbons <b.r.longbons@gmail.com>2011-04-03 18:26:38 -0700
commit4095d5726ebabc663a6d5397d003773ee652818a (patch)
treeb42844e6a6d8f283d0a31ae92ac5b0d32a669b7b
parent7a1b57a80346c1b5f2b2c5b8f0899167bf2fd9b1 (diff)
downloadtmwa-4095d5726ebabc663a6d5397d003773ee652818a.tar.gz
tmwa-4095d5726ebabc663a6d5397d003773ee652818a.tar.bz2
tmwa-4095d5726ebabc663a6d5397d003773ee652818a.tar.xz
tmwa-4095d5726ebabc663a6d5397d003773ee652818a.zip
Rewrite make system to be optimal
-rw-r--r--.gitignore29
-rw-r--r--GNUmakefile77
-rw-r--r--Makefile40
-rw-r--r--deps.make308
-rw-r--r--make.defs11
-rw-r--r--src/char/GNUmakefile7
-rw-r--r--src/char/Makefile16
-rw-r--r--src/common/GNUmakefile7
-rw-r--r--src/common/Makefile15
-rw-r--r--src/ladmin/GNUmakefile7
-rw-r--r--src/ladmin/Makefile12
-rw-r--r--src/login/GNUmakefile7
-rw-r--r--src/login/Makefile12
-rw-r--r--src/map/GNUmakefile7
-rw-r--r--src/map/Makefile51
-rw-r--r--src/tool/GNUmakefile7
-rw-r--r--src/tool/Makefile15
-rw-r--r--src/tool/moneycount/Makefile14
-rw-r--r--src/webserver/GNUmakefile7
-rw-r--r--src/webserver/Makefile15
-rw-r--r--warnings29
21 files changed, 476 insertions, 217 deletions
diff --git a/.gitignore b/.gitignore
index 0bba20b..d59b2ef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,22 +1,13 @@
# files generated during make
-*.o
-src/char/char
-char-server
-src/ladmin/ladmin
+/obj/
+# Copied executables
+/char-server
/ladmin
-src/login/login
-login-server
-src/map/map
-map-server
-eathena-monitor
-magic-interpreter-parser.h
-magic-interpreter-parser.c
-magic-interpreter-lexer.c
-magic-interpreter-parser.output
+/login-server
+/map-server
+/eathena-monitor
+# Generated source files
+src/map/magic-interpreter-parser.h
+src/map/magic-interpreter-parser.c
+src/map/magic-interpreter-lexer.c
-src/tool/adduser
-src/tool/itemfrob
-src/tool/mapfrob
-src/tool/marriage-info
-src/tool/eathena-monitor
-src/webserver/webserver
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..7d0be35
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,77 @@
+#! /usr/bin/make -f
+SHELL=/bin/bash
+BUILD_DIR = obj
+default: login-server char-server map-server ladmin eathena-monitor
+.DELETE_ON_ERROR:
+include make.defs
+
+.PHONY: all clean common
+.PRECIOUS: %/
+%/:
+ +mkdir -p $@
+
+# The default recipe is suboptimal
+%.c: %.l
+ $(LEX) -o $@ $<
+%.c %.h: %.y
+ $(BISON) -d -o $*.c $<
+
+
+# All this duplication is required because make handles pattern rules specially
+${BUILD_DIR}/char/%.o: src/char/%.c | ${BUILD_DIR}/char/
+ $(COMPILE.c) -o $@ $<
+${BUILD_DIR}/common/%.o: src/common/%.c | ${BUILD_DIR}/common/
+ $(COMPILE.c) -o $@ $<
+${BUILD_DIR}/ladmin/%.o: src/ladmin/%.c | ${BUILD_DIR}/ladmin/
+ $(COMPILE.c) -o $@ $<
+${BUILD_DIR}/login/%.o: src/login/%.c | ${BUILD_DIR}/login/
+ $(COMPILE.c) -o $@ $<
+${BUILD_DIR}/map/%.o: src/map/%.c | ${BUILD_DIR}/map/
+ $(COMPILE.c) -o $@ $<
+${BUILD_DIR}/tool/%.o: src/tool/%.c | ${BUILD_DIR}/tool/
+ $(COMPILE.c) -o $@ $<
+${BUILD_DIR}/webserver/%.o: src/webserver/%.c | ${BUILD_DIR}/webserver/
+ $(COMPILE.c) -o $@ $<
+${BUILD_DIR}/webserver/pages/%.o: src/webserver/pages/%.c | ${BUILD_DIR}/webserver/pages/
+ $(COMPILE.c) -o $@ $<
+
+PROGS = login-server char-server map-server ladmin eathena-monitor webserver
+# Things to actually make
+all: ${PROGS}
+clean:
+ rm -rf ${PROGS} ${BUILD_DIR}/
+common: ${BUILD_DIR}/common/core.o ${BUILD_DIR}/common/db.o ${BUILD_DIR}/common/grfio.o ${BUILD_DIR}/common/lock.o ${BUILD_DIR}/common/md5calc.o ${BUILD_DIR}/common/mt_rand.o ${BUILD_DIR}/common/nullpo.o ${BUILD_DIR}/common/socket.o ${BUILD_DIR}/common/timer.o
+
+# Top level programs
+login-server: ${BUILD_DIR}/login/login
+ cp -f $< $@
+char-server: ${BUILD_DIR}/char/char
+ cp -f $< $@
+map-server: ${BUILD_DIR}/map/map
+ cp -f $< $@
+ladmin: ${BUILD_DIR}/ladmin/ladmin
+ cp -f $< $@
+eathena-monitor: ${BUILD_DIR}/tool/eathena-monitor
+ cp -f $< $@
+webserver: ${BUILD_DIR}/webserver/main
+ cp -f $< $@
+
+# Executable dependencies - generated by hand
+${BUILD_DIR}/char/char: ${BUILD_DIR}/char/char.o ${BUILD_DIR}/char/inter.o ${BUILD_DIR}/char/int_party.o ${BUILD_DIR}/char/int_guild.o ${BUILD_DIR}/char/int_storage.o ${BUILD_DIR}/common/core.o ${BUILD_DIR}/common/socket.o ${BUILD_DIR}/common/timer.o ${BUILD_DIR}/common/db.o ${BUILD_DIR}/common/lock.o ${BUILD_DIR}/common/mt_rand.o
+${BUILD_DIR}/ladmin/ladmin: ${BUILD_DIR}/ladmin/ladmin.o ${BUILD_DIR}/common/md5calc.o ${BUILD_DIR}/common/core.o ${BUILD_DIR}/common/socket.o ${BUILD_DIR}/common/timer.o ${BUILD_DIR}/common/db.o ${BUILD_DIR}/common/mt_rand.o
+${BUILD_DIR}/login/login: ${BUILD_DIR}/login/login.o ${BUILD_DIR}/common/core.o ${BUILD_DIR}/common/socket.o ${BUILD_DIR}/common/timer.o ${BUILD_DIR}/common/db.o ${BUILD_DIR}/common/lock.o ${BUILD_DIR}/common/mt_rand.o ${BUILD_DIR}/common/md5calc.o
+${BUILD_DIR}/map/map: LDLIBS=-lm
+${BUILD_DIR}/map/map: ${BUILD_DIR}/map/map.o ${BUILD_DIR}/map/tmw.o ${BUILD_DIR}/map/magic-interpreter-lexer.o ${BUILD_DIR}/map/magic-interpreter-parser.o ${BUILD_DIR}/map/magic-interpreter-base.o ${BUILD_DIR}/map/magic-expr.o ${BUILD_DIR}/map/magic-stmt.o ${BUILD_DIR}/map/magic.o ${BUILD_DIR}/map/map.o ${BUILD_DIR}/map/chrif.o ${BUILD_DIR}/map/clif.o ${BUILD_DIR}/map/pc.o ${BUILD_DIR}/map/npc.o ${BUILD_DIR}/map/chat.o ${BUILD_DIR}/map/path.o ${BUILD_DIR}/map/itemdb.o ${BUILD_DIR}/map/mob.o ${BUILD_DIR}/map/script.o ${BUILD_DIR}/map/storage.o ${BUILD_DIR}/map/skill.o ${BUILD_DIR}/map/skill-pools.o ${BUILD_DIR}/map/atcommand.o ${BUILD_DIR}/map/battle.o ${BUILD_DIR}/map/intif.o ${BUILD_DIR}/map/trade.o ${BUILD_DIR}/map/party.o ${BUILD_DIR}/map/guild.o ${BUILD_DIR}/common/core.o ${BUILD_DIR}/common/socket.o ${BUILD_DIR}/common/timer.o ${BUILD_DIR}/common/grfio.o ${BUILD_DIR}/common/db.o ${BUILD_DIR}/common/lock.o ${BUILD_DIR}/common/nullpo.o ${BUILD_DIR}/common/mt_rand.o ${BUILD_DIR}/common/md5calc.o
+${BUILD_DIR}/tool/eathena-monitor: ${BUILD_DIR}/tool/eathena-monitor.o
+${BUILD_DIR}/tool/adduser: ${BUILD_DIR}/tool/adduser.o ${BUILD_DIR}/common/socket.o
+${BUILD_DIR}/tool/itemfrob: ${BUILD_DIR}/tool/itemfrob.o ${BUILD_DIR}/common/timer.o ${BUILD_DIR}/common/socket.o ${BUILD_DIR}/common/db.o ${BUILD_DIR}/common/lock.o ${BUILD_DIR}/char/inter.o ${BUILD_DIR}/char/int_guild.o ${BUILD_DIR}/char/int_party.o ${BUILD_DIR}/char/int_storage.o
+${BUILD_DIR}/tool/mapfrob: ${BUILD_DIR}/tool/mapfrob.o ${BUILD_DIR}/common/timer.o ${BUILD_DIR}/common/socket.o ${BUILD_DIR}/common/db.o ${BUILD_DIR}/common/lock.o ${BUILD_DIR}/char/inter.o ${BUILD_DIR}/char/int_guild.o ${BUILD_DIR}/char/int_party.o ${BUILD_DIR}/char/int_storage.o
+${BUILD_DIR}/tool/marriage-info: ${BUILD_DIR}/tool/marriage-info.o ${BUILD_DIR}/common/timer.o ${BUILD_DIR}/common/socket.o ${BUILD_DIR}/common/db.o ${BUILD_DIR}/common/lock.o ${BUILD_DIR}/char/inter.o ${BUILD_DIR}/char/int_guild.o ${BUILD_DIR}/char/int_party.o ${BUILD_DIR}/char/int_storage.o
+${BUILD_DIR}/webserver/main: ${BUILD_DIR}/webserver/main.o ${BUILD_DIR}/webserver/parse.o ${BUILD_DIR}/webserver/generate.o ${BUILD_DIR}/webserver/htmlstyle.o ${BUILD_DIR}/webserver/logs.o ${BUILD_DIR}/webserver/pages/about.o ${BUILD_DIR}/webserver/pages/sample.o ${BUILD_DIR}/webserver/pages/notdone.o
+
+deps.make:
+ for F in `find src/ -name '*.c'`; do \
+ gcc -m32 -std=c99 -MM "$$F" -MT "$$(sed 's/src/$${BUILD_DIR}/;s/\.c/.o/' <<< "$$F")"; \
+ done > deps.make
+
+include deps.make
diff --git a/Makefile b/Makefile
deleted file mode 100644
index c34b691..0000000
--- a/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-include make.defs
-
-all: login-server char-server map-server ladmin
-tools: tool eathena-monitor
-
-
-common: src/common
- ${MAKE} -C src/common
-login-server: common src/login
- ${MAKE} -C src/login
- ${CP} src/login/login login-server
-char-server: common src/char
- ${MAKE} -C src/char
- ${CP} src/char/char char-server
-map-server: common src/map
- ${MAKE} -C src/map
- ${CP} src/map/map map-server
-ladmin: common src/ladmin
- ${MAKE} -C src/ladmin
-
-clean: clean-common clean-login clean-char clean-map clean-ladmin clean-tools
-
-clean-common:
- ${MAKE} -C src/common clean
-clean-login:
- ${MAKE} -C src/login clean
-clean-char:
- ${MAKE} -C src/char clean
-clean-map:
- ${MAKE} -C src/map clean
-clean-ladmin:
- ${MAKE} -C src/ladmin clean
-
-# This target is separate for historical reasons, and because it is optional
-tool: common src/tool
- ${MAKE} -C src/tool
-eathena-monitor: tool
- ${CP} src/tool/eathena-monitor .
-clean-tools:
- ${MAKE} -C src/tool clean
diff --git a/deps.make b/deps.make
new file mode 100644
index 0000000..34c7328
--- /dev/null
+++ b/deps.make
@@ -0,0 +1,308 @@
+${BUILD_DIR}/webserver/main.o: src/webserver/main.c
+${BUILD_DIR}/webserver/logs.o: src/webserver/logs.c
+${BUILD_DIR}/webserver/generate.o: src/webserver/generate.c
+${BUILD_DIR}/webserver/parse.o: src/webserver/parse.c
+${BUILD_DIR}/webserver/pages/about.o: src/webserver/pages/about.c
+${BUILD_DIR}/webserver/pages/notdone.o: src/webserver/pages/notdone.c
+${BUILD_DIR}/webserver/pages/sample.o: src/webserver/pages/sample.c
+${BUILD_DIR}/webserver/htmlstyle.o: src/webserver/htmlstyle.c
+${BUILD_DIR}/common/mt_rand.o: src/common/mt_rand.c src/common/mt_rand.h \
+ src/common/sanity.h
+${BUILD_DIR}/common/timer.o: src/common/timer.c src/common/timer.h \
+ src/common/sanity.h src/common/utils.h
+${BUILD_DIR}/common/nullpo.o: src/common/nullpo.c src/common/nullpo.h \
+ src/common/sanity.h
+${BUILD_DIR}/common/lock.o: src/common/lock.c src/common/lock.h \
+ src/common/socket.h src/common/sanity.h
+${BUILD_DIR}/common/grfio.o: src/common/grfio.c src/common/utils.h \
+ src/common/grfio.h src/common/mmo.h src/common/socket.h \
+ src/common/sanity.h
+${BUILD_DIR}/common/md5calc.o: src/common/md5calc.c src/common/md5calc.h \
+ src/common/sanity.h src/common/mt_rand.h
+${BUILD_DIR}/common/dbtest.o: src/common/dbtest.c src/common/db.h \
+ src/common/sanity.h
+${BUILD_DIR}/common/db.o: src/common/db.c src/common/db.h \
+ src/common/sanity.h src/common/utils.h
+${BUILD_DIR}/common/socket.o: src/common/socket.c src/common/mmo.h \
+ src/common/utils.h src/common/socket.h src/common/sanity.h
+${BUILD_DIR}/common/core.o: src/common/core.c src/common/core.h \
+ src/common/socket.h src/common/sanity.h src/common/timer.h \
+ src/common/version.h src/common/mt_rand.h src/common/nullpo.h
+${BUILD_DIR}/login/login.o: src/login/login.c src/login/../common/core.h \
+ src/login/../common/socket.h src/login/../common/sanity.h \
+ src/login/../common/timer.h src/login/login.h src/login/../common/mmo.h \
+ src/login/../common/utils.h src/login/../common/version.h \
+ src/login/../common/db.h src/login/../common/lock.h \
+ src/login/../common/mt_rand.h src/login/../common/md5calc.h
+${BUILD_DIR}/char/int_guild.o: src/char/int_guild.c src/char/inter.h \
+ src/char/int_guild.h src/char/int_storage.h src/char/../common/mmo.h \
+ src/char/../common/utils.h src/char/char.h src/char/../common/socket.h \
+ src/char/../common/sanity.h src/char/../common/db.h \
+ src/char/../common/lock.h
+${BUILD_DIR}/char/inter.o: src/char/inter.c src/char/../common/mmo.h \
+ src/char/../common/utils.h src/char/char.h src/char/../common/socket.h \
+ src/char/../common/sanity.h src/char/../common/timer.h \
+ src/char/../common/db.h src/char/inter.h src/char/int_party.h \
+ src/char/int_guild.h src/char/int_storage.h src/char/../common/lock.h
+${BUILD_DIR}/char/int_party.o: src/char/int_party.c src/char/inter.h \
+ src/char/int_party.h src/char/../common/mmo.h src/char/../common/utils.h \
+ src/char/char.h src/char/../common/socket.h src/char/../common/sanity.h \
+ src/char/../common/db.h src/char/../common/lock.h
+${BUILD_DIR}/char/int_storage.o: src/char/int_storage.c \
+ src/char/../common/mmo.h src/char/../common/utils.h \
+ src/char/../common/socket.h src/char/../common/sanity.h \
+ src/char/../common/db.h src/char/../common/lock.h src/char/char.h \
+ src/char/inter.h src/char/int_storage.h src/char/int_guild.h
+${BUILD_DIR}/char/char.o: src/char/char.c src/char/../common/core.h \
+ src/char/../common/socket.h src/char/../common/sanity.h \
+ src/char/../common/timer.h src/char/../common/mmo.h \
+ src/char/../common/utils.h src/char/../common/version.h \
+ src/char/../common/lock.h src/char/char.h src/char/inter.h \
+ src/char/int_guild.h src/char/int_party.h src/char/int_storage.h
+${BUILD_DIR}/tool/itemfrob.o: src/tool/itemfrob.c \
+ src/tool/../common/mmo.h src/tool/../common/utils.h \
+ src/tool/../char/char.c src/tool/../char/../common/core.h \
+ src/tool/../char/../common/socket.h src/tool/../char/../common/sanity.h \
+ src/tool/../char/../common/timer.h src/tool/../char/../common/mmo.h \
+ src/tool/../char/../common/version.h src/tool/../char/../common/lock.h \
+ src/tool/../char/char.h src/tool/../char/inter.h \
+ src/tool/../char/int_guild.h src/tool/../char/int_party.h \
+ src/tool/../char/int_storage.h
+${BUILD_DIR}/tool/eathena-monitor.o: src/tool/eathena-monitor.c
+${BUILD_DIR}/tool/adduser.o: src/tool/adduser.c
+${BUILD_DIR}/tool/marriage-info.o: src/tool/marriage-info.c \
+ src/tool/../login/login.h src/tool/../common/mmo.h \
+ src/tool/../common/utils.h src/tool/../char/char.c \
+ src/tool/../char/../common/core.h src/tool/../char/../common/socket.h \
+ src/tool/../char/../common/sanity.h src/tool/../char/../common/timer.h \
+ src/tool/../char/../common/mmo.h src/tool/../char/../common/version.h \
+ src/tool/../char/../common/lock.h src/tool/../char/char.h \
+ src/tool/../char/inter.h src/tool/../char/int_guild.h \
+ src/tool/../char/int_party.h src/tool/../char/int_storage.h
+${BUILD_DIR}/tool/skillfrob.o: src/tool/skillfrob.c \
+ src/tool/../common/mmo.h src/tool/../common/utils.h \
+ src/tool/../char/char.c src/tool/../char/../common/core.h \
+ src/tool/../char/../common/socket.h src/tool/../char/../common/sanity.h \
+ src/tool/../char/../common/timer.h src/tool/../char/../common/mmo.h \
+ src/tool/../char/../common/version.h src/tool/../char/../common/lock.h \
+ src/tool/../char/char.h src/tool/../char/inter.h \
+ src/tool/../char/int_guild.h src/tool/../char/int_party.h \
+ src/tool/../char/int_storage.h
+${BUILD_DIR}/tool/convert.o: src/tool/convert.c
+${BUILD_DIR}/tool/mapfrob.o: src/tool/mapfrob.c src/tool/../common/mmo.h \
+ src/tool/../common/utils.h src/tool/../char/char.c \
+ src/tool/../char/../common/core.h src/tool/../char/../common/socket.h \
+ src/tool/../char/../common/sanity.h src/tool/../char/../common/timer.h \
+ src/tool/../char/../common/mmo.h src/tool/../char/../common/version.h \
+ src/tool/../char/../common/lock.h src/tool/../char/char.h \
+ src/tool/../char/inter.h src/tool/../char/int_guild.h \
+ src/tool/../char/int_party.h src/tool/../char/int_storage.h
+${BUILD_DIR}/map/itemdb.o: src/map/itemdb.c src/map/../common/db.h \
+ src/map/../common/sanity.h src/map/../common/grfio.h \
+ src/map/../common/nullpo.h src/map/map.h src/map/../common/mmo.h \
+ src/map/../common/utils.h src/map/../common/timer.h src/map/battle.h \
+ src/map/itemdb.h src/map/script.h src/map/pc.h \
+ src/map/../common/socket.h src/map/../common/mt_rand.h
+${BUILD_DIR}/map/magic.o: src/map/magic.c src/map/magic-interpreter.h \
+ src/map/../common/nullpo.h src/map/../common/sanity.h src/map/battle.h \
+ src/map/chat.h src/map/map.h src/map/../common/mmo.h \
+ src/map/../common/utils.h src/map/../common/timer.h \
+ src/map/../common/db.h src/map/chrif.h src/map/clif.h src/map/storage.h \
+ src/map/intif.h src/map/itemdb.h src/map/magic.h src/map/mob.h \
+ src/map/npc.h src/map/pc.h src/map/party.h src/map/script.h \
+ src/map/skill.h src/map/trade.h src/map/../common/socket.h
+${BUILD_DIR}/map/guild.o: src/map/guild.c src/map/guild.h \
+ src/map/storage.h src/map/../common/mmo.h src/map/../common/utils.h \
+ src/map/../common/db.h src/map/../common/sanity.h \
+ src/map/../common/timer.h src/map/../common/socket.h \
+ src/map/../common/nullpo.h src/map/battle.h src/map/npc.h src/map/pc.h \
+ src/map/map.h src/map/mob.h src/map/intif.h src/map/clif.h src/map/tmw.h
+${BUILD_DIR}/map/mob.o: src/map/mob.c src/map/../common/timer.h \
+ src/map/../common/sanity.h src/map/../common/socket.h \
+ src/map/../common/db.h src/map/../common/nullpo.h \
+ src/map/../common/mt_rand.h src/map/map.h src/map/../common/mmo.h \
+ src/map/../common/utils.h src/map/clif.h src/map/storage.h \
+ src/map/intif.h src/map/pc.h src/map/mob.h src/map/guild.h \
+ src/map/itemdb.h src/map/skill.h src/map/magic.h src/map/battle.h \
+ src/map/party.h src/map/npc.h
+${BUILD_DIR}/map/storage.o: src/map/storage.c src/map/../common/db.h \
+ src/map/../common/sanity.h src/map/../common/nullpo.h src/map/storage.h \
+ src/map/../common/mmo.h src/map/../common/utils.h src/map/chrif.h \
+ src/map/itemdb.h src/map/map.h src/map/../common/timer.h src/map/clif.h \
+ src/map/intif.h src/map/pc.h src/map/guild.h src/map/battle.h \
+ src/map/atcommand.h
+${BUILD_DIR}/map/path.o: src/map/path.c src/map/map.h \
+ src/map/../common/mmo.h src/map/../common/utils.h \
+ src/map/../common/timer.h src/map/../common/sanity.h \
+ src/map/../common/db.h src/map/battle.h src/map/../common/nullpo.h
+${BUILD_DIR}/map/magic-interpreter-parser.o: \
+ src/map/magic-interpreter-parser.c src/map/magic-interpreter.h \
+ src/map/../common/nullpo.h src/map/../common/sanity.h src/map/battle.h \
+ src/map/chat.h src/map/map.h src/map/../common/mmo.h \
+ src/map/../common/utils.h src/map/../common/timer.h \
+ src/map/../common/db.h src/map/chrif.h src/map/clif.h src/map/storage.h \
+ src/map/intif.h src/map/itemdb.h src/map/magic.h src/map/mob.h \
+ src/map/npc.h src/map/pc.h src/map/party.h src/map/script.h \
+ src/map/skill.h src/map/trade.h src/map/../common/socket.h \
+ src/map/magic-expr.h src/map/magic-interpreter-aux.h
+${BUILD_DIR}/map/skill.o: src/map/skill.c src/map/../common/timer.h \
+ src/map/../common/sanity.h src/map/../common/nullpo.h \
+ src/map/../common/mt_rand.h src/map/magic.h src/map/clif.h src/map/map.h \
+ src/map/../common/mmo.h src/map/../common/utils.h src/map/../common/db.h \
+ src/map/storage.h src/map/intif.h src/map/battle.h src/map/itemdb.h \
+ src/map/mob.h src/map/party.h src/map/pc.h src/map/script.h \
+ src/map/skill.h src/map/../common/socket.h
+${BUILD_DIR}/map/magic-interpreter-lexer.o: \
+ src/map/magic-interpreter-lexer.c src/map/magic-interpreter.h \
+ src/map/../common/nullpo.h src/map/../common/sanity.h src/map/battle.h \
+ src/map/chat.h src/map/map.h src/map/../common/mmo.h \
+ src/map/../common/utils.h src/map/../common/timer.h \
+ src/map/../common/db.h src/map/chrif.h src/map/clif.h src/map/storage.h \
+ src/map/intif.h src/map/itemdb.h src/map/magic.h src/map/mob.h \
+ src/map/npc.h src/map/pc.h src/map/party.h src/map/script.h \
+ src/map/skill.h src/map/trade.h src/map/../common/socket.h \
+ src/map/magic-interpreter-parser.h
+${BUILD_DIR}/map/magic-stmt.o: src/map/magic-stmt.c \
+ src/map/magic-interpreter.h src/map/../common/nullpo.h \
+ src/map/../common/sanity.h src/map/battle.h src/map/chat.h src/map/map.h \
+ src/map/../common/mmo.h src/map/../common/utils.h \
+ src/map/../common/timer.h src/map/../common/db.h src/map/chrif.h \
+ src/map/clif.h src/map/storage.h src/map/intif.h src/map/itemdb.h \
+ src/map/magic.h src/map/mob.h src/map/npc.h src/map/pc.h src/map/party.h \
+ src/map/script.h src/map/skill.h src/map/trade.h \
+ src/map/../common/socket.h src/map/magic-expr.h \
+ src/map/magic-interpreter-aux.h src/map/magic-expr-eval.h
+${BUILD_DIR}/map/chat.o: src/map/chat.c src/map/../common/db.h \
+ src/map/../common/sanity.h src/map/../common/nullpo.h src/map/map.h \
+ src/map/../common/mmo.h src/map/../common/utils.h \
+ src/map/../common/timer.h src/map/clif.h src/map/storage.h src/map/pc.h \
+ src/map/chat.h src/map/npc.h
+${BUILD_DIR}/map/skill-pools.o: src/map/skill-pools.c \
+ src/map/../common/timer.h src/map/../common/sanity.h \
+ src/map/../common/nullpo.h src/map/../common/mt_rand.h src/map/magic.h \
+ src/map/clif.h src/map/map.h src/map/../common/mmo.h \
+ src/map/../common/utils.h src/map/../common/db.h src/map/storage.h \
+ src/map/intif.h src/map/battle.h src/map/itemdb.h src/map/mob.h \
+ src/map/party.h src/map/pc.h src/map/script.h src/map/skill.h \
+ src/map/../common/socket.h
+${BUILD_DIR}/map/trade.o: src/map/trade.c src/map/clif.h src/map/map.h \
+ src/map/../common/mmo.h src/map/../common/utils.h \
+ src/map/../common/timer.h src/map/../common/sanity.h \
+ src/map/../common/db.h src/map/storage.h src/map/itemdb.h \
+ src/map/trade.h src/map/pc.h src/map/npc.h src/map/battle.h \
+ src/map/../common/nullpo.h
+${BUILD_DIR}/map/party.o: src/map/party.c src/map/party.h \
+ src/map/../common/db.h src/map/../common/sanity.h \
+ src/map/../common/timer.h src/map/../common/socket.h \
+ src/map/../common/nullpo.h src/map/pc.h src/map/map.h \
+ src/map/../common/mmo.h src/map/../common/utils.h src/map/battle.h \
+ src/map/intif.h src/map/clif.h src/map/storage.h src/map/skill.h \
+ src/map/magic.h src/map/tmw.h
+${BUILD_DIR}/map/npc.o: src/map/npc.c src/map/../common/nullpo.h \
+ src/map/../common/sanity.h src/map/../common/timer.h src/map/battle.h \
+ src/map/clif.h src/map/map.h src/map/../common/mmo.h \
+ src/map/../common/utils.h src/map/../common/db.h src/map/storage.h \
+ src/map/intif.h src/map/itemdb.h src/map/mob.h src/map/npc.h \
+ src/map/pc.h src/map/script.h src/map/skill.h src/map/magic.h \
+ src/map/../common/socket.h
+${BUILD_DIR}/map/magic-interpreter-base.o: \
+ src/map/magic-interpreter-base.c src/map/magic.h src/map/clif.h \
+ src/map/map.h src/map/../common/mmo.h src/map/../common/utils.h \
+ src/map/../common/timer.h src/map/../common/sanity.h \
+ src/map/../common/db.h src/map/storage.h src/map/intif.h \
+ src/map/magic-interpreter.h src/map/../common/nullpo.h src/map/battle.h \
+ src/map/chat.h src/map/chrif.h src/map/itemdb.h src/map/mob.h \
+ src/map/npc.h src/map/pc.h src/map/party.h src/map/script.h \
+ src/map/skill.h src/map/trade.h src/map/../common/socket.h \
+ src/map/magic-expr.h src/map/magic-interpreter-aux.h
+${BUILD_DIR}/map/pc.o: src/map/pc.c src/map/../common/socket.h \
+ src/map/../common/sanity.h src/map/../common/timer.h \
+ src/map/../common/db.h src/map/../common/nullpo.h \
+ src/map/../common/mt_rand.h src/map/atcommand.h src/map/map.h \
+ src/map/../common/mmo.h src/map/../common/utils.h src/map/battle.h \
+ src/map/chat.h src/map/chrif.h src/map/clif.h src/map/storage.h \
+ src/map/guild.h src/map/intif.h src/map/itemdb.h src/map/mob.h \
+ src/map/npc.h src/map/party.h src/map/pc.h src/map/script.h \
+ src/map/skill.h src/map/magic.h src/map/trade.h
+${BUILD_DIR}/map/tmw.o: src/map/tmw.c src/map/tmw.h src/map/map.h \
+ src/map/../common/mmo.h src/map/../common/utils.h \
+ src/map/../common/timer.h src/map/../common/sanity.h \
+ src/map/../common/db.h src/map/../common/socket.h \
+ src/map/../common/version.h src/map/../common/nullpo.h \
+ src/map/atcommand.h src/map/battle.h src/map/chat.h src/map/chrif.h \
+ src/map/clif.h src/map/storage.h src/map/guild.h src/map/intif.h \
+ src/map/itemdb.h src/map/magic.h src/map/mob.h src/map/npc.h \
+ src/map/party.h src/map/pc.h src/map/script.h src/map/skill.h \
+ src/map/trade.h
+${BUILD_DIR}/map/intif.o: src/map/intif.c src/map/../common/nullpo.h \
+ src/map/../common/sanity.h src/map/../common/socket.h \
+ src/map/../common/timer.h src/map/battle.h src/map/chrif.h \
+ src/map/clif.h src/map/map.h src/map/../common/mmo.h \
+ src/map/../common/utils.h src/map/../common/db.h src/map/storage.h \
+ src/map/guild.h src/map/intif.h src/map/party.h src/map/pc.h
+${BUILD_DIR}/map/magic-expr.o: src/map/magic-expr.c src/map/magic-expr.h \
+ src/map/magic-interpreter.h src/map/../common/nullpo.h \
+ src/map/../common/sanity.h src/map/battle.h src/map/chat.h src/map/map.h \
+ src/map/../common/mmo.h src/map/../common/utils.h \
+ src/map/../common/timer.h src/map/../common/db.h src/map/chrif.h \
+ src/map/clif.h src/map/storage.h src/map/intif.h src/map/itemdb.h \
+ src/map/magic.h src/map/mob.h src/map/npc.h src/map/pc.h src/map/party.h \
+ src/map/script.h src/map/skill.h src/map/trade.h \
+ src/map/../common/socket.h src/map/magic-interpreter-aux.h \
+ src/map/magic-expr-eval.h src/map/../common/mt_rand.h
+${BUILD_DIR}/map/battle.o: src/map/battle.c src/map/battle.h \
+ src/map/../common/timer.h src/map/../common/sanity.h \
+ src/map/../common/nullpo.h src/map/clif.h src/map/map.h \
+ src/map/../common/mmo.h src/map/../common/utils.h src/map/../common/db.h \
+ src/map/storage.h src/map/guild.h src/map/itemdb.h src/map/mob.h \
+ src/map/pc.h src/map/skill.h src/map/magic.h src/map/intif.h \
+ src/map/../common/socket.h src/map/../common/mt_rand.h
+${BUILD_DIR}/map/script.o: src/map/script.c src/map/../common/socket.h \
+ src/map/../common/sanity.h src/map/../common/timer.h \
+ src/map/../common/lock.h src/map/../common/mt_rand.h src/map/atcommand.h \
+ src/map/map.h src/map/../common/mmo.h src/map/../common/utils.h \
+ src/map/../common/db.h src/map/battle.h src/map/chat.h src/map/chrif.h \
+ src/map/clif.h src/map/storage.h src/map/guild.h src/map/intif.h \
+ src/map/itemdb.h src/map/mob.h src/map/npc.h src/map/party.h \
+ src/map/pc.h src/map/script.h src/map/skill.h src/map/magic.h
+${BUILD_DIR}/map/clif.o: src/map/clif.c src/map/../common/socket.h \
+ src/map/../common/sanity.h src/map/../common/timer.h \
+ src/map/../common/version.h src/map/../common/nullpo.h \
+ src/map/../common/md5calc.h src/map/../common/mt_rand.h \
+ src/map/atcommand.h src/map/map.h src/map/../common/mmo.h \
+ src/map/../common/utils.h src/map/../common/db.h src/map/battle.h \
+ src/map/chat.h src/map/chrif.h src/map/clif.h src/map/storage.h \
+ src/map/guild.h src/map/intif.h src/map/itemdb.h src/map/magic.h \
+ src/map/mob.h src/map/npc.h src/map/party.h src/map/pc.h \
+ src/map/script.h src/map/skill.h src/map/tmw.h src/map/trade.h
+${BUILD_DIR}/map/chrif.o: src/map/chrif.c src/map/../common/socket.h \
+ src/map/../common/sanity.h src/map/../common/timer.h src/map/map.h \
+ src/map/../common/mmo.h src/map/../common/utils.h src/map/../common/db.h \
+ src/map/battle.h src/map/chrif.h src/map/clif.h src/map/storage.h \
+ src/map/intif.h src/map/npc.h src/map/pc.h src/map/../common/nullpo.h \
+ src/map/itemdb.h
+${BUILD_DIR}/map/atcommand.o: src/map/atcommand.c \
+ src/map/../common/socket.h src/map/../common/sanity.h \
+ src/map/../common/timer.h src/map/../common/nullpo.h \
+ src/map/../common/mt_rand.h src/map/atcommand.h src/map/map.h \
+ src/map/../common/mmo.h src/map/../common/utils.h src/map/../common/db.h \
+ src/map/battle.h src/map/clif.h src/map/storage.h src/map/chrif.h \
+ src/map/guild.h src/map/intif.h src/map/itemdb.h src/map/mob.h \
+ src/map/npc.h src/map/pc.h src/map/party.h src/map/script.h \
+ src/map/skill.h src/map/magic.h src/map/trade.h src/map/../common/core.h \
+ src/map/tmw.h
+${BUILD_DIR}/map/map.o: src/map/map.c src/map/../common/core.h \
+ src/map/../common/timer.h src/map/../common/sanity.h \
+ src/map/../common/db.h src/map/../common/grfio.h \
+ src/map/../common/mt_rand.h src/map/map.h src/map/../common/mmo.h \
+ src/map/../common/utils.h src/map/chrif.h src/map/clif.h \
+ src/map/storage.h src/map/intif.h src/map/npc.h src/map/pc.h \
+ src/map/mob.h src/map/chat.h src/map/itemdb.h src/map/skill.h \
+ src/map/magic.h src/map/trade.h src/map/party.h src/map/battle.h \
+ src/map/script.h src/map/guild.h src/map/atcommand.h \
+ src/map/../common/nullpo.h src/map/../common/socket.h
+${BUILD_DIR}/ladmin/ladmin.o: src/ladmin/ladmin.c \
+ src/ladmin/../common/core.h src/ladmin/../common/socket.h \
+ src/ladmin/../common/sanity.h src/ladmin/ladmin.h \
+ src/ladmin/../common/version.h src/ladmin/../common/mmo.h \
+ src/ladmin/../common/utils.h src/ladmin/../common/md5calc.h
diff --git a/make.defs b/make.defs
index 6f648e3..debf3aa 100644
--- a/make.defs
+++ b/make.defs
@@ -1,20 +1,15 @@
# defaults
CC = gcc
-CFLAGS = -pipe -g -fno-strict-aliasing -Wall -Wextra -Werror=all -Werror=implicit-function-declaration
-CP = cp -f
-# The below might cause problems sometimes
-# CP = cp -lf
-# CP = cp -sf
+BISON = bison
+CFLAGS = -pipe -g @warnings
# works on both x86 and x86_64
override CC += -m32 -std=gnu99
+# TODO check if this is actually needed - I don't think it should be
ifeq ($(findstring CYGWIN,$(shell uname)), CYGWIN)
override CFLAGS += -DFD_SETSIZE=4096 -DCYGWIN
else
override CFLAGS += -fstack-protector
endif
-# The default recipe is suboptimal
-%.c: %.l
- $(LEX) -o $@ $<
diff --git a/src/char/GNUmakefile b/src/char/GNUmakefile
new file mode 100644
index 0000000..cd7ad57
--- /dev/null
+++ b/src/char/GNUmakefile
@@ -0,0 +1,7 @@
+.SUFFIXES:
+all:
+ make -C ../.. char-server
+clean:
+ rm -r ../../obj/char/
+%::
+ make -C ../.. obj/char/$@
diff --git a/src/char/Makefile b/src/char/Makefile
deleted file mode 100644
index c448627..0000000
--- a/src/char/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-include ../../make.defs
-
-all: char
-
-COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/lock.o ../common/mt_rand.o
-COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/db.h ../common/lock.h ../common/timer.h ../common/mt_rand.h
-char: char.o inter.o int_party.o int_guild.o int_storage.o $(COMMON_OBJ)
-
-char.o: char.c char.h inter.h $(COMMON_H) ../common/version.h
-inter.o: inter.c inter.h int_party.h int_guild.h int_storage.h char.h $(COMMON_H)
-int_party.o: int_party.c int_party.h inter.h char.h $(COMMON_H)
-int_guild.o: int_guild.c int_guild.h int_storage.h inter.h char.h $(COMMON_H)
-int_storage.o: int_storage.c int_storage.h int_guild.h inter.h char.h $(COMMON_H)
-
-clean:
- rm -f *.o char
diff --git a/src/common/GNUmakefile b/src/common/GNUmakefile
new file mode 100644
index 0000000..555f81e
--- /dev/null
+++ b/src/common/GNUmakefile
@@ -0,0 +1,7 @@
+.SUFFIXES:
+all:
+ make -C ../.. common
+clean:
+ rm -r ../../obj/common/
+%::
+ make -C ../.. obj/common/$@
diff --git a/src/common/Makefile b/src/common/Makefile
deleted file mode 100644
index 43552dc..0000000
--- a/src/common/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-include ../../make.defs
-all: core.o socket.o timer.o grfio.o db.o lock.o nullpo.o mt_rand.o md5calc.o
-
-core.o: core.c core.h
-socket.o: socket.c socket.h mmo.h
-timer.o: timer.c timer.h
-grfio.o: grfio.c grfio.h
-db.o: db.c db.h
-lock.o: lock.c lock.h
-nullpo.o: nullpo.c nullpo.h
-mt_rand.o: mt_rand.c mt_rand.h
-md5calc.o: md5calc.c md5calc.h
-
-clean:
- rm -f *.o
diff --git a/src/ladmin/GNUmakefile b/src/ladmin/GNUmakefile
new file mode 100644
index 0000000..1461bcf
--- /dev/null
+++ b/src/ladmin/GNUmakefile
@@ -0,0 +1,7 @@
+.SUFFIXES:
+all:
+ make -C ../.. ladmin
+clean:
+ rm -r ../../obj/ladmin/
+%::
+ make -C ../.. obj/ladmin/$@
diff --git a/src/ladmin/Makefile b/src/ladmin/Makefile
deleted file mode 100644
index 4b4d2ec..0000000
--- a/src/ladmin/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../make.defs
-
-all: ladmin
-
-COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/mt_rand.o
-COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h ../common/db.h ../common/mt_rand.h
-
-ladmin: ladmin.o ../common/md5calc.o $(COMMON_OBJ)
-ladmin.o: ladmin.c ladmin.h ../common/md5calc.h $(COMMON_H)
-
-clean:
- rm -f *.o ladmin
diff --git a/src/login/GNUmakefile b/src/login/GNUmakefile
new file mode 100644
index 0000000..912127d
--- /dev/null
+++ b/src/login/GNUmakefile
@@ -0,0 +1,7 @@
+.SUFFIXES:
+all:
+ make -C ../.. login-server
+clean:
+ rm -r ../../obj/login/
+%::
+ make -C ../.. obj/login/$@
diff --git a/src/login/Makefile b/src/login/Makefile
deleted file mode 100644
index bc1e7c0..0000000
--- a/src/login/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../make.defs
-
-all: login
-
-COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/lock.o ../common/mt_rand.o ../common/md5calc.o
-COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h ../common/db.h ../common/lock.h ../common/mt_rand.h ../common/md5calc.h
-
-login: $(COMMON_OBJ)
-login.o: login.c login.h $(COMMON_H)
-
-clean:
- rm -f *.o login
diff --git a/src/map/GNUmakefile b/src/map/GNUmakefile
new file mode 100644
index 0000000..a02deda
--- /dev/null
+++ b/src/map/GNUmakefile
@@ -0,0 +1,7 @@
+.SUFFIXES:
+all:
+ make -C ../.. map-server
+clean:
+ rm -r ../../obj/map/
+%::
+ make -C ../.. obj/map/$@
diff --git a/src/map/Makefile b/src/map/Makefile
deleted file mode 100644
index d340015..0000000
--- a/src/map/Makefile
+++ /dev/null
@@ -1,51 +0,0 @@
-include ../../make.defs
-
-all: map
-
-obj:
- mkdir obj
-
-COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/grfio.o ../common/db.o ../common/lock.o ../common/nullpo.o ../common/mt_rand.o ../common/md5calc.o
-LDLIBS = -lm
-
-map: obj/tmw.o obj/magic-interpreter-lexer.o obj/magic-interpreter-parser.o obj/magic-interpreter-base.o obj/magic-expr.o obj/magic-stmt.o obj/magic.o obj/map.o obj/chrif.o obj/clif.o obj/pc.o obj/npc.o obj/chat.o obj/path.o obj/itemdb.o obj/mob.o obj/script.o obj/storage.o obj/skill.o obj/skill-pools.o obj/atcommand.o obj/battle.o obj/intif.o obj/trade.o obj/party.o obj/guild.o $(COMMON_OBJ)
- ${LINK.c} $^ ${LDLIBS} -o $@
-obj/%.o: %.c | obj
- ${COMPILE.c} $< -o $@
-
-magic-interpreter-lexer.c: magic-interpreter-lexer.l
-magic-interpreter-parser.c magic-interpreter-parser.h: magic-interpreter-parser.y
-#The builtin yacc rule is insufficient, (but yacc can be used in place of bison)
- ${YACC} $^ -d -o magic-interpreter-parser.c
-
-obj/magic-interpreter-lexer.o: magic-interpreter-lexer.c magic-interpreter-parser.h magic-expr.h magic-interpreter.h chrif.h clif.h npc.h pc.h mob.h chat.h skill.h itemdb.h storage.h party.h atcommand.h ../common/core.h ../common/timer.h ../common/db.h ../common/grfio.h ../common/mmo.h
-obj/magic-interpreter-parser.o: magic-interpreter-parser.c magic-expr.h magic-interpreter.h chrif.h clif.h npc.h pc.h mob.h chat.h skill.h itemdb.h storage.h party.h atcommand.h ../common/core.h ../common/timer.h ../common/db.h ../common/grfio.h ../common/mmo.h
-obj/magic-interpreter-base.o: magic-interpreter-base.c magic-expr-eval.h magic-interpreter-aux.h magic-expr.h magic-interpreter.h chrif.h clif.h npc.h pc.h mob.h chat.h skill.h itemdb.h storage.h party.h atcommand.h ../common/core.h ../common/timer.h ../common/db.h ../common/grfio.h ../common/mmo.h
-obj/magic-expr.o: magic-expr.c magic-expr-eval.h magic-interpreter-aux.h magic-expr.h magic-interpreter.h chrif.h clif.h npc.h pc.h mob.h chat.h skill.h itemdb.h storage.h party.h atcommand.h ../common/core.h ../common/timer.h ../common/db.h ../common/grfio.h ../common/mmo.h
-obj/magic-stmt.o: magic-stmt.c magic-expr-eval.h magic-interpreter-aux.h magic-expr.h magic-interpreter.h chrif.h clif.h npc.h pc.h mob.h chat.h skill.h itemdb.h storage.h party.h atcommand.h ../common/core.h ../common/timer.h ../common/db.h ../common/grfio.h ../common/mmo.h
-obj/magic.o: magic.c magic.h magic-expr.h magic-interpreter.h chrif.h clif.h npc.h pc.h mob.h chat.h skill.h itemdb.h storage.h party.h atcommand.h ../common/core.h ../common/timer.h ../common/db.h ../common/grfio.h ../common/mmo.h
-obj/map.o: map.c map.h chrif.h clif.h npc.h pc.h mob.h chat.h skill.h itemdb.h storage.h party.h atcommand.h ../common/core.h ../common/timer.h ../common/db.h ../common/grfio.h ../common/mmo.h
-obj/chrif.o: chrif.c map.h battle.h chrif.h clif.h intif.h pc.h npc.h ../common/socket.h ../common/timer.h ../common/mmo.h
-obj/clif.o: magic.h clif.c map.h chrif.h clif.h mob.h intif.h pc.h npc.h itemdb.h chat.h script.h storage.h party.h guild.h atcommand.h atcommand.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h tmw.h
-obj/pc.o: pc.c map.h clif.h intif.h pc.h npc.h mob.h itemdb.h battle.h skill.h script.h party.h guild.h trade.h storage.h chat.h ../common/timer.h ../common/mmo.h ../common/db.h
-obj/npc.o: npc.c map.h npc.h clif.h pc.h script.h mob.h itemdb.h battle.h ../common/db.h ../common/timer.h ../common/mmo.h
-obj/chat.o: chat.c map.h clif.h pc.h chat.h ../common/db.h ../common/mmo.h
-obj/path.o: path.c map.h battle.h ../common/mmo.h
-obj/itemdb.o: itemdb.c map.h battle.h itemdb.h ../common/db.h ../common/grfio.h ../common/mmo.h
-obj/mob.o: mob.c map.h clif.h intif.h pc.h mob.h skill.h battle.h npc.h itemdb.h ../common/timer.h ../common/socket.h ../common/mmo.h
-obj/script.o: script.c itemdb.h map.h pc.h mob.h clif.h intif.h npc.h script.h storage.h skill.h battle.h ../common/timer.h ../common/socket.h ../common/db.h ../common/mmo.h ../common/lock.h
-obj/storage.o: storage.c itemdb.h pc.h clif.h intif.h storage.h guild.h ../common/mmo.h ../common/db.h
-obj/skill.o: skill.c skill.h map.h clif.h pc.h mob.h battle.h itemdb.h script.h ../common/timer.h ../common/mmo.h
-obj/skill-pools.o: skill-pools.c skill.h map.h clif.h pc.h mob.h battle.h itemdb.h script.h ../common/timer.h ../common/mmo.h
-obj/atcommand.o: atcommand.c atcommand.h itemdb.h pc.h map.h skill.h clif.h mob.h intif.h battle.h storage.h guild.h ../common/socket.h ../common/timer.h ../common/mmo.h
-obj/battle.o: battle.c battle.h skill.h map.h mob.h pc.h guild.h ../common/timer.h ../common/mmo.h
-obj/intif.o: intif.c intif.h chrif.h clif.h party.h guild.h storage.h map.h battle.h ../common/socket.h ../common/mmo.h
-obj/trade.o: trade.c trade.h clif.h itemdb.h map.h pc.h npc.h ../common/mmo.h
-obj/party.o: party.c party.h clif.h intif.h pc.h map.h battle.h ../common/db.h ../common/socket.h ../common/timer.h ../common/mmo.h
-obj/tmw.o: tmw.c tmw.h map.h clif.h
-obj/guild.o: guild.c guild.h storage.h ../common/mmo.h ../common/utils.h \
- ../common/mt_rand.h ../common/timer.h ../common/socket.h \
- ../common/nullpo.h battle.h npc.h pc.h map.h mob.h intif.h clif.h tmw.h
-
-clean:
- rm -rf *.o map obj magic-interpreter-parser.c magic-interpreter-parser.h magic-interpreter-lexer.c
diff --git a/src/tool/GNUmakefile b/src/tool/GNUmakefile
new file mode 100644
index 0000000..2efc93b
--- /dev/null
+++ b/src/tool/GNUmakefile
@@ -0,0 +1,7 @@
+.SUFFIXES:
+all:
+ make -C ../.. tools
+clean:
+ rm -r ../../obj/tool/
+%::
+ make -C ../.. obj/tool/$@
diff --git a/src/tool/Makefile b/src/tool/Makefile
deleted file mode 100644
index 8d51c25..0000000
--- a/src/tool/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-include ../../make.defs
-
-OBJS =../common/timer.o ../common/socket.o ../common/db.o ../common/lock.o ../char/inter.o ../char/int_guild.o ../char/int_party.o ../char/int_storage.o
-all: adduser itemfrob mapfrob marriage-info eathena-monitor
-adduser: adduser.o ../common/socket.o
-
-itemfrob: itemfrob.o ${OBJS}
-mapfrob: mapfrob.o ${OBJS}
-marriage-info: marriage-info.o ${OBJS}
-eathena-monitor: eathena-monitor.c
-
-clean:
- rm -f adduser itemfrob mapfrob marriage-info eathena-monitor
- rm -f *.exe
- rm -f *.o
diff --git a/src/tool/moneycount/Makefile b/src/tool/moneycount/Makefile
deleted file mode 100644
index e7b7022..0000000
--- a/src/tool/moneycount/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-all: moneycount
-
-OBJECTS = main.o athena_text.o inf.o portability_fixes.o
-CPP = g++
-
-moneycount: $(OBJECTS)
- $(CPP) -o $@ $(OBJECTS) $(COMMON_OBJS) $(LIBS)
-main.o: main.cpp
-athena_text.o: athena_text.cpp athena_text.h
-inf.o: inf.cpp inf.hpp
-portability_fixes.o: portability_fixes.cpp portability_fixes.hpp portability_exceptions.hpp
-
-clean:
- rm -f *.o moneycount
diff --git a/src/webserver/GNUmakefile b/src/webserver/GNUmakefile
new file mode 100644
index 0000000..9635381
--- /dev/null
+++ b/src/webserver/GNUmakefile
@@ -0,0 +1,7 @@
+.SUFFIXES:
+all:
+ make -C ../.. webserver
+clean:
+ rm -r ../../obj/webserver/
+%::
+ make -C ../.. obj/webserver/$@
diff --git a/src/webserver/Makefile b/src/webserver/Makefile
deleted file mode 100644
index 5bfa83f..0000000
--- a/src/webserver/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-include ../../make.defs
-
-OBJ = main.o parse.o generate.o htmlstyle.o logs.o pages/about.o pages/sample.o pages/notdone.o
-all: webserver
-webserver: ${OBJ}
- ${CC} ${CFLAGS} -o $@ ${OBJ}
-
-
-
-
-clean:
- rm -f *.o
- rm -f pages/*.o
- rm -f webserver
-
diff --git a/warnings b/warnings
new file mode 100644
index 0000000..68be903
--- /dev/null
+++ b/warnings
@@ -0,0 +1,29 @@
+-Werror=all
+-Werror=implicit-function-declaration
+-Wextra
+-Werror=c++-compat
+-Werror=write-strings
+-Wunused
+-Wshadow
+-Wbad-function-cast
+-Werror=strict-prototypes
+-Werror=old-style-definition
+-Wno-missing-declarations
+-Wvla
+-Wstack-protector
+-Wno-conversion
+-Wlogical-op
+-Wformat=2
+-Winit-self
+-Wmissing-include-dirs
+-Wsuggest-attribute=pure
+-Wsuggest-attribute=const
+-Wsuggest-attribute=noreturn
+-Wtrampolines
+-Wfloat-equal
+-Wmissing-format-attribute
+-Wno-redundant-decls
+-Wnested-externs
+-Wno-sign-compare
+
+-Wno-switch