Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: threads
Fetching contributors…

Cannot retrieve contributors at this time

100 lines (81 sloc) 2.014 kb
#
# Configurable options
# MODE = release | debug (default: debug)
# SNAPPY = 0 | 1 (default: 1)
#
# Darwin only:
# ARCH = i386 | x86_64
#
CSTDFLAG = --std=c89 -pedantic -Wall -Wextra -Wno-unused-parameter
CPPFLAGS += -fPIC
CPPFLAGS += -Iinclude -Ideps/snappy
CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# darwin supports compilation for both x64 and i386 platforms
ifeq ($(ARCH),i386)
CPPFLAGS += -arch i386
endif
ifeq ($(MODE),release)
CPPFLAGS += -O3
else
CFLAGS += -g
DEFINES += -DNDEBUG
endif
# run make with SNAPPY=0 to turn it off
ifneq ($(SNAPPY),0)
DEFINES += -DBP_USE_SNAPPY=1
else
DEFINES += -DBP_USE_SNAPPY=0
endif
all: bplus.a
OBJS =
ifneq ($(SNAPPY),0)
OBJS += deps/snappy/snappy-sinksource.o
OBJS += deps/snappy/snappy.o
OBJS += deps/snappy/snappy-c.o
endif
OBJS += src/threads.o
OBJS += src/compressor.o
OBJS += src/utils.o
OBJS += src/writer.o
OBJS += src/values.o
OBJS += src/pages.o
OBJS += src/bplus.o
DEPS=
DEPS += include/bplus.h
DEPS += include/private/errors.h
DEPS += include/private/pages.h
DEPS += include/private/values.h
DEPS += include/private/tree.h
DEPS += include/private/utils.h
DEPS += include/private/compressor.h
DEPS += include/private/threads.h
DEPS += include/private/writer.h
bplus.a: $(OBJS)
$(AR) rcs bplus.a $(OBJS)
src/%.o: src/%.c $(DEPS)
$(CC) $(CFLAGS) $(CSTDFLAG) $(CPPFLAGS) $(DEFINES) -c $< -o $@
deps/snappy/%.o: deps/snappy/%.cc
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
LINKFLAGS = -lpthread
TESTS =
TESTS += test/test-api
TESTS += test/test-reopen
TESTS += test/test-range
TESTS += test/test-corruption
TESTS += test/test-bulk
TESTS += test/test-threaded-rw
TESTS += test/bench-basic
TESTS += test/bench-bulk
TESTS += test/bench-multithread-get
test: $(TESTS)
@test/test-api
@test/test-reopen
@test/test-range
@test/test-bulk
@test/test-corruption
@test/test-threaded-rw
test/%: test/%.cc bplus.a
$(CXX) $(CFLAGS) $(CPPFLAGS) $(LINKFLAGS) $< -o $@ bplus.a
clean:
@rm -f $(OBJS) $(TESTS)
.PHONY: all test
Jump to Line
Something went wrong with that request. Please try again.