-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
94 lines (80 loc) · 1.62 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
all: unity
#all: incremental
COMMON_CFLAGS=-std=c99 -pedantic -Wdeprecated -Wall -Wno-unused-function \
-Werror
CFLAGS=$(COMMON_CFLAGS) -O2 -DNDEBUG=1
#CFLAGS=$(COMMON_CFLAGS) -O0 -g
#CFLAGS=$(COMMON_CFLAGS) -O0 -g -pg -static
CC=cc
MKPROF=
#MKPROF=time
MUXFS_DS_MALLOC=0
.if $(MUXFS_DS_MALLOC)
DS=ds_malloc
.else
DS=ds
.endif
OBJ=chk.o \
conf.o \
desc.o \
dev.o \
$(DS).o \
format.o \
lfile.o \
mount.o \
muxfs.o \
ops.o \
scan.o \
state.o \
sync.o \
util.o \
version.o
incremental: muxfs_incremental
unity: muxfs_unity
gen: ds.h gen.c chk.h
${MKPROF} ${CC} ${COMMON_CFLAGS} \
-I. \
-DMUXFS= \
-DMUXFS_DEC=extern \
-o gen \
gen.c
gen.h: gen
${MKPROF} ./gen >gen.h
.SUFFIXES: .c .o
.c.o: ds.h gen.h muxfs.h
${MKPROF} ${CC} ${CFLAGS} \
-I. \
-DMUXFS= \
-DMUXFS_DEC=extern \
-c \
-o $@ $<
muxfs_incremental: ds.h gen.h muxfs.h ${OBJ}
${MKPROF} ${CC} ${CFLAGS} \
-I. \
-DMUXFS= \
-DMUXFS_DEC=extern \
-lfuse -lz \
-o muxfs \
${OBJ}
gen_h_unity:
${MKPROF} echo \
'/* gen.h contents not needed for unity build. */' \
>gen.h
muxfs_unity: gen_h_unity
${MKPROF} ${CC} ${CFLAGS} \
-I. \
-DMUXFS=static \
-DMUXFS_DEC=static \
-DMUXFS_DS_MALLOC=$(MUXFS_DS_MALLOC) \
-Dmuxfs_chk=muxfs_chk_p \
-lfuse -lz \
-o muxfs \
unity.c
install:
install -o root -g bin -m 0755 muxfs /usr/local/sbin/muxfs
install -o root -g bin -m 0644 muxfs.1 /usr/local/man/man1/muxfs.1
clean:
rm ds.o ds_malloc.o ${OBJ} \
muxfs \
gen.h gen \
>/dev/null 2>&1 || true