Commit ca483f53 authored by John Esmet's avatar John Esmet Committed by Yoni Fogel

close[t:4954] remove some artifacts of an old build system, made obsolete by cmake


git-svn-id: file:///svn/toku/tokudb@44067 c7de825b-a66e-492c-adef-691d508d4ae1
parent aa8601e8
# -*- Mode: Makefile -*-
.DEFAULT_GOAL= default
TOKUROOT=./
include $(TOKUROOT)toku_include/Makefile.include
default: build
ifeq ($(TOKU_SKIP_CXX),1)
SRCDIRS_CXX =
else
SRCDIRS_CXX = cxx db-benchmark-test-cxx
endif
SRCDIRS = $(OS_CHOICE) ft src/range_tree src/lock_tree src utils db-benchmark-test $(SRCDIRS_CXX)
BUILDDIRS = $(SRCDIRS) man/texi
ifeq ($(OS_CHOICE),windows)
.NOTPARALLEL:; #Windows/cygwin jobserver does not properly handle submakes. Serialize
endif
ft.dir: $(OS_CHOICE).dir
src/range_tree.dir: $(OS_CHOICE).dir
src/lock_tree.dir: src/range_tree.dir
src.dir: ft.dir src/lock_tree.dir
utils.dir: src.dir
db-benchmark-test.dir: src.dir
cxx.dir: src.dir
db-benchmark-test-cxx.dir: cxx.dir
%.dir:
cd $(patsubst %.dir, %, $@) && $(MAKE) build
build: $(patsubst %,%.dir, $(BUILDDIRS))
%.build:
cd $(patsubst %.build, %,$@) && $(MAKE) build
%.local:
cd $(patsubst %.local, %,$@) && $(MAKE) local
%.check:
cd $(patsubst %.check, %,$@) && $(MAKE) check
release: linux.local ft.local src.local release.local
CHECKS = $(patsubst %,%.checkdir,$(SRCDIRS))
# This is the original check rule
# The stuff below allows "make -j2 -k check" to work
#check:
# for d in $(SRCDIRS); do (cd $$d; $(MAKE) -k check); done
%.checkdir:
cd $* && $(MAKE) -k check
summarize: SUMMARIZE=1
summarize: VERBOSE=0
summarize: check
check: $(CHECKS)
.PHONY: fastbuild fastbuildtests fastcheck fastcheckft fastcheckydb fastcheckonlyfail fastcheckonlyfailft fastcheckonlyfailydb
fastbuild:
$(MAKE) -s -k -C linux
$(MAKE) -s -k -C ft local
$(MAKE) -s -k -C src local
$(MAKE) -s -k -C utils
fastbuildtests: fastbuild
$(MAKE) -s -k -C ft/tests
$(MAKE) -s -k -C src/tests tests.tdb
fastcheck: fastcheckft fastcheckydb
fastcheckft: fastbuildtests
$(MAKE) -s -k -C ft/tests fastcheck
fastcheckydb: fastbuildtests
$(MAKE) -s -k -C src/tests fastcheck.tdb
fastcheckonlyfail: fastcheckonlyfailft fastcheckonlyfailydb
fastcheckonlyfailft: fastbuildtests
$(MAKE) -s -k -C ft/tests fastcheckonlyfail
fastcheckonlyfailydb: fastbuildtests
$(MAKE) -s -k -C src/tests fastcheckonlyfail.tdb
clean: $(patsubst %,%.dir.clean,$(SRCDIRS)) cleanlib
cleanlib:
rm -rf lib/*.$(SOEXT) $(filter-out lib/liblzma_gcc_dbg.$(AEXT) lib/liblzma_gcc_opt.$(AEXT) lib/liblzma_icc_dbg.$(AEXT) lib/liblzma_icc_opt.$(AEXT),$(wildcard lib/*.$(AEXT))) lib/*.bundle lib/*.olist
# This does not work, and probably hasn't worked since revision ~2000
# install:
# ./install.bash
# Default to building locally in one's home directory
PREFIX = $(HOME)/local
# This is a quick hack for an install rule
install: release
mkdir -p $(PREFIX)/lib $(PREFIX)/include
/bin/cp release/lib/libtokudb.so $(PREFIX)/lib
/bin/cp release/lib/libtokuportability.so $(PREFIX)/lib
/bin/cp release/include/db.h $(PREFIX)/include/tokudb.h
/bin/cp release/include/tdb-internal.h $(PREFIX)/include
/bin/cp release/include/toku_list.h $(PREFIX)/include
uninstall:
/bin/rm -f $(PREFIX)/lib/libtokudb.so $(PREFIX)/lib/libtokuportability.so
/bin/rm -f $(PREFIX)/lib/libtokuportability.so
/bin/rm -f $(PREFIX)/include/tokudb.h $(PREFIX)/include/tdb-internal.h
/bin/rm -f $(PREFIX)/include/toku_list.h
# maybe we should have a coverage target in each makefile
build-coverage:
$(MAKE) build OPTFLAGS= GCOV_FLAGS="-fprofile-arcs -ftest-coverage"
# this is messy now since we dont have consistent make targets
check-coverage: check-coverage-ft check-coverage-src-tests check-coverage-utils check-coverage-cxx-tests \
check-coverage-db-benchmark-test check-coverage-db-benchmark-test-cxx \
check-coverage-range-tree-tests check-coverage-lock-tree-tests
check-coverage-ft:
(cd ft && $(MAKE) -k check VGRIND="")
check-coverage-src-tests:
(cd src/tests && $(MAKE) -k check.tdb VGRIND="")
check-coverage-utils:
(cd utils && $(MAKE) -k test-coverage)
check-coverage-cxx-tests:
(cd cxx/tests && $(MAKE) -k check VGRIND="")
check-coverage-db-benchmark-test:
(cd db-benchmark-test && $(MAKE) -k check VGRIND="")
check-coverage-db-benchmark-test-cxx:
(cd db-benchmark-test-cxx && $(MAKE) -k check VGRIND="")
check-coverage-range-tree-tests:
(cd src/range_tree/tests && $(MAKE) clean && $(MAKE) -k check.lin VGRIND="" OPTFLAGS=-O0 GCOV_FLAGS="-fprofile-arcs -ftest-coverage")
check-coverage-lock-tree-tests:
(cd src/lock_tree/tests && $(MAKE) clean && $(MAKE) -k check.lin VGRIND="" OPTFLAGS=-O0 GCOV_FLAGS="-fprofile-arcs -ftest-coverage")
#!/bin/sh
prefix=/usr/local
while [ $# -gt 0 ] ;do
if [[ "$1" =~ "--prefix=(.*)" ]] ; then
prefix=${BASH_REMATCH[1]}
fi
shift
done
if [ ! -d include ] ; then exit 1; fi
if [[ `grep DB_VERSION_MAJOR include/db.h` =~ "DB_VERSION_MAJOR (.*)" ]] ;then
bdbmajor=${BASH_REMATCH[1]}
else
exit 1
fi
if [[ `grep DB_VERSION_MINOR include/db.h` =~ "DB_VERSION_MINOR (.*)" ]] ;then
bdbminor=${BASH_REMATCH[1]}
else
exit 1
fi
d=`basename $PWD`
if [[ $d =~ "tokudb" ]] ; then
tokudb="tokudb"
else
tokudb="tokudb-$d"
fi
targetdir=$prefix/$tokudb-$bdbmajor.$bdbminor
if [ -d $targetdir ] ; then rm -rf $targetdir ; fi
mkdir -p $targetdir
mkdir $targetdir/include
cp include/db.h $targetdir/include
cp include/db_cxx.h $targetdir/include
mkdir $targetdir/lib
cp lib/libtokudb.so $targetdir/lib
cp lib/libtokudb_cxx.a $targetdir/lib
mkdir $targetdir/bin
cp utils/tokudb_load_static $targetdir/bin/tokudb_load
cp utils/tokudb_dump_static $targetdir/bin/tokudb_dump
cp utils/tokudb_gen_static $targetdir/bin/tokudb_gen
mkdir $targetdir/man
for f in man/*.[0-9]* man/texi/*.[0-9]* ;do
if [[ $f =~ "(.*)\.(.*)" ]] ; then
manpage=${BASH_REMATCH[1]}
section=${BASH_REMATCH[2]}
mkdir -p $targetdir/man/man$section
cp $f $targetdir/man/man$section
fi
done
exit 0
SYSTEM = $(shell uname -s | tr [:upper:] [:lower:])
ARCH = $(shell uname -m | tr [:upper:] [:lower:])
ifeq ($(CYGWIN),)
OS=$(SYSTEM)
else ifneq ($(CC),icc)
OS=$(SYSTEM)
else
OS=windows
endif
ifeq ($(CC),icc)
COMPILER=icc
else
COMPILER=gcc
endif
OEXT_linux_gcc =o
OEXT_windows_icc=obj
OEXT=$(OEXT_$(OS)_$(COMPILER))
AEXT_linux_gcc =a
AEXT_windows_icc=lib
AEXT=$(AEXT_$(OS)_$(COMPILER))
SOEXT=so
COMBINE_C_windows_icc = -Qipo-c
COMBINE_C_linux_icc = -ipo-c
COMBINE_C_linux_gcc = -combine -c
COMBINE_C = $(COMBINE_C_$(OS)_$(COMPILER))
# Need XOPEN_SOURCE=600 to get strtoll()
ifeq ($(SYSTEM),linux)
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
endif
ifeq ($(SYSTEM),sunos)
CPPFLAGS+=-D_SVID_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600
endif
WALL = -Wall -Wextra -Wcast-align -Wbad-function-cast -Wno-missing-noreturn -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
W64 =
ifeq ($(CC),icc)
W64 = -Wport #-Wp64
endif
ifeq ($(SYSTEM),freebsd)
WERROR =
else
WERROR = -Werror
endif
ifneq ($(CYGWIN),)
ifeq ($(CC),icc)
#Cygwin icc only
WERROR = -WX # Windows icc version of -Werror
WERROR += -Qdiag-error:167,266,810 # Workarounds for -WX not being complete on windows icc
endif
endif
FORMAT = -Wmissing-format-attribute #-Wformat=2 #Stronger printf warnings once logger.c cleaned up
ifeq ($(CC),icc)
FORMAT= #No argument for extra format warnings.
endif
ifneq ($(CYGWIN),)
ifneq ($(CC),icc)
FORMAT = -Wno-format # cygwin gcc only
endif
endif
ifeq ($(SYSTEM),sunos)
VISIBILITY=
else
VISIBILITY= -fvisibility=hidden
endif
ifneq ($(CYGWIN),)
VISIBILITY=#Not supported
endif
FPICFLAGS = -fPIC
ifneq ($(CYGWIN),)
FPICFLAGS=#FPIC is default and not allowed as an option.
endif
SHADOW = -Wshadow
ifneq ($(CYGWIN),)
SHADOW=#Not supported
endif
ifneq ($(CC),icc)
ifeq ($(ARCH),i686)
ARCHFLAGS = -march=$(ARCH)
endif
endif
ifeq ($(CC),icc)
#icc only:
OPT_OPTFLAGS = -O3 -ip -ipo1
DBG_OPTFLAGS = -O0
else
ifneq ($(CYGWIN),)
#cygwin icc
OPT_OPTFLAGS = -Ox -Qip -Qipo1
DBG_OPTFLAGS = -Od
else
#linux icc
OPT_OPTFLAGS = -O3 -finline-functions
DBG_OPTFLAGS = -O0
endif
endif
AR=ar
DBG_ARFLAGS=cr
OPT_ARFLAGS=cr
foo:
echo $(DEBUG)
ifneq ($(DEBUG),1)
OPTFLAGS = $(OPT_OPTFLAGS)
ARFLAGS = $(OPT_ARFLAGS)
else
OPTFLAGS = $(DBG_OPTFLAGS)
ARFLAGS = $(DBG_ARFLAGS)
endif
ifneq ($(GCOV),)
GCOV_FLAGS = -fprofile-arcs -ftest-coverage -DGCOV
endif
ifneq ($(PROF),)
PROF_FLAGS = -pg
endif
ifeq ($(CC),icc)
SYMBOLS= -g -debug all -inline-debug-info
else
ifneq ($(CYGWIN),)
SYMBOLS= -Zi -debug:all -Qinline-debug-info
else
SYMBOLS = -g3 -ggdb3
endif
endif
SKIP_WARNING=
ifeq ($(CC),icc)
ifneq ($(CYGWIN),)
#Cygwin
ICC_NOWARN=-Qdiag-disable:
SKIP_WARNING += $(ICC_NOWARN)869 # Don't complain about unused variables (since we defined __attribute__ to be nothing.)
SKIP_WARNING += $(ICC_NOWARN)593 # Don't complain about unused variables (since we defined __attribute__ to be nothing.)
SKIP_WARNING += $(ICC_NOWARN)11000 # Disable message about multi-file optimization
SKIP_WARNING += $(ICC_NOWARN)11000 # Disable message about single-file optimization
SKIP_WARNING += $(ICC_NOWARN)11005 # Disable message about creating object file
SKIP_WARNING += $(ICC_NOWARN)188 # Disable message about 0 used for enum
SKIP_WARNING += $(ICC_NOWARN)1011 # Disable message about missing return with an abort
else
#Linux
ICC_NOWARN=-diag-disable #Need the space
endif
SKIP_WARNING += $(ICC_NOWARN)810 # Remove warnings about losing precision
SKIP_WARNING += $(ICC_NOWARN)94 # Allow arrays of length 0
SKIP_WARNING += $(ICC_NOWARN)118 # Allow void functions to return void functions
SKIP_WARNING += $(ICC_NOWARN)177 # Don't complain about static variables that are not used.
#SKIP_WARNING += $(ICC_NOWARN)188 # Don't complain about enumerated type mixed with another type.
SKIP_WARNING += $(ICC_NOWARN)589 # Don't complain about goto into a block that skips initializing variables. GCC catches the actual uninitialized variables.
SKIP_WARNING += $(ICC_NOWARN)981 # Don't complain about "operands are evaluated in unspecified order". This seems to be generated whenever more than one argument to a function or operand is computed by function call.
SKIP_WARNING += $(ICC_NOWARN)1324 # Don't complain about rdtsc clobbering its registers more than once.
endif
C99 = -std=c99
ifneq ($(CYGWIN),)
ifeq ($(CC),icc)
C99 = -Qstd=c99 -Qvc9
endif
endif
CCQUIET=
ifneq ($(CYGWIN),)
ifeq ($(CC),icc)
CCQUIET=-nologo
endif
endif
ifeq ($(GCCVERSION),4.4.2)
CC_VERSION_SPECIFIC_FLAGS = -Wno-deprecated
endif
CFLAGS = $(WALL) $(W64) $(WERROR) $(FORMAT) $(VISIBILITY) $(FPICFLAGS) $(SHADOW) $(ARCHFLAGS) \
$(OPTFLAGS) $(GCOV_FLAGS) $(PROF_FLAGS) \
$(SYMBOLS) $(SKIP_WARNING) $(C99) $(CCQUIET) $(CC_VERSION_SPECIFIC_FLAGS)
OOUTPUT = -o
ifneq ($(CYGWIN),)
ifeq ($(CC),icc)
OOUTPUT=-Fo
endif
endif
# TODO: 1398 Get rid of this hack.
CPPFLAGS+=-DFT_LEVEL_STRADDLE_CALLBACK_LOGIC_NOT_READY=1
CPPFLAGS+=$(CPP_DIRECTORIES)
LDFLAGS = -Wl,-rpath,libo
ifeq ($(TOKU_SKIP_CXX),1)
SRCDIRS_CXX =
else
SRCDIRS_CXX = cxx db-benchmark-test-cxx
endif
//SRCDIRS = $(OS) ft src utils db-benchmark-test $(SRCDIRS_CXX)
SRCDIRS = $(OS) buildheader ft
%.$(OEXT):%.c
$(CC) $< -c $(CPPFLAGS) $(CPPFLAGS_DIRECTORY) $(CFLAGS) $(OOUTPUT)$@
%.$(AEXT):
$(AR) $(ARFLAGS) $(AROUTPUT)$@ $(filter %.$(OEXT),$^) $(patsubst %.bundle, %.bundle/*.$(OEXT), $(filter-out %.$(OEXT),$^))
VALGRIND=valgrind
SUPPRESSIONS=no
VGRIND=$(VALGRIND) --quiet --error-exitcode=1 --leak-check=full --show-reachable=yes \
--suppressions=$(TOKUROOT)ft/valgrind.suppressions \
--suppressions=$(TOKUROOT)src/tests/bdb.suppressions \
--gen-suppressions=$(SUPPRESSIONS)
#Testing tools
ifeq ($(SUMMARIZE),1)
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sPASS\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
SUMMARIZE_SHOULD_FAIL= ;if test $$? = 0; then printf "%-60sXFAIL\n" $(HERE)/$@; else printf "%-60sXPASS\n" $(HERE)/$@ ; test 0 = 1; fi
INVERTER=;test $$? -ne 0
else
SUMMARIZE_CMD =
endif
ifeq ($(VERBOSE),2)
VERBVERBOSE=-v
MAYBEATSIGN=
else ifeq ($(VERBOSE),1)
VERBVERBOSE=
MAYBEATSIGN=
else
VERBVERBOSE=-q
MAYBEATSIGN=@
endif
CPPFLAGS += $(CPPFLAGS_DIRECTORY)
CFLAGS += $(CFLAGS_DIRECTORY)
LDFLAGS += $(LDFLAGS_DIRECTORY)
LOADLIBES += $(LOADLIBES_DIRECTORY)
%.$(SOEXT):
$(CC) -shared $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) -o $@
include $(patsubst %,%/make.include,$(SRCDIRS))
build: buildheader/build $(OS)/build ft/build
check: $(OS)/check ft/check
1. these
1. lines
1. from
1. test2.wiki
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