forked from zhicheng/db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (36 loc) · 1.14 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
CC = cc
CFLAGS = -Wall -Werror -Wno-long-long -ansi -pedantic -g
SRC = hash.c db.c
OBJ = $(SRC:.c=.o)
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
CFLAGS += -D_BSD_SOURCE
CFLAGS += -D_GNU_SOURCE
CFLAGS += -D_POSIX_SOURCE
CFLAGS += -D_XOPEN_SOURCE
CFLAGS += -D_POSIX_C_SOURCE=200809L
CFLAGS += -DLINUX
endif
all: db-put db-get db-del db-iter db-stat db-export db-import db-bench db-server
db-put: db-put.c $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
db-get: db-get.c $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
db-del: db-del.c $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
db-iter: db-iter.c $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
db-stat: db-stat.c $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
db-export: db-export.c $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
db-import: db-import.c $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
db-bench: db-bench.c $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
db-server: db-server.c $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -rf db-put db-get db-del db-iter db-stat db-export db-import db-bench db-server *.o *.dSYM