-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (33 loc) · 913 Bytes
/
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
GEN_DIR=gen
XML=nasdaq_totalview_itch.xml
SCRIPT=itch_msg_to_c.py
RELEASE=release
INC=inc
FLAGS = -std=gnu99 -Wall -Wextra -Wconversion -Wshadow -Wundef -fno-common -Wno-unused-parameter -Wno-type-limits -fpic
CC = cc $(if $(debug),-DDEBUG -g)
LD = cc
test : test.o file.o itch.o
$(LD) -o test -g test.o file.o itch.o
test.o : test.c
$(CC) -c test.c $(FLAGS)
file.o: gen_flag file.h file.c
$(CC) -c file.c $(FLAGS)
gen_flag : ${GEN_DIR}/${XML} ${GEN_DIR}/${SCRIPT}
cd ${GEN_DIR} ; python ${SCRIPT} ${XML}
touch gen_flag
itch.o: type.h itch.h itch.c itch_s.h gen_flag
$(CC) -c itch.c $(FLAGS)
lib: itch.o file.o
ar rcs libitch.a itch.o file.o
release: lib
mkdir -p $(RELEASE)/$(INC)/$(GEN_DIR)
cp libitch.a $(RELEASE)/.
cp *.h $(RELEASE)/$(INC)
cp $(GEN_DIR)/*.h $(RELEASE)/$(INC)/$(GEN_DIR)
clean:
rm gen_flag
rm -f ${GEN_DIR}/*.h
rm -f *.o
rm -f *.a
rm -f test
rm -fr $(RELEASE)