-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
39 lines (29 loc) · 890 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
CC = gcc -g
CFLAGS = -Wall -I. -DSEATEST_EXIT_ON_FAIL
LDFLAGS = -L /opt/local/lib
SYSLIBS = -lrrd -ldb
TSDB_LIB = libtsdb.a
TSDB_LIB_O = tsdb_api.o tsdb_trace.o tsdb_bitmap.o quicklz.o
TEST_LIBS = $(TSDB_LIB) test_core.o seatest.o
TARGETS = $(TSDB_LIB) \
tsdb-create \
tsdb-info \
tsdb-set \
tsdb-get \
test-simple \
test-advanced \
test-bitmaps \
test-tags
all: $(TARGETS)
%.o: %.c %.h
${CC} ${CFLAGS} ${INCLUDE} -c $< -o $@
$(TSDB_LIB): $(TSDB_LIB_O)
ar rs $@ ${TSDB_LIB_O}
ranlib $@
tsdb-%: tsdb_%.o $(TSDB_LIB)
$(CC) $(LDFLAGS) tsdb_$*.o $(TSDB_LIB) $(SYSLIBS) -o $@
test-%: test_%.o $(TEST_LIBS)
$(CC) $(LDFLAGS) test_$*.o $(TEST_LIBS) $(SYSLIBS) -o $@
clean:
rm -f ${TARGETS} *.o *~
.SECONDARY: $(TEST_LIBS)