author | Tero Marttila <terom@fixme.fi> |
Fri, 17 Oct 2008 20:12:20 +0300 | |
changeset 35 | 4f10421681d2 |
parent 34 | 460f995d3769 |
child 38 | 1fd4da071575 |
permissions | -rw-r--r-- |
1 | 1 |
LIBEVENT_PATH = ../libs/libevent-dev |
2 |
LIBFUSE_PATH = ../libs/libfuse-2.7.4 |
|
0 | 3 |
|
4 |
LIBRARY_PATHS = -L${LIBEVENT_PATH}/lib -L${LIBFUSE_PATH}/lib |
|
5 |
INCLUDE_PATHS = -I${LIBEVENT_PATH}/include -I${LIBFUSE_PATH}/include |
|
11 | 6 |
LDLIBS = -levent -lfuse -lpq |
0 | 7 |
|
28
e944453ca924
split off dbfs components into a separate dir, improve dirop docs, error handling, etc
Tero Marttila <terom@fixme.fi>
parents:
25
diff
changeset
|
8 |
ifdef DEBUG |
e944453ca924
split off dbfs components into a separate dir, improve dirop docs, error handling, etc
Tero Marttila <terom@fixme.fi>
parents:
25
diff
changeset
|
9 |
DEBUG_FLAGS = -DDEBUG_ENABLED |
e944453ca924
split off dbfs components into a separate dir, improve dirop docs, error handling, etc
Tero Marttila <terom@fixme.fi>
parents:
25
diff
changeset
|
10 |
else |
e944453ca924
split off dbfs components into a separate dir, improve dirop docs, error handling, etc
Tero Marttila <terom@fixme.fi>
parents:
25
diff
changeset
|
11 |
DEBUG_FLAGS = |
e944453ca924
split off dbfs components into a separate dir, improve dirop docs, error handling, etc
Tero Marttila <terom@fixme.fi>
parents:
25
diff
changeset
|
12 |
endif |
e944453ca924
split off dbfs components into a separate dir, improve dirop docs, error handling, etc
Tero Marttila <terom@fixme.fi>
parents:
25
diff
changeset
|
13 |
|
1 | 14 |
# XXX: ugh... use `pkg-config fuse` |
28
e944453ca924
split off dbfs components into a separate dir, improve dirop docs, error handling, etc
Tero Marttila <terom@fixme.fi>
parents:
25
diff
changeset
|
15 |
DEFINES = -D_FILE_OFFSET_BITS=64 ${DEBUG_FLAGS} |
0 | 16 |
MY_CFLAGS = -Wall -g -std=gnu99 |
17 |
||
24 | 18 |
BIN_NAMES = helloworld hello simple_hello evpq_test url_test dbfs |
19 | 19 |
BIN_PATHS = $(addprefix bin/,$(BIN_NAMES)) |
0 | 20 |
|
28
e944453ca924
split off dbfs components into a separate dir, improve dirop docs, error handling, etc
Tero Marttila <terom@fixme.fi>
parents:
25
diff
changeset
|
21 |
# complex modules |
30
d8fabd347a8e
working open+read+flush+release
Tero Marttila <terom@fixme.fi>
parents:
29
diff
changeset
|
22 |
EVSQL_OBJS = obj/evsql/evsql.o obj/evsql/util.o obj/evpq.o |
35
4f10421681d2
working mknod, mkdir, symlink
Tero Marttila <terom@fixme.fi>
parents:
34
diff
changeset
|
23 |
DBFS_OBJS = obj/dbfs/dbfs.o obj/dbfs/common.o obj/dbfs/core.o obj/dbfs/op_base.o obj/dbfs/trans.o obj/dbfs/dirop.o obj/dirbuf.o obj/dbfs/fileop.o obj/dbfs/attr.o obj/dbfs/link.o obj/dbfs/tree.o obj/dbfs/mk.o |
28
e944453ca924
split off dbfs components into a separate dir, improve dirop docs, error handling, etc
Tero Marttila <terom@fixme.fi>
parents:
25
diff
changeset
|
24 |
|
11 | 25 |
# first target |
26 |
all: ${BIN_PATHS} |
|
27 |
||
28 |
# binaries |
|
1 | 29 |
bin/helloworld: |
7
3a603d755bcb
split off the dirbuf stuff into its own module
Tero Marttila <terom@fixme.fi>
parents:
6
diff
changeset
|
30 |
bin/hello: obj/evfuse.o obj/dirbuf.o obj/lib/log.o obj/lib/signals.o |
3a603d755bcb
split off the dirbuf stuff into its own module
Tero Marttila <terom@fixme.fi>
parents:
6
diff
changeset
|
31 |
bin/simple_hello: obj/evfuse.o obj/dirbuf.o obj/lib/log.o obj/lib/signals.o obj/simple.o |
11 | 32 |
bin/evpq_test: obj/evpq.o obj/lib/log.o |
15 | 33 |
bin/url_test: obj/lib/url.o obj/lib/lex.o obj/lib/log.o |
28
e944453ca924
split off dbfs components into a separate dir, improve dirop docs, error handling, etc
Tero Marttila <terom@fixme.fi>
parents:
25
diff
changeset
|
34 |
bin/dbfs: ${DBFS_OBJS} ${EVSQL_OBJS} obj/evfuse.o obj/lib/log.o obj/lib/signals.o |
0 | 35 |
|
36 |
# computed |
|
37 |
LDFLAGS = ${LIBRARY_PATHS} ${LIBRARY_LIST} |
|
11 | 38 |
CFLAGSX = ${DEFINES} ${MY_CFLAGS} |
39 |
CFLAGS = ${INCLUDE_PATHS} ${CFLAGSX} |
|
0 | 40 |
|
19 | 41 |
SRC_PATHS = $(wildcard src/*.c) $(wildcard src/*/*.c) |
0 | 42 |
SRC_NAMES = $(patsubst src/%,%,$(SRC_PATHS)) |
1 | 43 |
SRC_DIRS = $(dir $(SRC_NAMES)) |
0 | 44 |
|
11 | 45 |
# other targets |
0 | 46 |
clean : |
31 | 47 |
-rm obj/*.o obj/*/*.o |
48 |
-rm bin/* |
|
49 |
-rm build/deps/*.d build/deps/*/*.d |
|
29
5de62ca9a5aa
reorganize evsql into a separate dir, rename dbfs slightly, and split dbfs_op out from dirop (in prep for fileop)
Tero Marttila <terom@fixme.fi>
parents:
28
diff
changeset
|
50 |
|
5de62ca9a5aa
reorganize evsql into a separate dir, rename dbfs slightly, and split dbfs_op out from dirop (in prep for fileop)
Tero Marttila <terom@fixme.fi>
parents:
28
diff
changeset
|
51 |
clean-deps: |
5de62ca9a5aa
reorganize evsql into a separate dir, rename dbfs slightly, and split dbfs_op out from dirop (in prep for fileop)
Tero Marttila <terom@fixme.fi>
parents:
28
diff
changeset
|
52 |
-rm build/deps/*/*.d |
5de62ca9a5aa
reorganize evsql into a separate dir, rename dbfs slightly, and split dbfs_op out from dirop (in prep for fileop)
Tero Marttila <terom@fixme.fi>
parents:
28
diff
changeset
|
53 |
-rm build/deps/*.d |
0 | 54 |
|
11 | 55 |
#obj-dirs: |
56 |
# python build/make_obj_dirs.py $(BIN_PATHS) |
|
0 | 57 |
|
11 | 58 |
build/deps/%.d : src/%.c |
59 |
@set -e; rm -f $@; \ |
|
20
f0ef6d8880b4
fix build deps for subdirs of src
Tero Marttila <terom@fixme.fi>
parents:
19
diff
changeset
|
60 |
$(CC) -MM -MT __ $(CPPFLAGS) $< > $@.$$$$; \ |
f0ef6d8880b4
fix build deps for subdirs of src
Tero Marttila <terom@fixme.fi>
parents:
19
diff
changeset
|
61 |
sed 's,__[ :]*,obj/$*.o $@ : ,g' < $@.$$$$ > $@; \ |
11 | 62 |
rm -f $@.$$$$ |
63 |
||
64 |
include $(SRC_NAMES:%.c=build/deps/%.d) |
|
1 | 65 |
|
0 | 66 |
obj/%.o : src/%.c |
11 | 67 |
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ |
0 | 68 |
|
69 |
bin/% : obj/%.o |
|
1 | 70 |
$(CC) $(LDFLAGS) $+ $(LOADLIBES) $(LDLIBS) -o $@ |
0 | 71 |