forked from dayne/zunkfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (49 loc) · 1.43 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
56
57
58
59
60
61
62
63
64
65
FUSE_CFLAGS=$(shell pkg-config fuse --cflags)
FUSE_LIBS=$(shell pkg-config fuse --libs)
LDFLAGS=-lssl -lsqlite3 $(FUSE_LIBS)
CFLAGS=-g -Wall $(FUSE_CFLAGS) -DZUNKFS_OS=$(OS)
OS=$(shell /usr/bin/env uname)
ifdef CHUNK_SIZE
CFLAGS+=-DCHUNK_SIZE=$(CHUNK_SIZE)
endif
ifeq ("$(OS)","Darwin")
LDFLAGS+=-lcrypto
LDFLAGS+=-framework CoreFoundation
endif
ifeq ("$(OS)","Linux")
FUSE_CFLAGS+=-D_FILE_OFFSET_BITS=64
endif
CORE_OBJS=chunk-tree.o \
chunk-db.o \
dir.o \
file.o \
utils.o \
mutex.o
DBTYPES=chunk-db-local.o \
chunk-db-cmd.o \
chunk-db-map.o \
chunk-db-sqlite.o \
chunk-db-mem.o
UNIT_TEST_OBJS=$(CORE_OBJS) unit-test-utils.o chunk-db-mem.o
FINAL_OBJS=zunkfs \
ctree-unit-test \
dir-unit-test \
file-unit-test \
zunkfs-list-ddents \
zunkfs-add-ddent
all: ${FINAL_OBJS}
tests: ctree-unit-test dir-unit-test file-unit-test
zunkfs: $(CORE_OBJS) $(DBTYPES) fuse.o
$(CC) -o $@ $^ $(LDFLAGS)
ctree-unit-test: $(UNIT_TEST_OBJS) ctree-unit-test.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
dir-unit-test: $(UNIT_TEST_OBJS) dir-unit-test.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
file-unit-test: $(UNIT_TEST_OBJS) file-unit-test.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
zunkfs-list-ddents: $(CORE_OBJS) $(DBTYPES) zunkfs-list-ddents.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
zunkfs-add-ddent: $(CORE_OBJS) $(DBTYPES) zunkfs-add-ddent.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
clean:
@rm -f $(FINAL_OBJS) *.o *.out *.log core