Commit 54368c03 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #1032

Makefile ports for cygwin/Windows

git-svn-id: file:///svn/tokudb@5319 c7de825b-a66e-492c-adef-691d508d4ae1
parent b805a4a5
ifneq ($(CYGWIN),)
CSCOPE=mlcscope
else
CSCOPE=cscope
endif
default: build
......@@ -14,7 +20,7 @@ cscope.files: $(CSCOPE_DIRS)
@echo "$(CSCOPE_FILES)" | tr " " "\n" > $@ # Very long command line quieted.
cscope.out: cscope.files $(CSCOPE_FILES)
cscope -b
mlcscope -b
src.dir: newbrt.dir
cxx.dir: src.dir
......
......@@ -23,14 +23,19 @@ else
endif
endif
ifeq ($(CYGWIN),cygwin)
ifneq ($(CYGWIN),)
FORMAT=-Wno-format
CYG_ADD_LIBZ=/usr/lib/libz.a
else
FPICFLAGS = -fPIC
# valgrind is not present on cygwin
VGRIND = valgrind --quiet --error-exitcode=1 --leak-check=yes
VISIBILITY=-fvisibility=hidden
SHADOW=-Wshadow
FORMAT=-Wformat=2 -Wmissing-format-attribute
endif
CFLAGS = -Wall -W -Wcast-align -Wbad-function-cast -Wextra -Wmissing-noreturn -Wmissing-format-attribute $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS) $(PROF_FLAGS) -Werror $(FPICFLAGS) -Wshadow -fvisibility=hidden
CFLAGS = -Wall -Wextra -Wcast-align -Wbad-function-cast -Wmissing-noreturn $(FORMAT) $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS) $(PROF_FLAGS) -Werror $(FPICFLAGS) $(SHADOW) $(VISIBILITY)
LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS) -lz
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=500
......@@ -75,7 +80,7 @@ BRT_SOURCES = \
trace_mem \
# keep this line so I can ha vea \ on the previous line
OFILES = newbrt.o
OFILES = newbrt.o $(CYG_ADD_LIBZ)
TEST_OFILES = brt-test-helpers.o
HFILES = $(wildcard *.h)
......
......@@ -20,13 +20,24 @@ else
endif
endif
ifeq ($(CYGWIN),cygwin)
ifneq ($(CYGWIN),)
FORMAT=-Wno-format
CYG_ADD_LIBZ=/usr/lib/libz.a
else
FPICFLAGS = -fPIC
# valgrind is not present on cygwin
VGRIND = valgrind --quiet --error-exitcode=1 --leak-check=yes
VISIBILITY=-fvisibility=hidden
SHADOW=-Wshadow
FORMAT=-Wformat=2 -Wmissing-format-attribute
endif
CFLAGS = -Wall -Wextra -Wcast-align -Wbad-function-cast -Wmissing-noreturn $(FORMAT) $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS) $(PROF_FLAGS) -Werror $(FPICFLAGS) $(SHADOW) $(VISIBILITY)
LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS) -lz
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=500 -I..
# Add -Wconversion
HERE=newbrt/tests
ifeq ($(SUMMARIZE),1)
......@@ -35,10 +46,6 @@ else
SUMMARIZE_CMD =
endif
CFLAGS = -Wall -W -Wcast-align -Wbad-function-cast -Wextra -Wmissing-noreturn -Wmissing-format-attribute $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS) $(PROF_FLAGS) -Werror $(FPICFLAGS) -Wshadow -fvisibility=hidden
LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS) -lz
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=500 -I..
# Put these one-per-line so that if we insert a new one the svn diff can understand it better.
# Also keep them sorted.
REGRESSION_TESTS = \
......@@ -132,7 +139,7 @@ check_%: %
$(VGRIND) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD)
benchmark-test.o: ../brt.h ../brt-search.h ../../include/db.h
$(BINS): ../newbrt.o
$(BINS): ../newbrt.o $(CYG_ADD_LIBZ)
test-inc-split test-del-inorder: ../brt-test-helpers.o
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment