forked from dongyx/chtrie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (31 loc) · 897 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
44
45
.PHONY: all test install clean
prefix = /usr/local
exec_prefix = $(prefix)
libdir = $(exec_prefix)/lib
includedir = $(prefix)/include
CC = cc
INSTALL = install
ALL = libchtrie.a log_malloc.o marktime.o chtrie.o
all: $(ALL)
chtrie.o: chtrie.c chtrie.h
$(CC) $(CFLAGS) -c -o $@ $<
log_malloc.o: log_malloc.c log_malloc.h
$(CC) $(CFLAGS) -c -o $@ $<
marktime.o: marktime.c marktime.h
$(CC) $(CFLAGS) -c -o $@ $<
libchtrie.a: chtrie.o
ar -cr $@ $^
run.tmp: chtrie.o chtrie.h test.c
$(CC) $(CFLAGS) -o $@ marktime.o log_malloc.o chtrie.o test.c -lreadline
lhprun.tmp: chtrie.o chtrie.h lhptest.c
$(CC) $(CFLAGS) -o $@ marktime.o log_malloc.o chtrie.o lhptest.c -lreadline
test: run.tmp
./runtest
lhptest: lhprun.tmp
./lhpruntest
install: all
$(INSTALL) -d $(includedir) $(libdir)
$(INSTALL) chtrie.h $(includedir)/
$(INSTALL) libchtrie.a $(libdir)/
clean:
rm -rf $(ALL) *.tmp