summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile43
1 files changed, 21 insertions, 22 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 4162d7a..b00e55c 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -11,29 +11,29 @@ include make.defs
+mkdir -p $@
# The default recipe is suboptimal
-%.c: %.l
+%.cpp: %.lpp
$(LEX) -o $@ $<
-%.c %.h: %.y
- $(BISON) -d -o $*.c $<
+%.cpp %.h: %.ypp
+ $(BISON) -d -o $*.cpp $<
# 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 $@ $<
+${BUILD_DIR}/char/%.o: src/char/%.cpp | ${BUILD_DIR}/char/
+ $(COMPILE.cpp) -o $@ $<
+${BUILD_DIR}/common/%.o: src/common/%.cpp | ${BUILD_DIR}/common/
+ $(COMPILE.cpp) -o $@ $<
+${BUILD_DIR}/ladmin/%.o: src/ladmin/%.cpp | ${BUILD_DIR}/ladmin/
+ $(COMPILE.cpp) -o $@ $<
+${BUILD_DIR}/login/%.o: src/login/%.cpp | ${BUILD_DIR}/login/
+ $(COMPILE.cpp) -o $@ $<
+${BUILD_DIR}/map/%.o: src/map/%.cpp | ${BUILD_DIR}/map/
+ $(COMPILE.cpp) -o $@ $<
+${BUILD_DIR}/tool/%.o: src/tool/%.cpp | ${BUILD_DIR}/tool/
+ $(COMPILE.cpp) -o $@ $<
+${BUILD_DIR}/webserver/%.o: src/webserver/%.cpp | ${BUILD_DIR}/webserver/
+ $(COMPILE.cpp) -o $@ $<
+${BUILD_DIR}/webserver/pages/%.o: src/webserver/pages/%.cpp | ${BUILD_DIR}/webserver/pages/
+ $(COMPILE.cpp) -o $@ $<
PROGS = login-server char-server map-server ladmin eathena-monitor webserver
# Things to actually make
@@ -60,7 +60,6 @@ webserver: ${BUILD_DIR}/webserver/main
${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
@@ -70,8 +69,8 @@ ${BUILD_DIR}/tool/marriage-info: ${BUILD_DIR}/tool/marriage-info.o ${BUILD_DIR}/
${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")"; \
+ for F in `find src/ -name '*.cpp'`; do \
+ ${CXX} ${CPPFLAGS} -MM "$$F" -MT "$$(sed 's/src/$${BUILD_DIR}/;s/\.cpp/.o/' <<< "$$F")"; \
done > deps.make
include deps.make