summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2011-03-16 00:38:02 -0700
committerBen Longbons <b.r.longbons@gmail.com>2011-03-16 09:02:18 -0700
commite49bce26d3de1a5c2afbe018a869ff8790294fc5 (patch)
treeb01ec81aa67181812303afd4e51bc759bba2a384 /src
parent3f0ce47e23fa226b30a4322660b8aab3e74d5240 (diff)
downloadtmwa-e49bce26d3de1a5c2afbe018a869ff8790294fc5.tar.gz
tmwa-e49bce26d3de1a5c2afbe018a869ff8790294fc5.tar.bz2
tmwa-e49bce26d3de1a5c2afbe018a869ff8790294fc5.tar.xz
tmwa-e49bce26d3de1a5c2afbe018a869ff8790294fc5.zip
Use makefiles correctly and expand include dirs
Diffstat (limited to 'src')
-rw-r--r--src/char/Makefile9
-rw-r--r--src/char/char.c12
-rw-r--r--src/char/int_guild.c8
-rw-r--r--src/char/int_party.c8
-rw-r--r--src/char/inter.c10
-rw-r--r--src/common/Makefile2
-rw-r--r--src/ladmin/Makefile3
-rw-r--r--src/ladmin/ladmin.c8
-rw-r--r--src/ladmin/md5calc.c2
-rw-r--r--src/login/Makefile9
-rw-r--r--src/login/login.c18
-rw-r--r--src/map/Makefile29
-rw-r--r--src/map/atcommand.c8
-rw-r--r--src/map/battle.c8
-rw-r--r--src/map/chat.c6
-rw-r--r--src/map/chrif.c6
-rw-r--r--src/map/clif.c12
-rw-r--r--src/map/guild.c10
-rw-r--r--src/map/intif.c6
-rw-r--r--src/map/itemdb.c8
-rw-r--r--src/map/magic-interpreter-lexer.l (renamed from src/map/magic-interpreter.l)0
-rw-r--r--src/map/magic-interpreter-parser.y2
-rw-r--r--src/map/magic-interpreter.h4
-rw-r--r--src/map/map.c14
-rw-r--r--src/map/map.h2
-rw-r--r--src/map/mob.c10
-rw-r--r--src/map/npc.c8
-rw-r--r--src/map/party.c10
-rw-r--r--src/map/path.c2
-rw-r--r--src/map/pc.c10
-rw-r--r--src/map/script.c12
-rw-r--r--src/map/skill-pools.c6
-rw-r--r--src/map/skill.c6
-rw-r--r--src/map/tmw.c10
-rw-r--r--src/map/trade.c2
-rw-r--r--src/tool/Makefile21
-rw-r--r--src/tool/adduser.c8
-rw-r--r--src/tool/marriage-info.c6
-rw-r--r--src/webserver/Makefile19
39 files changed, 161 insertions, 173 deletions
diff --git a/src/char/Makefile b/src/char/Makefile
index 5eb4b51..6f2e4af 100644
--- a/src/char/Makefile
+++ b/src/char/Makefile
@@ -1,12 +1,11 @@
include ../../make.defs
-all: char-server
-txt: char-server
+all: txt
+txt: char
COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/lock.o ../common/malloc.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/malloc.h ../common/mt_rand.h
-char-server: char.o inter.o int_party.o int_guild.o int_storage.o $(COMMON_OBJ)
- $(CC) $(CFLAGS) -o ../../$@ $^
+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)
@@ -15,4 +14,4 @@ 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-server
+ rm -f *.o char
diff --git a/src/char/char.c b/src/char/char.c
index 07b1fb6..f4a91bd 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -18,12 +18,12 @@
#include <stdarg.h>
#include <sys/wait.h>
-#include "core.h"
-#include "socket.h"
-#include "timer.h"
-#include "mmo.h"
-#include "version.h"
-#include "lock.h"
+#include "../common/core.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
+#include "../common/mmo.h"
+#include "../common/version.h"
+#include "../common/lock.h"
#include "char.h"
#include "inter.h"
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 5b4fe30..e145b66 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -2,11 +2,11 @@
#include "inter.h"
#include "int_guild.h"
#include "int_storage.h"
-#include "mmo.h"
+#include "../common/mmo.h"
#include "char.h"
-#include "socket.h"
-#include "db.h"
-#include "lock.h"
+#include "../common/socket.h"
+#include "../common/db.h"
+#include "../common/lock.h"
#include <string.h>
#include <stdio.h>
diff --git a/src/char/int_party.c b/src/char/int_party.c
index c501c74..c5ed033 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -1,11 +1,11 @@
// $Id: int_party.c,v 1.1.1.1 2004/09/10 17:26:51 MagicalTux Exp $
#include "inter.h"
#include "int_party.h"
-#include "mmo.h"
+#include "../common/mmo.h"
#include "char.h"
-#include "socket.h"
-#include "db.h"
-#include "lock.h"
+#include "../common/socket.h"
+#include "../common/db.h"
+#include "../common/lock.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/char/inter.c b/src/char/inter.c
index 89a3e39..5bee90f 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -1,9 +1,9 @@
// $Id: inter.c,v 1.1.1.1 2004/09/10 17:26:51 MagicalTux Exp $
-#include "mmo.h"
+#include "../common/mmo.h"
#include "char.h"
-#include "socket.h"
-#include "timer.h"
-#include "db.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
+#include "../common/db.h"
#include <string.h>
#include <stdlib.h>
@@ -11,7 +11,7 @@
#include "int_party.h"
#include "int_guild.h"
#include "int_storage.h"
-#include "lock.h"
+#include "../common/lock.h"
#define WISDATA_TTL (60*1000) // Existence time of Wisp/page data (60 seconds)
// that is the waiting time of answers of all map-servers
diff --git a/src/common/Makefile b/src/common/Makefile
index 27930bd..48e75d8 100644
--- a/src/common/Makefile
+++ b/src/common/Makefile
@@ -1,5 +1,5 @@
include ../../make.defs
-txt sql all: core.o socket.o timer.o grfio.o db.o lock.o nullpo.o malloc.o mt_rand.o md5calc.o
+all txt sql: core.o socket.o timer.o grfio.o db.o lock.o nullpo.o malloc.o mt_rand.o md5calc.o
core.o: core.c core.h
socket.o: socket.c socket.h mmo.h
diff --git a/src/ladmin/Makefile b/src/ladmin/Makefile
index 3221901..9199951 100644
--- a/src/ladmin/Makefile
+++ b/src/ladmin/Makefile
@@ -8,9 +8,8 @@ COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.
COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h ../common/db.h ../common/malloc.h ../common/mt_rand.h
ladmin: ladmin.o md5calc.o $(COMMON_OBJ)
- $(CC) -o ../../$@ ladmin.o md5calc.o $(COMMON_OBJ)
ladmin.o: ladmin.c ladmin.h md5calc.h $(COMMON_H)
md5calc.o: md5calc.c md5calc.h
clean:
- rm -f *.o ../../ladmin
+ rm -f *.o ladmin
diff --git a/src/ladmin/ladmin.c b/src/ladmin/ladmin.c
index 5ef9b6c..d7f4f5f 100644
--- a/src/ladmin/ladmin.c
+++ b/src/ladmin/ladmin.c
@@ -22,11 +22,11 @@
#include <stdarg.h> // valist
#include <ctype.h> // tolower
-#include "core.h"
-#include "socket.h"
+#include "../common/core.h"
+#include "../common/socket.h"
#include "ladmin.h"
-#include "version.h"
-#include "mmo.h"
+#include "../common/version.h"
+#include "../common/mmo.h"
#ifdef PASSWORDENC
#include "md5calc.h"
diff --git a/src/ladmin/md5calc.c b/src/ladmin/md5calc.c
index cf9d958..ec1d8ec 100644
--- a/src/ladmin/md5calc.c
+++ b/src/ladmin/md5calc.c
@@ -10,7 +10,7 @@
#include "md5calc.h"
#include <string.h>
#include <stdio.h>
-#include "mt_rand.h"
+#include "../common/mt_rand.h"
#ifndef UINT_MAX
#define UINT_MAX 4294967295U
diff --git a/src/login/Makefile b/src/login/Makefile
index 32e14d7..185cffb 100644
--- a/src/login/Makefile
+++ b/src/login/Makefile
@@ -1,14 +1,13 @@
include ../../make.defs
-all: login-server
-txt: login-server
+all: txt
+txt: login
COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/lock.o ../common/malloc.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/malloc.h ../common/mt_rand.h ../common/md5calc.h
-login-server: login.o $(COMMON_OBJ)
- $(CC) $(CFLAGS) -o ../../$@ login.o $(COMMON_OBJ)
+login: $(COMMON_OBJ)
login.o: login.c login.h $(COMMON_H)
clean:
- rm -f *.o ../../login-server
+ rm -f *.o login
diff --git a/src/login/login.c b/src/login/login.c
index 1db85ad..480533e 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -18,17 +18,17 @@
#include <netdb.h>
#include <sys/wait.h>
-#include "core.h"
-#include "socket.h"
-#include "timer.h"
+#include "../common/core.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
#include "login.h"
-#include "mmo.h"
-#include "version.h"
-#include "db.h"
-#include "lock.h"
-#include "mt_rand.h"
+#include "../common/mmo.h"
+#include "../common/version.h"
+#include "../common/db.h"
+#include "../common/lock.h"
+#include "../common/mt_rand.h"
-#include "md5calc.h"
+#include "../common/md5calc.h"
#ifdef MEMWATCH
#include "memwatch.h"
diff --git a/src/map/Makefile b/src/map/Makefile
index a1a4381..c7c982e 100644
--- a/src/map/Makefile
+++ b/src/map/Makefile
@@ -2,27 +2,25 @@ include ../../make.defs
all: txt
-txt: obj map-server
+txt: 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/malloc.o ../common/mt_rand.o ../common/md5calc.o
-LIBS = -lz -lm
+LDLIBS = -lz -lm
-map-server: 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)
- $(CC) -o ../../$@ $^ $(LIBS)
+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 $@
-obj/%.o: %.c
- $(COMPILE.c) $(OUTPUT_OPTION) $<
+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
-magic-interpreter-lexer.c: magic-interpreter.l
- $(LEX) -o magic-interpreter-lexer.c magic-interpreter.l
-
-magic-interpreter-parser.c: magic-interpreter-parser.y
- $(BISON) -v -d -o magic-interpreter-parser.c magic-interpreter-parser.y
-
-obj/magic-interpreter-lexer.o: magic-interpreter-lexer.c 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-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
@@ -47,6 +45,9 @@ obj/intif.o: intif.c intif.h chrif.h clif.h party.h guild.h storage.h map.h batt
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-server obj
+ rm -rf *.o map obj magic-interpreter-parser.c magic-interpreter-parser.h magic-interpreter-lexer.c
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 681cccf..cb9e93c 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -10,9 +10,9 @@
#include <time.h>
#include <unistd.h>
-#include "socket.h"
-#include "timer.h"
-#include "nullpo.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
+#include "../common/nullpo.h"
#include "atcommand.h"
#include "battle.h"
@@ -30,7 +30,7 @@
#include "skill.h"
#include "trade.h"
-#include "core.h"
+#include "../common/core.h"
#include "tmw.h"
#define STATE_BLIND 0x10
diff --git a/src/map/battle.c b/src/map/battle.c
index f81aaf0..c9e341d 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -6,9 +6,9 @@
#include "battle.h"
-#include "timer.h"
-#include "nullpo.h"
-#include "malloc.h"
+#include "../common/timer.h"
+#include "../common/nullpo.h"
+#include "../common/malloc.h"
#include "clif.h"
#include "guild.h"
@@ -18,7 +18,7 @@
#include "pc.h"
#include "skill.h"
#include "../common/socket.h"
-#include "mt_rand.h"
+#include "../common/mt_rand.h"
#ifdef MEMWATCH
#include "memwatch.h"
diff --git a/src/map/chat.c b/src/map/chat.c
index 772ac4c..0163eed 100644
--- a/src/map/chat.c
+++ b/src/map/chat.c
@@ -3,9 +3,9 @@
#include <stdlib.h>
#include <string.h>
-#include "db.h"
-#include "nullpo.h"
-#include "malloc.h"
+#include "../common/db.h"
+#include "../common/nullpo.h"
+#include "../common/malloc.h"
#include "map.h"
#include "clif.h"
#include "pc.h"
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 4bcfa45..8bbeb59 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -13,8 +13,8 @@
#include <sys/types.h>
#include <time.h>
-#include "socket.h"
-#include "timer.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
#include "map.h"
#include "battle.h"
#include "chrif.h"
@@ -22,7 +22,7 @@
#include "intif.h"
#include "npc.h"
#include "pc.h"
-#include "nullpo.h"
+#include "../common/nullpo.h"
#include "itemdb.h"
#ifdef MEMWATCH
diff --git a/src/map/clif.c b/src/map/clif.c
index ce79490..d630815 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -18,12 +18,12 @@
#endif
#include <time.h>
-#include "socket.h"
-#include "timer.h"
-#include "malloc.h"
-#include "version.h"
-#include "nullpo.h"
-#include "md5calc.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
+#include "../common/malloc.h"
+#include "../common/version.h"
+#include "../common/nullpo.h"
+#include "../common/md5calc.h"
#include "atcommand.h"
#include "battle.h"
diff --git a/src/map/guild.c b/src/map/guild.c
index 1d328ea..4a7552a 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -5,11 +5,11 @@
#include "guild.h"
#include "storage.h"
-#include "db.h"
-#include "timer.h"
-#include "socket.h"
-#include "nullpo.h"
-#include "malloc.h"
+#include "../common/db.h"
+#include "../common/timer.h"
+#include "../common/socket.h"
+#include "../common/nullpo.h"
+#include "../common/malloc.h"
#include "battle.h"
#include "npc.h"
#include "pc.h"
diff --git a/src/map/intif.c b/src/map/intif.c
index efde695..629eade 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -18,9 +18,9 @@
#include <fcntl.h>
#include <string.h>
-#include "nullpo.h"
-#include "socket.h"
-#include "timer.h"
+#include "../common/nullpo.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
#include "battle.h"
#include "chrif.h"
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index d589e35..dfa3d36 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -3,10 +3,10 @@
#include <stdlib.h>
#include <string.h>
-#include "db.h"
-#include "grfio.h"
-#include "nullpo.h"
-#include "malloc.h"
+#include "../common/db.h"
+#include "../common/grfio.h"
+#include "../common/nullpo.h"
+#include "../common/malloc.h"
#include "map.h"
#include "battle.h"
#include "itemdb.h"
diff --git a/src/map/magic-interpreter.l b/src/map/magic-interpreter-lexer.l
index 2c9792f..2c9792f 100644
--- a/src/map/magic-interpreter.l
+++ b/src/map/magic-interpreter-lexer.l
diff --git a/src/map/magic-interpreter-parser.y b/src/map/magic-interpreter-parser.y
index 04d5630..8484902 100644
--- a/src/map/magic-interpreter-parser.y
+++ b/src/map/magic-interpreter-parser.y
@@ -409,7 +409,7 @@ expr : value
arg_list : /* empty */
{ $$.args_nr = 0; }
| arg_list_ne
- { $$ = $1 }
+ { $$ = $1; }
;
diff --git a/src/map/magic-interpreter.h b/src/map/magic-interpreter.h
index 7db7d3e..006c8fb 100644
--- a/src/map/magic-interpreter.h
+++ b/src/map/magic-interpreter.h
@@ -8,8 +8,8 @@
#include <string.h>
#include <math.h>
-#include "malloc.h"
-#include "nullpo.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
#include "battle.h"
#include "chat.h"
diff --git a/src/map/map.c b/src/map/map.c
index 57183d1..e1adcef 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -9,11 +9,11 @@
#include <netdb.h>
#endif
-#include "core.h"
-#include "timer.h"
-#include "db.h"
-#include "grfio.h"
-#include "malloc.h"
+#include "../common/core.h"
+#include "../common/timer.h"
+#include "../common/db.h"
+#include "../common/grfio.h"
+#include "../common/malloc.h"
#include "map.h"
#include "chrif.h"
@@ -32,8 +32,8 @@
#include "script.h"
#include "guild.h"
#include "atcommand.h"
-#include "nullpo.h"
-#include "socket.h"
+#include "../common/nullpo.h"
+#include "../common/socket.h"
#include "magic.h"
#ifdef MEMWATCH
diff --git a/src/map/map.h b/src/map/map.h
index 53f6dfc..a558397 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -7,7 +7,7 @@
#include <time.h>
#include <sys/time.h>
#include <netinet/in.h>
-#include "mmo.h"
+#include "../common/mmo.h"
#ifndef MAX
# define MAX(x,y) (((x)>(y)) ? (x) : (y))
diff --git a/src/map/mob.c b/src/map/mob.c
index 7962114..99d1cc2 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -5,11 +5,11 @@
#include <stdarg.h>
#include <string.h>
-#include "timer.h"
-#include "socket.h"
-#include "db.h"
-#include "nullpo.h"
-#include "malloc.h"
+#include "../common/timer.h"
+#include "../common/socket.h"
+#include "../common/db.h"
+#include "../common/nullpo.h"
+#include "../common/malloc.h"
#include "map.h"
#include "clif.h"
#include "intif.h"
diff --git a/src/map/npc.c b/src/map/npc.c
index 0335e9c..5fd8291 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -6,13 +6,13 @@
#include <math.h>
#include <time.h>
-#include "malloc.h"
-#include "nullpo.h"
-#include "timer.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/timer.h"
#include "battle.h"
#include "clif.h"
-#include "db.h"
+#include "../common/db.h"
#include "intif.h"
#include "itemdb.h"
#include "map.h"
diff --git a/src/map/party.c b/src/map/party.c
index f87d390..4e59fae 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -4,11 +4,11 @@
#include <string.h>
#include "party.h"
-#include "db.h"
-#include "timer.h"
-#include "socket.h"
-#include "nullpo.h"
-#include "malloc.h"
+#include "../common/db.h"
+#include "../common/timer.h"
+#include "../common/socket.h"
+#include "../common/nullpo.h"
+#include "../common/malloc.h"
#include "pc.h"
#include "map.h"
#include "battle.h"
diff --git a/src/map/path.c b/src/map/path.c
index 93ce960..7a864ed 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -5,7 +5,7 @@
#include "map.h"
#include "battle.h"
-#include "nullpo.h"
+#include "../common/nullpo.h"
#ifdef MEMWATCH
#include "memwatch.h"
diff --git a/src/map/pc.c b/src/map/pc.c
index fb98bcb..fc2732f 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5,12 +5,12 @@
#include <ctype.h>
#include <time.h>
-#include "socket.h" // [Valaris]
-#include "timer.h"
-#include "db.h"
+#include "../common/socket.h" // [Valaris]
+#include "../common/timer.h"
+#include "../common/db.h"
-#include "malloc.h"
-#include "nullpo.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
#include "atcommand.h"
#include "battle.h"
diff --git a/src/map/script.c b/src/map/script.c
index 27567c3..0c01ac0 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -15,21 +15,21 @@
#include <time.h>
#include <math.h>
-#include "socket.h"
-#include "timer.h"
-#include "malloc.h"
-#include "lock.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
+#include "../common/malloc.h"
+#include "../common/lock.h"
#include "atcommand.h"
#include "battle.h"
#include "chat.h"
#include "chrif.h"
#include "clif.h"
-#include "db.h"
+#include "../common/db.h"
#include "guild.h"
#include "intif.h"
#include "itemdb.h"
-#include "lock.h"
+#include "../common/lock.h"
#include "map.h"
#include "mob.h"
#include "npc.h"
diff --git a/src/map/skill-pools.c b/src/map/skill-pools.c
index d533ae3..50dafcb 100644
--- a/src/map/skill-pools.c
+++ b/src/map/skill-pools.c
@@ -3,9 +3,9 @@
#include <string.h>
#include <time.h>
-#include "timer.h"
-#include "nullpo.h"
-#include "malloc.h"
+#include "../common/timer.h"
+#include "../common/nullpo.h"
+#include "../common/malloc.h"
#include "magic.h"
#include "battle.h"
diff --git a/src/map/skill.c b/src/map/skill.c
index 8a2b6b5..54ff545 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6,9 +6,9 @@
#include <string.h>
#include <time.h>
-#include "timer.h"
-#include "nullpo.h"
-#include "malloc.h"
+#include "../common/timer.h"
+#include "../common/nullpo.h"
+#include "../common/malloc.h"
#include "magic.h"
#include "battle.h"
diff --git a/src/map/tmw.c b/src/map/tmw.c
index a71c93c..c04c9c8 100644
--- a/src/map/tmw.c
+++ b/src/map/tmw.c
@@ -6,11 +6,11 @@
#include "tmw.h"
-#include "socket.h"
-#include "timer.h"
-#include "malloc.h"
-#include "version.h"
-#include "nullpo.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
+#include "../common/malloc.h"
+#include "../common/version.h"
+#include "../common/nullpo.h"
#include "atcommand.h"
#include "battle.h"
diff --git a/src/map/trade.c b/src/map/trade.c
index 664d2fa..ae70f0d 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -9,7 +9,7 @@
#include "npc.h"
#include "battle.h"
#include "storage.h"
-#include "nullpo.h"
+#include "../common/nullpo.h"
/*==========================================
* 取引要請を相手に送る
diff --git a/src/tool/Makefile b/src/tool/Makefile
index 5d37183..87393fb 100644
--- a/src/tool/Makefile
+++ b/src/tool/Makefile
@@ -1,16 +1,17 @@
include ../../make.defs
-BDIR=..
-COBJS=${BDIR}/common/timer.o ${BDIR}/common/malloc.o ${BDIR}/common/socket.o ${BDIR}/common/lock.o ${BDIR}/common/db.o ${BDIR}/char/int_storage.o ${BDIR}/char/inter.o ${BDIR}/char/int_party.o ${BDIR}/char/int_guild.o
-MOBJS=${BDIR}/common/socket.o ${BDIR}/common/timer.o ${BDIR}/common/db.o ${BDIR}/common/lock.o ${BDIR}/common/malloc.o ${BDIR}/char/int_guild.o ${BDIR}/char/int_party.o ${BDIR}/char/int_storage.o ${BDIR}/char/inter.o
+COBJS=../common/timer.o ../common/malloc.o ../common/socket.o ../common/lock.o ../common/db.o ../char/int_storage.o ../char/inter.o ../char/int_party.o ../char/int_guild.o
+MOBJS=../common/socket.o ../common/timer.o ../common/db.o ../common/lock.o ../common/malloc.o ../char/int_guild.o ../char/int_party.o ../char/int_storage.o ../char/inter.o
+all: adduser itemfrob mapfrob marriage-info eathena-monitor
+adduser: adduser.o ../common/socket.o
-all: ${COBJS} ${MOBJS}
- $(CC) $(CFLAGS) -o adduser adduser.c $(BDIR)/common/socket.o
- $(CC) $(CFLAGS) -I ${BDIR}/char -I ${BDIR}/common itemfrob.c -o itemfrob ${COBJS}
- $(CC) $(CFLAGS) -I ${BDIR}/char -I ${BDIR}/common mapfrob.c -o mapfrob ${COBJS}
- $(CC) $(CFLAGS) -I ${BDIR}/char -I ${BDIR}/common -I ${BDIR}/map -I ${BDIR}/login marriage-info.c -o marriage-info ${MOBJS}
- $(CC) $(CFLAGS) -o ${BDIR}/../eathena-monitor eathena-monitor.c
+itemfrob: itemfrob.o ${COBJS}
+mapfrob: mapfrob.o ${COBJS}
+marriage-info: marriage-info.o ${MOBJS}
+eathena-monitor: eathena-monitor.c
+ $(CC) $(CFLAGS) -o eathena-monitor eathena-monitor.c
clean:
- rm -f adduser itemfrob mapfrob marriage-info ${BDIR}/../eathena-monitor
+ rm -f adduser itemfrob mapfrob marriage-info eathena-monitor
rm -f *.exe
+ rm -f *.o
diff --git a/src/tool/adduser.c b/src/tool/adduser.c
index 6ebbdf1..1954b66 100644
--- a/src/tool/adduser.c
+++ b/src/tool/adduser.c
@@ -41,7 +41,7 @@ int main (int argc, char *argv[])
// Check to see if account.txt exists.
printf ("Checking if '%s' file exists...\n", account_txt);
- FILE *FPaccin = fopen_ (account_txt, "r");
+ FILE *FPaccin = fopen (account_txt, "r");
if (FPaccin == NULL)
{
printf ("'%s' file not found!\n", account_txt);
@@ -72,7 +72,7 @@ int main (int argc, char *argv[])
}
}
}
- close (FPaccin);
+ fclose (FPaccin);
printf ("File exists.\n");
printf ("Don't create an account if the login-server is online!!!\n");
@@ -105,11 +105,11 @@ int main (int argc, char *argv[])
scanf ("%s", &sex);
}
- FILE *FPaccout = fopen_ (account_txt, "r+");
+ FILE *FPaccout = fopen (account_txt, "r+");
fseek (FPaccout, 0, SEEK_END);
fprintf (FPaccout, "%i %s %s - %s -\r\n", next_id, username,
password, sex);
- close (FPaccout);
+ fclose (FPaccout);
printf ("Account added.\n");
}
diff --git a/src/tool/marriage-info.c b/src/tool/marriage-info.c
index cd13843..9b91955 100644
--- a/src/tool/marriage-info.c
+++ b/src/tool/marriage-info.c
@@ -7,9 +7,9 @@ src/char/int_party.o src/char/int_storage.o src/char/inter.o
#include <stdio.h>
#include <stdlib.h>
-#include "login.h"
-#include "mmo.h"
-#include "char.c"
+#include "../login/login.h"
+#include "../common/mmo.h"
+#include "../char/char.c"
int mode;
#define MODE_MARRIED 0
diff --git a/src/webserver/Makefile b/src/webserver/Makefile
index 417fa7c..5bfa83f 100644
--- a/src/webserver/Makefile
+++ b/src/webserver/Makefile
@@ -1,20 +1,9 @@
include ../../make.defs
-all:
- #Generate framework...
- $(CC) $(CFLAGS) -c parse.c
- $(CC) $(CFLAGS) -c generate.c
- $(CC) $(CFLAGS) -c htmlstyle.c
- $(CC) $(CFLAGS) -c logs.c
-
- #Generate "pages"...
- cd pages && $(CC) $(CFLAGS) -c about.c && cd ..
- cd pages && $(CC) $(CFLAGS) -c sample.c && cd ..
- cd pages && $(CC) $(CFLAGS) -c notdone.c && cd ..
-
- #Building the server...
- $(CC) $(CFLAGS) -o webserver main.c parse.o generate.o htmlstyle.o \
- logs.o pages/about.o pages/sample.o pages/notdone.o
+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}