Makefile
author Tero Marttila <terom@fixme.fi>
Tue, 18 Nov 2008 02:06:52 +0200
changeset 42 40a3b13ffc9d
parent 41 6abda2fa4579
child 44 9e76ee9729b6
permissions -rw-r--r--
defer fuse_reply_err using event_base_once, interrupt happens without deadlock now
1
b31db3248246 a working hello
Tero Marttila <terom@fixme.fi>
parents: 0
diff changeset
     1
LIBEVENT_PATH = ../libs/libevent-dev
b31db3248246 a working hello
Tero Marttila <terom@fixme.fi>
parents: 0
diff changeset
     2
LIBFUSE_PATH = ../libs/libfuse-2.7.4
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     3
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     4
LIBRARY_PATHS = -L${LIBEVENT_PATH}/lib -L${LIBFUSE_PATH}/lib
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     5
INCLUDE_PATHS = -I${LIBEVENT_PATH}/include -I${LIBFUSE_PATH}/include
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
     6
LDLIBS = -levent -lfuse -lpq
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     7
41
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
     8
# default is test
40
03017f5f0087 add MODE param to makefile, fix INFO_DISABLED, add some constraints to the .sql, fix some -err's, EVSQL_PQ_ARBITRARY_TYPE_OID, and make read/write transactionless
Tero Marttila <terom@fixme.fi>
parents: 38
diff changeset
     9
ifndef MODE
41
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    10
MODE = test
40
03017f5f0087 add MODE param to makefile, fix INFO_DISABLED, add some constraints to the .sql, fix some -err's, EVSQL_PQ_ARBITRARY_TYPE_OID, and make read/write transactionless
Tero Marttila <terom@fixme.fi>
parents: 38
diff changeset
    11
endif
03017f5f0087 add MODE param to makefile, fix INFO_DISABLED, add some constraints to the .sql, fix some -err's, EVSQL_PQ_ARBITRARY_TYPE_OID, and make read/write transactionless
Tero Marttila <terom@fixme.fi>
parents: 38
diff changeset
    12
41
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    13
ifeq ($(MODE), debug)
40
03017f5f0087 add MODE param to makefile, fix INFO_DISABLED, add some constraints to the .sql, fix some -err's, EVSQL_PQ_ARBITRARY_TYPE_OID, and make read/write transactionless
Tero Marttila <terom@fixme.fi>
parents: 38
diff changeset
    14
MODE_CFLAGS = -g -DDEBUG_ENABLED
41
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    15
else ifeq ($(MODE), dev)
40
03017f5f0087 add MODE param to makefile, fix INFO_DISABLED, add some constraints to the .sql, fix some -err's, EVSQL_PQ_ARBITRARY_TYPE_OID, and make read/write transactionless
Tero Marttila <terom@fixme.fi>
parents: 38
diff changeset
    16
MODE_CFLAGS = -g
41
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    17
else ifeq ($(MODE), test)
40
03017f5f0087 add MODE param to makefile, fix INFO_DISABLED, add some constraints to the .sql, fix some -err's, EVSQL_PQ_ARBITRARY_TYPE_OID, and make read/write transactionless
Tero Marttila <terom@fixme.fi>
parents: 38
diff changeset
    18
MODE_CFLAGS = -g -DINFO_DISABLED
41
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    19
else ifeq ($(MODE), release)
40
03017f5f0087 add MODE param to makefile, fix INFO_DISABLED, add some constraints to the .sql, fix some -err's, EVSQL_PQ_ARBITRARY_TYPE_OID, and make read/write transactionless
Tero Marttila <terom@fixme.fi>
parents: 38
diff changeset
    20
MODE_CFLAGS = -DINFO_DISABLED -O2
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
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
    22
1
b31db3248246 a working hello
Tero Marttila <terom@fixme.fi>
parents: 0
diff changeset
    23
# XXX: ugh... use `pkg-config fuse`
40
03017f5f0087 add MODE param to makefile, fix INFO_DISABLED, add some constraints to the .sql, fix some -err's, EVSQL_PQ_ARBITRARY_TYPE_OID, and make read/write transactionless
Tero Marttila <terom@fixme.fi>
parents: 38
diff changeset
    24
DEFINES = -D_FILE_OFFSET_BITS=64
41
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    25
FIXED_CFLAGS = -Wall -std=gnu99
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    26
24
82cfdb6680d1 working dbfs.lookup
Tero Marttila <terom@fixme.fi>
parents: 20
diff changeset
    27
