-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
55 lines (54 loc) · 1.77 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
CC=gcc
CFLAGS=-g -Wall
INCLUDES=-I .
CLILIB=libcli.a
TARGET:exe ${CLILIB}
OBJ=cmd_hier.o parser.o serialize.o string_util.o clistd.o clicbext.o gluethread/glthread.o ut/utinfra/ut_parser.o
exe:testapp.o ${CLILIB}
@echo "Building final executable"
@ ${CC} ${CFLAGS} ${INCLUDES} testapp.o -o exe -L . -lcli -lpthread -lrt
cmd_hier.o:cmd_hier.c
@echo "Building cmd_hier.o"
@ ${CC} ${CFLAGS} -c ${INCLUDES} cmd_hier.c -o cmd_hier.o
parser.o:parser.c
@echo "Building parser.o"
@ ${CC} ${CFLAGS} -c ${INCLUDES} parser.c -o parser.o
gluethread/glthread.o:gluethread/glthread.c
@echo "Building gluethread/glthread.o"
@ ${CC} ${CFLAGS} -c ${INCLUDES} gluethread/glthread.c -o gluethread/glthread.o
serialize.o:serialize.c
@echo "Building serialize.o"
@ ${CC} ${CFLAGS} -c ${INCLUDES} serialize.c -o serialize.o
string_util.o:string_util.c
@echo "Building string_util.o"
@ ${CC} ${CFLAGS} -c ${INCLUDES} string_util.c -o string_util.o
clistd.o:clistd.c
@echo "Building clistd.o"
@ ${CC} ${CFLAGS} -c ${INCLUDES} clistd.c -o clistd.o
clicbext.o:clicbext.c
@echo "Building clicbext.o"
@ ${CC} ${CFLAGS} -c ${INCLUDES} clicbext.c -o clicbext.o
testapp.o:testapp.c
@echo "Building testapp.o"
@ ${CC} ${CFLAGS} -c ${INCLUDES} testapp.c -o testapp.o
ut/utinfra/ut_parser.o:ut/utinfra/ut_parser.c
@echo "Building ut/utinfra/ut_parser.o"
@ ${CC} ${CFLAGS} -c ${INCLUDES} ut/utinfra/ut_parser.c -o ut/utinfra/ut_parser.o
${CLILIB}: ${OBJ}
@echo "Building Library ${CLILIB}"
ar rs ${CLILIB} ${OBJ}
clean:
rm -f exe
rm -f *.o
rm -f gluethread/*.o
rm -f ut/utinfra/*.o
rm -f ${CLILIB}
rm -f CMD_HIST_RECORD_FILE.txt
install:
cp ${CLILIB} /usr/local/lib/
cp libcli.h /usr/include/
cp cmdtlv.h /usr/include/
uninstall:
rm -f /usr/local/lib/${CLILIB}
rm -f /usr/include/libcli.h
rm -f /usr/include/cmdtlv.h