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 default: build
...@@ -14,7 +20,7 @@ cscope.files: $(CSCOPE_DIRS) ...@@ -14,7 +20,7 @@ cscope.files: $(CSCOPE_DIRS)
@echo "$(CSCOPE_FILES)" | tr " " "\n" > $@ # Very long command line quieted. @echo "$(CSCOPE_FILES)" | tr " " "\n" > $@ # Very long command line quieted.
cscope.out: cscope.files $(CSCOPE_FILES) cscope.out: cscope.files $(CSCOPE_FILES)
cscope -b mlcscope -b
src.dir: newbrt.dir src.dir: newbrt.dir
cxx.dir: src.dir cxx.dir: src.dir
......
...@@ -23,14 +23,19 @@ else ...@@ -23,14 +23,19 @@ else
endif endif
endif endif
ifeq ($(CYGWIN),cygwin) ifneq ($(CYGWIN),)
FORMAT=-Wno-format
CYG_ADD_LIBZ=/usr/lib/libz.a
else else
FPICFLAGS = -fPIC FPICFLAGS = -fPIC
# valgrind is not present on cygwin # valgrind is not present on cygwin
VGRIND = valgrind --quiet --error-exitcode=1 --leak-check=yes VGRIND = valgrind --quiet --error-exitcode=1 --leak-check=yes
VISIBILITY=-fvisibility=hidden
SHADOW=-Wshadow
FORMAT=-Wformat=2 -Wmissing-format-attribute
endif 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 LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS) -lz
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=500 CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=500
...@@ -75,7 +80,7 @@ BRT_SOURCES = \ ...@@ -75,7 +80,7 @@ BRT_SOURCES = \
trace_mem \ trace_mem \
# keep this line so I can ha vea \ on the previous line # 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 TEST_OFILES = brt-test-helpers.o
HFILES = $(wildcard *.h) HFILES = $(wildcard *.h)
......
...@@ -20,13 +20,24 @@ else ...@@ -20,13 +20,24 @@ else
endif endif
endif endif
ifeq ($(CYGWIN),cygwin) ifneq ($(CYGWIN),)
FORMAT=-Wno-format
CYG_ADD_LIBZ=/usr/lib/libz.a
else else
FPICFLAGS = -fPIC FPICFLAGS = -fPIC
# valgrind is not present on cygwin # valgrind is not present on cygwin
VGRIND = valgrind --quiet --error-exitcode=1 --leak-check=yes VGRIND = valgrind --quiet --error-exitcode=1 --leak-check=yes
VISIBILITY=-fvisibility=hidden
SHADOW=-Wshadow
FORMAT=-Wformat=2 -Wmissing-format-attribute
endif 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 HERE=newbrt/tests
ifeq ($(SUMMARIZE),1) ifeq ($(SUMMARIZE),1)
...@@ -35,10 +46,6 @@ else ...@@ -35,10 +46,6 @@ else
SUMMARIZE_CMD = SUMMARIZE_CMD =
endif 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. # Put these one-per-line so that if we insert a new one the svn diff can understand it better.
# Also keep them sorted. # Also keep them sorted.
REGRESSION_TESTS = \ REGRESSION_TESTS = \
...@@ -132,7 +139,7 @@ check_%: % ...@@ -132,7 +139,7 @@ check_%: %
$(VGRIND) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD) $(VGRIND) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD)
benchmark-test.o: ../brt.h ../brt-search.h ../../include/db.h 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 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