2011-06-30 00:07:37 +08:00
|
|
|
CC = gcc
|
|
|
|
W = -W -Wall -Wno-unused-parameter -Wcast-qual -Wbad-function-cast
|
2011-07-01 18:56:09 +08:00
|
|
|
OPT = -O2 -g
|
|
|
|
CFLAGS = -pthread $(OPT) $(W) $(XCFLAGS)
|
2011-07-01 21:37:51 +08:00
|
|
|
LDLIBS =
|
2011-06-30 00:07:37 +08:00
|
|
|
|
2011-08-11 16:08:16 +08:00
|
|
|
all: mdb_stat mtest mtest2
|
2011-06-30 00:07:37 +08:00
|
|
|
|
|
|
|
clean:
|
2011-07-03 11:15:54 +08:00
|
|
|
rm -rf mtest mdb_stat *.[ao] *~ testdb
|
2011-06-30 00:07:37 +08:00
|
|
|
|
|
|
|
test: all
|
2011-07-03 11:15:54 +08:00
|
|
|
mkdir testdb
|
2011-06-30 00:07:37 +08:00
|
|
|
./mtest && ./mdb_stat testdb
|
|
|
|
|
2011-07-01 18:56:09 +08:00
|
|
|
mdb_stat: mdb_stat.o mdb.o idl.o
|
|
|
|
mtest: mtest.o mdb.o idl.o
|
2011-08-11 15:33:27 +08:00
|
|
|
mtest2: mtest2.o mdb.o idl.o
|
2011-06-30 00:07:37 +08:00
|
|
|
|
|
|
|
%: %.o mdb.o
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
|
|
|
|
|
|
|
|
%.o: %.c mdb.h
|
|
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
|