2013-04-16 23:59:38 -04:00
|
|
|
SRCS = $(wildcard *.c)
|
|
|
|
TARGETS = $(patsubst %.c,%,$(SRCS)) $(patsubst %.c,%-bdb,$(SRCS))
|
2013-04-16 23:59:38 -04:00
|
|
|
CPPFLAGS = -I../include -D_GNU_SOURCE
|
2013-04-16 23:59:38 -04:00
|
|
|
CFLAGS = -g -std=c99 -Wall
|
2013-04-17 00:00:52 -04:00
|
|
|
ifeq ($(USE_STATIC_LIBS),1)
|
|
|
|
LIBTOKUDB = tokudb_static
|
|
|
|
LIBTOKUPORTABILITY = tokuportability_static
|
|
|
|
else
|
2013-04-16 23:58:57 -04:00
|
|
|
LIBTOKUDB = tokudb
|
2013-04-17 00:00:02 -04:00
|
|
|
LIBTOKUPORTABILITY = tokuportability
|
2013-04-17 00:00:52 -04:00
|
|
|
endif
|
|
|
|
LDFLAGS = -L../lib -l$(LIBTOKUDB) -l$(LIBTOKUPORTABILITY) -Wl,-rpath,../lib -lpthread -lz -ldl
|
2013-04-16 23:58:54 -04:00
|
|
|
|
2013-04-17 00:00:02 -04:00
|
|
|
default local: $(TARGETS)
|
2013-04-16 23:58:54 -04:00
|
|
|
|
2013-04-17 00:00:51 -04:00
|
|
|
%: %.c
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS)
|
|
|
|
|
2013-04-16 23:59:38 -04:00
|
|
|
%-bdb: %.c
|
|
|
|
$(CC) -D_GNU_SOURCE -DBDB $(CFLAGS) $^ -o $@ -ldb
|
2013-04-16 23:57:56 -04:00
|
|
|
|
2013-04-16 23:58:54 -04:00
|
|
|
check: $(TARGETS)
|
2013-04-16 23:59:15 -04:00
|
|
|
./db-insert -x && ./db-scan --lwc --prelock --prelockflag
|
|
|
|
|
|
|
|
checknox: $(TARGETS)
|
2013-04-16 23:58:54 -04:00
|
|
|
./db-insert && ./db-scan --nox --lwc --prelock --prelockflag
|
2013-04-16 23:58:54 -04:00
|
|
|
|
2013-04-16 23:57:56 -04:00
|
|
|
clean:
|
2013-04-16 23:59:38 -04:00
|
|
|
rm -rf $(TARGETS) bench.* update.env.* insertm.env.*
|