-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
50 lines (38 loc) · 1.09 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
EXEC=tristramd
SRC= \
$(wildcard src/*.c) \
$(wildcard src/bnetd/*.c) \
$(wildcard src/d2gs/*.c) \
$(wildcard src/realm/*.c)
OBJ= $(SRC:.c=.o)
TESTSRC= \
tests/test_char.c \
src/account.c src/bnftp.c src/file.c src/hashing.c src/net.c src/packet.c src/protocol.c src/selector.c src/sql.c src/sql_schema.c src/tristram.c src/utils.c src/character.c \
$(wildcard src/bnetd/*.c) \
$(wildcard src/d2gs/*.c) \
$(wildcard src/realm/*.c)
TESTOBJ = $(TESTSRC:.c=.o)
CFLAGS=-Isrc `pkg-config --cflags eina libconfig` `mysql_config --cflags` -g -ggdb3 -W -Wall -Wextra
LDFLAGS=`pkg-config --libs eina libconfig` `mysql_config --libs`
all: $(EXEC)
tristramd: $(OBJ)
@$(CC) -o $@ $^ $(LDFLAGS)
@echo "[LD] Compiling $@"
test: $(TESTOBJ)
@$(CC) -o $@ $^ $(LDFLAGS)
@echo "[LD] Compiling $@"
%.o: %.c
@$(CC) $(CFLAGS) -o $@ -c $<
@echo "[CC] Compiling $<"
.PHONY: clean mrproper
clean:
@rm -rf *.o \
*~ etc/*~ \
tests/*~ tests/*.o \
src/*.o *~ src/*~ \
src/bnetd/*.o src/bnetd/*~ \
src/realm/*.o src/realm/*~ \
src/d2gs/*.o src/d2gs/*~
mrproper: clean
@rm -rf test
@rm -rf $(EXEC)