summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile48
-rw-r--r--make.defs28
-rw-r--r--src/char/Makefile4
-rw-r--r--src/char_sql/GNUmakefile20
-rw-r--r--src/char_sql/Makefile2
-rw-r--r--src/common/Makefile1
-rw-r--r--src/ladmin/GNUmakefile14
-rw-r--r--src/ladmin/Makefile2
-rw-r--r--src/login/Makefile4
-rw-r--r--src/login_sql/GNUmakefile17
-rw-r--r--src/login_sql/Makefile2
-rw-r--r--src/map/Makefile3
-rw-r--r--src/tool/Makefile18
-rw-r--r--src/tool/eathena-monitor.c (renamed from eathena-monitor.c)0
-rwxr-xr-xsrc/tool/ipcheck.rb (renamed from ipcheck.rb)0
-rw-r--r--src/tool/marriage-info.c (renamed from marriage-info.c)6
-rwxr-xr-xsrc/tool/marriage-info.sh (renamed from marriage-info.sh)0
-rwxr-xr-xsrc/tool/stats.sh (renamed from stats.sh)0
-rw-r--r--src/txt-converter/char/GNUmakefile13
-rw-r--r--src/txt-converter/char/Makefile2
-rw-r--r--src/txt-converter/login/GNUmakefile11
-rw-r--r--src/txt-converter/login/Makefile1
-rw-r--r--src/webserver/Makefile18
23 files changed, 71 insertions, 143 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 ..
diff --git a/make.defs b/make.defs
new file mode 100644
index 0000000..b9bc3fb
--- /dev/null
+++ b/make.defs
@@ -0,0 +1,28 @@
+# Definitions for our funky-chicken build system
+
+ifeq ($(shell uname -m), x86_64)
+M32=-m32
+endif
+
+CC = gcc ${M32}
+LEX=flex
+BISON=bison
+
+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)"
diff --git a/src/char/Makefile b/src/char/Makefile
index 841edfd..271aafd 100644
--- a/src/char/Makefile
+++ b/src/char/Makefile
@@ -1,10 +1,12 @@
+include ../../make.defs
+
all: char-server
txt: char-server
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) -o ../../$@ $>
+ $(CC) $(CFLAGS) -o ../../$@ $>
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)
diff --git a/src/char_sql/GNUmakefile b/src/char_sql/GNUmakefile
deleted file mode 100644
index 9c7b5e5..0000000
--- a/src/char_sql/GNUmakefile
+++ /dev/null
@@ -1,20 +0,0 @@
-all: char-server_sql
-sql: char-server_sql
-
-COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/malloc.o
-COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/db.h ../common/malloc.h
-
-char-server_sql: char.o inter.o int_party.o int_guild.o int_storage.o int_pet.o strlib.o itemdb.o $(COMMON_OBJ)
- $(CC) -o ../../$@ $^ $(LIB_S)
-
-char.o: char.c char.h strlib.h itemdb.h
-inter.o: inter.c inter.h int_party.h int_guild.h int_storage.h int_pet.h ../common/mmo.h char.h ../common/socket.h
-int_party.o: int_party.c int_party.h inter.h ../common/mmo.h char.h ../common/socket.h ../common/timer.h ../common/db.h
-int_guild.o: int_guild.c int_guild.h inter.h ../common/mmo.h char.h ../common/socket.h ../common/db.h
-int_storage.o: int_storage.c int_storage.h char.h itemdb.h
-int_pet.o: int_pet.c int_pet.h inter.h char.h ../common/mmo.h ../common/socket.h ../common/db.h
-strlib.o: strlib.c strlib.h
-itemdb.o: itemdb.c itemdb.h ../common/db.h ../common/mmo.h
-
-clean:
- rm -f *.o ../../char-server_sql
diff --git a/src/char_sql/Makefile b/src/char_sql/Makefile
index 9c7b5e5..8f21f0b 100644
--- a/src/char_sql/Makefile
+++ b/src/char_sql/Makefile
@@ -1,3 +1,5 @@
+include ../../make.defs
+
all: char-server_sql
sql: char-server_sql
diff --git a/src/common/Makefile b/src/common/Makefile
index 9218a55..9eac7b4 100644
--- a/src/common/Makefile
+++ b/src/common/Makefile
@@ -1,3 +1,4 @@
+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
core.o: core.c core.h
diff --git a/src/ladmin/GNUmakefile b/src/ladmin/GNUmakefile
deleted file mode 100644
index bed7b6b..0000000
--- a/src/ladmin/GNUmakefile
+++ /dev/null
@@ -1,14 +0,0 @@
-all: ladmin
-txt: ladmin
-sql: ladmin
-
-COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/malloc.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/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
diff --git a/src/ladmin/Makefile b/src/ladmin/Makefile
index bed7b6b..3221901 100644
--- a/src/ladmin/Makefile
+++ b/src/ladmin/Makefile
@@ -1,3 +1,5 @@
+include ../../make.defs
+
all: ladmin
txt: ladmin
sql: ladmin
diff --git a/src/login/Makefile b/src/login/Makefile
index 0411129..4b65c33 100644
--- a/src/login/Makefile
+++ b/src/login/Makefile
@@ -1,3 +1,5 @@
+include ../../make.defs
+
all: login-server
txt: login-server
@@ -5,7 +7,7 @@ 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/lock.h ../common/malloc.h ../common/mt_rand.h
login-server: login.o md5calc.o $(COMMON_OBJ)
- $(CC) -o ../../$@ login.o md5calc.o $(COMMON_OBJ)
+ $(CC) $(CFLAGS) -o ../../$@ login.o md5calc.o $(COMMON_OBJ)
login.o: login.c login.h md5calc.h $(COMMON_H)
md5calc.o: md5calc.c md5calc.h
diff --git a/src/login_sql/GNUmakefile b/src/login_sql/GNUmakefile
deleted file mode 100644
index c245b79..0000000
--- a/src/login_sql/GNUmakefile
+++ /dev/null
@@ -1,17 +0,0 @@
-all: login-server_sql
-sql: login-server_sql
-
-shared_libs=all
-COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/malloc.o
-COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h ../common/db.h ../common/malloc.h
-
-login-server_sql: login.o md5calc.o strlib.o $(COMMON_OBJ)
- $(CC) -o ../../$@ $^ $(LIB_S)
-
-login.o: login.c login.h md5calc.h strlib.h $(COMMON_H)
-md5calc.o: md5calc.c md5calc.h
-strlib.o: strlib.c strlib.h
-
-clean:
- rm -f *.o ../../login-server_sql
-
diff --git a/src/login_sql/Makefile b/src/login_sql/Makefile
index c245b79..12fd7f3 100644
--- a/src/login_sql/Makefile
+++ b/src/login_sql/Makefile
@@ -1,3 +1,5 @@
+include ../../make.defs
+
all: login-server_sql
sql: login-server_sql
diff --git a/src/map/Makefile b/src/map/Makefile
index 5e80410..730e72f 100644
--- a/src/map/Makefile
+++ b/src/map/Makefile
@@ -1,5 +1,4 @@
-LEX=flex
-BISON=bison
+include ../../make.defs
all: txt
diff --git a/src/tool/Makefile b/src/tool/Makefile
index d2616a7..5d37183 100644
--- a/src/tool/Makefile
+++ b/src/tool/Makefile
@@ -1,12 +1,16 @@
-CC=gcc -m32 -O0 -g
+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_pet.o ${BDIR}/char/int_storage.o ${BDIR}/char/inter.o ${BDIR}/char/int_party.o ${BDIR}/char/int_guild.o
+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
-all:
- $(CC) -o adduser adduser.c
- $(CC) -I ${BDIR}/char -I ${BDIR}/common itemfrob.c -o itemfrob ${COBJS}
- $(CC) -I ${BDIR}/char -I ${BDIR}/common mapfrob.c -o mapfrob ${COBJS}
+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
clean:
- rm -f adduser itemfrob mapfrop
+ rm -f adduser itemfrob mapfrob marriage-info ${BDIR}/../eathena-monitor
rm -f *.exe
diff --git a/eathena-monitor.c b/src/tool/eathena-monitor.c
index d0b3995..d0b3995 100644
--- a/eathena-monitor.c
+++ b/src/tool/eathena-monitor.c
diff --git a/ipcheck.rb b/src/tool/ipcheck.rb
index 7c2e22a..7c2e22a 100755
--- a/ipcheck.rb
+++ b/src/tool/ipcheck.rb
diff --git a/marriage-info.c b/src/tool/marriage-info.c
index 743e33c..cd13843 100644
--- a/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 "src/login/login.h"
-#include "src/common/mmo.h"
-#include "src/char/char.c"
+#include "login.h"
+#include "mmo.h"
+#include "char.c"
int mode;
#define MODE_MARRIED 0
diff --git a/marriage-info.sh b/src/tool/marriage-info.sh
index 2389d7f..2389d7f 100755
--- a/marriage-info.sh
+++ b/src/tool/marriage-info.sh
diff --git a/stats.sh b/src/tool/stats.sh
index 9ea021b..9ea021b 100755
--- a/stats.sh
+++ b/src/tool/stats.sh
diff --git a/src/txt-converter/char/GNUmakefile b/src/txt-converter/char/GNUmakefile
deleted file mode 100644
index 56723ca..0000000
--- a/src/txt-converter/char/GNUmakefile
+++ /dev/null
@@ -1,13 +0,0 @@
-all: char-converter
-sql: char-converter
-
-COMMON_OBJ = ../../common/core.o ../../common/socket.o ../../common/timer.o ../../common/db.o ../../common/malloc.o
-
-char-converter: char-converter.o strlib.o $(COMMON_OBJ)
- $(CC) -o ../../../$@ $^ $(LIB_S)
-
-char-converter.o: char-converter.c char.h strlib.h
-strlib.o: strlib.c strlib.h
-clean:
- rm -f *.o ../../../char-converter
-
diff --git a/src/txt-converter/char/Makefile b/src/txt-converter/char/Makefile
index 56723ca..47d97d3 100644
--- a/src/txt-converter/char/Makefile
+++ b/src/txt-converter/char/Makefile
@@ -1,3 +1,5 @@
+include ../../../make.defs
+
all: char-converter
sql: char-converter
diff --git a/src/txt-converter/login/GNUmakefile b/src/txt-converter/login/GNUmakefile
deleted file mode 100644
index 9f34e14..0000000
--- a/src/txt-converter/login/GNUmakefile
+++ /dev/null
@@ -1,11 +0,0 @@
-all: login-converter
-sql: login-converter
-
-COMMON_OBJ = ../../common/core.o ../../common/socket.o ../../common/timer.o ../../common/db.o ../../common/malloc.o
-COMMON_H = ../../common/core.h ../../common/socket.h ../../common/timer.h ../../common/mmo.h ../../common/version.h ../../common/db.h ../../common/malloc.h
-
-login-converter: login-converter.o ../../login_sql/md5calc.o ../../login_sql/strlib.o $(COMMON_OBJ)
- $(CC) -o ../../../$@ $^ $(LIB_S)
-login-converter.o: login-converter.c ../../login_sql/login.h ../../login_sql/md5calc.h ../../login_sql/strlib.h $(COMMON_H)
-clean:
- rm -f *.o ../../../login-converter
diff --git a/src/txt-converter/login/Makefile b/src/txt-converter/login/Makefile
index 9f34e14..832a21a 100644
--- a/src/txt-converter/login/Makefile
+++ b/src/txt-converter/login/Makefile
@@ -1,3 +1,4 @@
+include ../../../make.defs
all: login-converter
sql: login-converter
diff --git a/src/webserver/Makefile b/src/webserver/Makefile
index 065c1ff..417fa7c 100644
--- a/src/webserver/Makefile
+++ b/src/webserver/Makefile
@@ -1,19 +1,19 @@
-cc = gcc
+include ../../make.defs
all:
#Generate framework...
- $(cc) -c parse.c
- $(cc) -c generate.c
- $(cc) -c htmlstyle.c
- $(cc) -c logs.c
+ $(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) -c about.c && cd ..
- cd pages && $(cc) -c sample.c && cd ..
- cd pages && $(cc) -c notdone.c && cd ..
+ 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) -o webserver main.c parse.o generate.o htmlstyle.o \
+ $(CC) $(CFLAGS) -o webserver main.c parse.o generate.o htmlstyle.o \
logs.o pages/about.o pages/sample.o pages/notdone.o