forked from trickyloki3/eadb.compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
62 lines (50 loc) · 1.36 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
# c compiler and flags
CCompiler = gcc
CFlags = -std=c99 -pedantic -Wall -g -O
# db library variables
HDRDIR = -Ihdr/
OBJDIR = obj/
SRCDIR = src/
LIB = -lsqlite3 -ldl -lpthread
_OBJ = db.o util.o load.o api.o script.o range.o name_range.o table.o
OBJ = $(patsubst %,$(OBJDIR)%,$(_OBJ))
# hercule item database require libconfig
HE_HDRDIR = -I../lib
HE_LIBDIR = ../lib/hconfig.a
# compile all applications or projects
all:
make lclean
make conv
make item
memchk: item
valgrind --leak-check=full --show-reachable=yes --track-origins=yes --log-file=itemc_mem_check.log -v ./item rathena
hitem: src/he_item.c $(OBJ)
$(CCompiler) -c -o he_item.o $(CFlags) src/he_item.c $(HDRDIR) $(HE_HDRDIR)
$(CCompiler) -o $@ $(CFlags) $^ $(HDRDIR) $(HE_HDRDIR) $(HE_LIBDIR) $(LIB)
item: src/item.c $(OBJ)
$(CCompiler) -o $@ $(CFlags) $^ $(HDRDIR) $(LIB)
itemr: src/itemr.c $(OBJ)
$(CCompiler) -o $@ $(CFlags) $^ $(HDRDIR) $(LIB)
conv: src/conv.c $(OBJ)
$(CCompiler) -o $@ $(CFlags) $^ $(HDRDIR) $(LIB)
lab: src/lab.c $(OBJ)
$(CCompiler) -o $@ $(CFlags) $^ $(HDRDIR) $(LIB)
$(OBJDIR)%.o: $(SRCDIR)%.c
$(CCompiler) -c -o $@ $(CFlags) $^ $(HDRDIR)
# linux clean
.PHONY: clean
lclean:
rm -rf obj
mkdir obj
rm -f conv
rm -f item
rm -f itemr
rm -f hitem
rm -f he_item.o
rm -f dump.txt
rm -f item.txt
rm -f itemc_mem_check.log
rm -rf *.dSYM
wclean:
rmdir obj /S /Q
mkdir obj