Makefile
author Tero Marttila <terom@fixme.fi>
Sat, 13 Dec 2008 19:55:50 +0200
branchnew-evsql
changeset 53 0d6e07f4c9a1
parent 52 f5037572c326
permissions -rw-r--r--
separate evsql documentation
1
b31db3248246 a working hello
Tero Marttila <terom@fixme.fi>
parents: 0
diff changeset
     1
LIBEVENT_PATH = ../libs/libevent-dev
44
9e76ee9729b6 more work on the new evsql interface
Tero Marttila <terom@fixme.fi>
parents: 41
diff changeset
     2
LIBFUSE_PATH = ../opt
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
45
424ce5ab82fd compiles + some basic evsql_test
Tero Marttila <terom@fixme.fi>
parents: 44
diff changeset
    27
BIN_NAMES = helloworld hello simple_hello evpq_test url_test dbfs evsql_test
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
45
424ce5ab82fd compiles + some basic evsql_test
Tero Marttila <terom@fixme.fi>
parents: 44
diff changeset
    34
CORE_OBJS = obj/lib/log.o obj/lib/signals.o
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
    35
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
    36
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
    37
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    38
# first target
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    39
all: ${BIN_PATHS}
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    40
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    41
# binaries
1
b31db3248246 a working hello
Tero Marttila <terom@fixme.fi>
parents: 0
diff changeset
    42
bin/helloworld: 
45
424ce5ab82fd compiles + some basic evsql_test
Tero Marttila <terom@fixme.fi>
parents: 44
diff changeset
    43
bin/hello: obj/evfuse.o obj/dirbuf.o ${CORE_OBJS}
424ce5ab82fd compiles + some basic evsql_test
Tero Marttila <terom@fixme.fi>
parents: 44
diff changeset
    44
bin/simple_hello: obj/evfuse.o obj/dirbuf.o obj/simple.o ${CORE_OBJS}
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    45
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
    46
bin/url_test: obj/lib/url.o obj/lib/lex.o obj/lib/log.o
45
424ce5ab82fd compiles + some basic evsql_test
Tero Marttila <terom@fixme.fi>
parents: 44
diff changeset
    47
bin/dbfs: ${DBFS_OBJS} ${EVSQL_OBJS} obj/evfuse.o ${CORE_OBJS}
424ce5ab82fd compiles + some basic evsql_test
Tero Marttila <terom@fixme.fi>
parents: 44
diff changeset
    48
bin/evsql_test: ${EVSQL_OBJS} ${CORE_OBJS}
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    49
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    50
# 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
    51
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
    52
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
    53
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
    54
CFLAGS = ${MODE_CFLAGS} ${FIXED_CFLAGS}
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    55
19
c4b163491900 fix the all target
Tero Marttila <terom@fixme.fi>
parents: 15
diff changeset
    56
SRC_PATHS = $(wildcard src/*.c) $(wildcard src/*/*.c)
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    57
SRC_NAMES = $(patsubst src/%,%,$(SRC_PATHS))
1
b31db3248246 a working hello
Tero Marttila <terom@fixme.fi>
parents: 0
diff changeset
    58
SRC_DIRS = $(dir $(SRC_NAMES))
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    59
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    60
# other targets
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    61
clean :
31
7804cd7b5cd5 write+setattr
Tero Marttila <terom@fixme.fi>
parents: 30
diff changeset
    62
	-rm obj/*.o obj/*/*.o
7804cd7b5cd5 write+setattr
Tero Marttila <terom@fixme.fi>
parents: 30
diff changeset
    63
	-rm bin/* 
7804cd7b5cd5 write+setattr
Tero Marttila <terom@fixme.fi>
parents: 30
diff changeset
    64
	-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
    65
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
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
    67
	-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
    68
	-rm build/deps/*.d
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    69
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    70
#obj-dirs: 
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    71
#	python build/make_obj_dirs.py $(BIN_PATHS)
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    72
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    73
build/deps/%.d : src/%.c
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    74
	@set -e; rm -f $@; \
20
f0ef6d8880b4 fix build deps for subdirs of src
Tero Marttila <terom@fixme.fi>
parents: 19
diff changeset
    75
	 $(CC) -MM -MT __ $(CPPFLAGS) $< > $@.$$$$; \
f0ef6d8880b4 fix build deps for subdirs of src
Tero Marttila <terom@fixme.fi>
parents: 19
diff changeset
    76
	 sed 's,__[ :]*,obj/$*.o $@ : ,g' < $@.$$$$ > $@; \
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    77
	 rm -f $@.$$$$
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    78
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    79
include $(SRC_NAMES:%.c=build/deps/%.d)
1
b31db3248246 a working hello
Tero Marttila <terom@fixme.fi>
parents: 0
diff changeset
    80
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    81
obj/%.o : src/%.c
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 7
diff changeset
    82
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    83
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    84
bin/% : obj/%.o
1
b31db3248246 a working hello
Tero Marttila <terom@fixme.fi>
parents: 0
diff changeset
    85
	$(CC) $(LDFLAGS) $+ $(LOADLIBES) $(LDLIBS) -o $@
0
487cbfbafa2c initial untested code...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    86
52
f5037572c326 improved evsql docs and added a doxygen config file
Tero Marttila <terom@fixme.fi>
parents: 45
diff changeset
    87
# documentation
f5037572c326 improved evsql docs and added a doxygen config file
Tero Marttila <terom@fixme.fi>
parents: 45
diff changeset
    88
DOXYGEN_PATH = /usr/bin/doxygen
f5037572c326 improved evsql docs and added a doxygen config file
Tero Marttila <terom@fixme.fi>
parents: 45
diff changeset
    89
DOXYGEN_CONF_PATH = doc/doxygen.conf
f5037572c326 improved evsql docs and added a doxygen config file
Tero Marttila <terom@fixme.fi>
parents: 45
diff changeset
    90
DOXYGEN_OUTPUT_FILE = doc/html/index.html
f5037572c326 improved evsql docs and added a doxygen config file
Tero Marttila <terom@fixme.fi>
parents: 45
diff changeset
    91
f5037572c326 improved evsql docs and added a doxygen config file
Tero Marttila <terom@fixme.fi>
parents: 45
diff changeset
    92
docs :
f5037572c326 improved evsql docs and added a doxygen config file
Tero Marttila <terom@fixme.fi>
parents: 45
diff changeset
    93
	${DOXYGEN_PATH} ${DOXYGEN_CONF_PATH}
f5037572c326 improved evsql docs and added a doxygen config file
Tero Marttila <terom@fixme.fi>
parents: 45
diff changeset
    94