BIN_NAMES = helloworld hello simple_hello evpq_test url_test dbfs
19
c4b163491900 fix the all target
Tero Marttila <terom@fixme.fi>
parents: 15
diff changeset
    28
BIN_PATHS = $(addprefix bin/,$(BIN_NAMES))
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    29
41
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    30
# modules
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    31
module_objs = $(patsubst src/%.c,obj/%.o,$(wildcard src/$(1)/*.c))
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    32
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
    33
# complex modules
41
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    34
EVSQL_OBJS = $(call module_objs,evsql) obj/evpq.o
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    35
DBFS_OBJS = $(call module_objs,dbfs) obj/dirbuf.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
    36
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    37
# first target
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    38
all: ${BIN_PATHS}
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    39
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    40
# binaries
1
b31db3248246 a working hello
Tero Marttila <terom@fixme.fi>
parents: 0
diff changeset
    41
bin/helloworld: 
7
3a603d755bcb split off the dirbuf stuff into its own module
Tero Marttila <terom@fixme.fi>
parents: 6
diff changeset
    42
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
    43
bin/simple_hello: obj/evfuse.o obj/dirbuf.o obj/lib/log.o obj/lib/signals.o obj/simple.o
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    44
bin/evpq_test: obj/evpq.o obj/lib/log.o
15
a8d183e79ed9 look ma, it compiles\!
Tero Marttila <terom@fixme.fi>
parents: 11
diff changeset
    45
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
    46
bin/dbfs: ${DBFS_OBJS} ${EVSQL_OBJS} obj/evfuse.o obj/lib/log.o obj/lib/signals.o
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    47
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    48
# computed
41
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    49
LDFLAGS = ${LIBRARY_PATHS}
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    50
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    51
CPPFLAGS = ${INCLUDE_PATHS} ${DEFINES}
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 40
diff changeset
    52
CFLAGS = ${MODE_CFLAGS} ${FIXED_CFLAGS}
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    53
19
c4b163491900 fix the all target
Tero Marttila <terom@fixme.fi>
parents: 15
diff changeset
    54
SRC_PATHS = $(wildcard src/*.c) $(wildcard src/*/*.c)
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    55
SRC_NAMES = $(patsubst src/%,%,$(SRC_PATHS))
1
b31db3248246 a working hello
Tero Marttila <terom@fixme.fi>
parents: 0
diff changeset
    56
SRC_DIRS = $(dir $(SRC_NAMES))
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    57
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    58
# other targets
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    59
clean :
31
7804cd7b5cd5 write+setattr
Tero Marttila <terom@fixme.fi>
parents: 30
diff changeset
    60
	-rm obj/*.o obj/*/*.o
7804cd7b5cd5 write+setattr
Tero Marttila <terom@fixme.fi>
parents: 30
diff changeset
    61
	-rm bin/* 
7804cd7b5cd5 write+setattr
Tero Marttila <terom@fixme.fi>
parents: 30
diff changeset
    62
	-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
    63
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
    64
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
    65
	-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
    66
	-rm build/deps/*.d
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    67
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    68
#obj-dirs: 
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    69
#	python build/make_obj_dirs.py $(BIN_PATHS)
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    70
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    71
build/deps/%.d : src/%.c
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    72
	@set -e; rm -f $@; \
20
f0ef6d8880b4 fix build deps for subdirs of src
Tero Marttila <terom@fixme.fi>
parents: 19
diff changeset
    73
	 $(CC) -MM -MT __ $(CPPFLAGS) $< > $@.$$$$; \
f0ef6d8880b4 fix build deps for subdirs of src
Tero Marttila <terom@fixme.fi>
parents: 19
diff changeset
    74
	 sed 's,__[ :]*,obj/$*.o $@ : ,g' < $@.$$$$ > $@; \
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    75
	 rm -f $@.$$$$
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    76
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    77
include $(SRC_NAMES:%.c=build/deps/%.d)
1
b31db3248246 a working hello
Tero Marttila <terom@fixme.fi>
parents: 0
diff changeset
    78
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    79
obj/%.o : src/%.c
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    80
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    81
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    82
bin/% : obj/%.o
1
b31db3248246 a working hello
Tero Marttila <terom@fixme.fi>
parents: 0
diff changeset
    83
	$(CC) $(LDFLAGS) $+ $(LOADLIBES) $(LDLIBS) -o $@
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    84