forked from gatchi/PSONOVA-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
86 lines (66 loc) · 2.41 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Bin Makefile
ROOT_DIR = .
SRC_DIR = src
SERVER_DIR = install
ifeq ($(OS),Windows_NT)
MYSQL = -L $(SRC_DIR)/mysql/lib -llibmysql
else
MYSQL = -lmysqlclient
endif
CC = gcc
INCLUDES = -I $(SRC_DIR)/md5/include -I $(SRC_DIR)/mysql/include -I $(SRC_DIR)/prs
WINSOCK = -lws2_32
LOGIN_DIR = $(ROOT_DIR)/$(SERVER_DIR)/login
SHIP_DIR = $(ROOT_DIR)/$(SERVER_DIR)/ship
UTIL_DIR = $(ROOT_DIR)/$(SRC_DIR)/util
SHIP_SRC_DIR = $(SRC_DIR)/ship_server
HEADERS = $(PATCH_H) $(LOGIN_H) $(SHIP_H)
PATCH_H = $(SRC_DIR)/patch_server/resource.h
LOGIN_H = $(SRC_DIR)/login_server/def_structs.h
SHIP_H = $(SHIP_SRC_DIR)/resource.h $(SHIP_SRC_DIR)/pso_crypt.h $(SHIP_SRC_DIR)/bbtable.h $(SHIP_SRC_DIR)/localgms.h \
$(SHIP_SRC_DIR)/prs.cpp $(SHIP_SRC_DIR)/def_map.h $(SHIP_SRC_DIR)/def_block.h $(SHIP_SRC_DIR)/def_packets.h \
$(SHIP_SRC_DIR)/def_structs.h $(SHIP_SRC_DIR)/def_tables.h $(FUNC_H)
FUNC_H = $(SHIP_SRC_DIR)/funcs1.h $(SHIP_SRC_DIR)/funcs2.h $(SHIP_SRC_DIR)/funcs3.h $(SHIP_SRC_DIR)/commands.h \
$(SHIP_SRC_DIR)/file-funcs.h $(SHIP_SRC_DIR)/load-funcs.h $(SHIP_SRC_DIR)/mag-funcs.h $(SHIP_SRC_DIR)/string-funcs.h
all: patch ship #account_add login char_export convert_quest convert_unitxt make_key newtable patch ship
.SECONDEXPANSION:
account_add: [email protected] md5.o
$(CC) -o $@ $< $(MYSQL) md5.o
# cp [email protected] $(LOGIN_DIR)
char_export convert_quest: [email protected] md5.o
$(CC) -o $@ $< $(MYSQL) md5.o
# cp [email protected] $(UTIL_DIR)
patch: patch_server.o $(PATCH_H)
$(CC) -o $@ $< $(WINSOCK)
# cp [email protected] $(LOGIN_DIR)
login: login_server.o md5.o $(LOGIN_H)
$(CC) -o $@ $< $(WINSOCK) $(MYSQL) md5.o
# cp [email protected] $(LOGIN_DIR)
ship: mtwist.o ship_server.o $(SHIP_H)
$(CC) -o $@ mtwist.o ship_server.o $(WINSOCK)
# cp [email protected] $(SHIP_DIR)
ship.d: ship_server.d.o mtwist.o $(SHIP_H)
$(CC) -o $@ $< $(WINSOCK) mtwist.o
make_key: mtwist.o make_key.o
$(CC) -o $@ $^ $(MYSQL)
# cp [email protected] $(LOGIN_DIR)
newtable: mtwist.o newtable.o
$(CC) -o $@ $^
# cp [email protected] $(UTIL_DIR)
convert_unitxt: convert_unitxt.o
$(CC) -o $@ $^
# cp [email protected] $(UTIL_DIR)
patch_server.o: $(SRC_DIR)/$$*/$$*.c $(PATCH_H)
$(CC) -c $(INCLUDES) $<
login_server.o: $(SRC_DIR)/$$*/$$*.c $(LOGIN_H)
$(CC) -c $(INCLUDES) $<
ship_server.o: $(SRC_DIR)/$$*/$$*.c $(SHIP_H)
$(CC) -c $(INCLUDES) $<
ship_server.d.o: $(SRC_DIR)/ship_server/ship_server.c $(SHIP_H)
$(CC) -g -c -o ship_server.d.o $(INCLUDES) $<
%.o: $(SRC_DIR)/$$*/%.c
$(CC) -c $(INCLUDES) $<
clean:
rm *.o
reset:
rm *.o *.exe