Commit 0207163a authored by Yoni Fogel's avatar Yoni Fogel

Addresses #1442

Use MT instead of MD by default for windows.
In windows, newbrt and src tests use static libraries (pre-ipo with optimization, standard without)

git-svn-id: file:///svn/toku/tokudb@9235 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6a115f27
......@@ -11,6 +11,7 @@ DEPEND_COMPILE += \
# keep this line so I can have a \ on the previous line
NEWBRT = newbrt.$(AEXT)
IPO_NEWBRT = ipo_newbrt.$(AEXT)
NEWBRT_BUNDLE = newbrt.bundle
#All executables need to statically link to newbrt
LINK_FILES += $(NEWBRT)
......@@ -81,6 +82,13 @@ endif
$(NEWBRT): $(NEWBRT_O_FILES)
ipo_newbrt.obj: $(NEWBRT_BUNDLE)
$(CC) $(CFLAGS) $(CPPFLAGS) -Qipo-c $(filter %.$(OEXT),$^) $(patsubst %.bundle, %.bundle/*.$(OEXT), $(filter-out %.$(OEXT),$^))
mv ipo_out.obj $@
$(IPO_NEWBRT): ipo_newbrt.obj
xilib /out:$@ $^
log_code.$(OEXT): log_header.h wbuf.h log-internal.h rbuf.h
log_header.h log_code.c: logformat$(BINSUF)
./logformat
......
.DEFAULT_GOAL=build
TOKUROOT=../../
INCLUDEDIRS=-I. -I..
ifeq ($(CYGWIN),)
LINK_FILES += $(NEWBRT)
else ifneq ($(CC),icc)
LINK_FILES += $(NEWBRT)
else ifeq ($(DEBUG),0)
LINK_FILES += $(IPO_NEWBRT)
else ifeq ($(DEBUG),)
LINK_FILES += $(IPO_NEWBRT)
else
LINK_FILES += $(NEWBRT)
endif
include $(TOKUROOT)toku_include/Makefile.include
CPPFLAGS+=-D_GNU_SOURCE
......@@ -137,7 +150,6 @@ check_%: %
benchmark-test.$(OEXT): ../brt.h ../brt-search.h ../../include/db.h
LINK_FILES += ../newbrt.$(AEXT)
clean:
rm -rf log-test7.c.dir_*
......
......@@ -19,6 +19,9 @@ YDB_BUNDLE=ydb.bundle
TYDB=tydb.$(AEXT)
TYDB_BUNDLE=tydb.bundle
IPO_YDB = ipo_libtokudb.$(AEXT)
NOIPO_YDB = static_libtokudb.$(AEXT)
LIBNAME=libtokudb
TLIBNAME=libtokudbtrace
......@@ -100,14 +103,14 @@ $(TLIBRARY_S): $(TLIBRARY) ;
#$(TLIBRARY_S): $(TYDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(LIBPORTABILITY)
endif
static_libtokudb.lib: $(YDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT)
$(NOIPO_YDB): $(YDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT)
xilib /out:$@ $^
ipo_libtokudb.obj: $(YDB_BUNDLE) $(LOCKTREE_BUNDLE) $(RANGETREE_BUNDLE) $(NEWBRT_BUNDLE)
$(CC) $(CFLAGS) $(CPPFLAGS) -Qipo-c $(filter %.$(OEXT),$^) $(patsubst %.bundle, %.bundle/*.$(OEXT), $(filter-out %.$(OEXT),$^))
mv ipo_out.obj $@
ipo_libtokudb.lib: ipo_libtokudb.obj
$(IPO_YDB): ipo_libtokudb.obj
xilib /out:$@ $^
......
......@@ -166,14 +166,27 @@ endif
%.bdb$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK)
$(CC) $< $(BIN_FROM_C_FLAGS)
TDB_EXTRA_NEEDED=
ifeq ($(CYGWIN),)
%.tdb$(BINSUF): DLINK_FILES+=$(LIBTDB)
%.tdb$(BINSUF): RPATH_DIRS+=$(dir $(LIBTDB))
else ifneq ($(CC),icc)
%.tdb$(BINSUF): DLINK_FILES+=$(LIBTDB)
%.tdb$(BINSUF): RPATH_DIRS+=$(dir $(LIBTDB))
else ifeq ($(DEBUG),0)
%.tdb$(BINSUF): LINK_FILES+=$(IPO_YDB)
TDB_EXTRA_NEEDED=$(IPO_YDB)
else
%.tdb$(BINSUF): LINK_FILES+=$(NOIPO_YDB)
TDB_EXTRA_NEEDED=$(NOIPO_YDB)
endif
%.tdbt$(BINSUF): DLINK_FILES+=$(TLIBTDB)
%.tdbt$(BINSUF): RPATH_DIRS+=$(dir $(TLIBTDB))
%.tdb$(BINSUF) %.tdbt$(BINSUF): CFLAGS+= -DENVDIR=\"dir.$<.tdb\" -DUSE_TDB -DIS_TDB=1
%.tdb$(BINSUF) %.tdbt$(BINSUF): CPPFLAGS+=-I$(TOKUROOT)include
%.tdb$(BINSUF) %.tdbt$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK)
%.tdb$(BINSUF) %.tdbt$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK) $(TDB_EXTRA_NEEDED)
$(CC) $< $(filter-out ../../lib/libtokuportability.a,$(BIN_FROM_C_FLAGS))
clean:
......
......@@ -200,9 +200,9 @@ ifneq ($(CYGWIN),)
#Cygwin icc only
ifeq ($(CRUNTIME),)
ifeq ($(DEBUG),0)
CRUNTIME=MD
CRUNTIME=MT
else
CRUNTIME=MDd
CRUNTIME=MTd
endif
endif
ALWAYS_LINK=$(LIBPORTABILITY) $(TOKUROOT)windows/lib/$(CRUNTIME)/zlib.lib Ws2_32.lib psapi.lib
......@@ -331,7 +331,7 @@ LOCKTREE_BUNDLE = $(TOKUROOT)src/lock_tree/locktree.bundle
LOCKTREE_LINEAR = $(TOKUROOT)src/lock_tree/locktree_linear.$(AEXT)
LOCKTREE_TLOG = $(TOKUROOT)src/lock_tree/locktree_tlog.$(AEXT)
LOCKTREE_LOG = $(TOKUROOT)src/lock_tree/locktree_log.$(AEXT)
$(LOCKTREE) $(LOCKTREE_LINEAR) $(LOCKTREE_TLOG) $(LOCKTREE_LOG): $(@D)*.[ch]
$(LOCKTREE) $(LOCKTREE_LINEAR) $(LOCKTREE_TLOG) $(LOCKTREE_LOG) $(LOCKTREE_BUNDLE): $(@D)*.[ch]
cd $(@D) && $(MAKE) $(@F)
endif
......@@ -341,14 +341,22 @@ RANGETREE_BUNDLE = $(TOKUROOT)src/range_tree/rangetree.bundle
RANGETREE_LINEAR = $(TOKUROOT)src/range_tree/rangetree_linear.$(AEXT)
RANGETREE_TLOG = $(TOKUROOT)src/range_tree/rangetree_tlog.$(AEXT)
RANGETREE_LOG = $(TOKUROOT)src/range_tree/rangetree_log.$(AEXT)
$(RANGETREE) $(RANGETREE_LINEAR) $(RANGETREE_TLOG) $(RANGETREE_LOG): $(@D)*.[ch]
$(RANGETREE) $(RANGETREE_LINEAR) $(RANGETREE_TLOG) $(RANGETREE_LOG) $(RANGETREE_BUNDLE): $(@D)*.[ch]
cd $(@D) && $(MAKE) $(@F)
endif
ifeq ($(SKIP_NEWBRTRULE),)
IPO_NEWBRT = $(TOKUROOT)newbrt/ipo_newbrt.$(AEXT)
NEWBRT = $(TOKUROOT)newbrt/newbrt.$(AEXT)
NEWBRT_BUNDLE = $(TOKUROOT)newbrt/newbrt.bundle
$(NEWBRT): $(@D)*.[ch]
$(NEWBRT) $(NEWBRT_BUNDLE) $(IPO_NEWBRT): $(@D)*.[ch]
cd $(@D) && $(MAKE) $(@F)
endif
ifeq ($(SKIP_YDBRULE),)
IPO_YDB = $(TOKUROOT)src/ipo_libtokudb.$(AEXT)
NOIPO_YDB = $(TOKUROOT)src/static_libtokudb.$(AEXT)
$(NOIPO_YDB) $(IPO_YDB): $(@D)*.[ch]
cd $(@D) && $(MAKE) $(@F)
endif
......
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