Commit 7a49843b authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:4462] fixing makefiles to build profilable binaries with PROF=1

git-svn-id: file:///svn/toku/tokudb@39696 c7de825b-a66e-492c-adef-691d508d4ae1
parent dd856137
......@@ -19,6 +19,7 @@ DEPEND_COMPILE += \
# keep this line so I can have a \ on the previous line
NEWBRT_SO = $(TOKUROOT)lib/libnewbrt.$(SOEXT)
NEWBRT_A = $(TOKUROOT)lib/libnewbrt.$(AEXT)
SKIP_NEWBRTRULE=1
include $(TOKUROOT)toku_include/Makefile.include
......@@ -121,6 +122,7 @@ $(NEWBRT_SO): DISABLE_WARNING += 10237 # Do not complain about -lcilkrts being l
$(NEWBRT_SO): $(NEWBRT_O_FILES)
echo $(patsubst %,newbrt/%,$(NEWBRT_O_FILES)) > ../lib/newbrt.olist
$(TOKULINKER) $(SHARED) $(SYMBOLS) $(GCOV_FLAGS) $(SKIP_WARNING) $(NEWBRT_O_FILES) -o$(NEWBRT_SO) $(LINUX_NOSTDLIB) $(LCILKRTS)
$(NEWBRT_A): $(NEWBRT_O_FILES)
log_code.$(OEXT): log_header.h wbuf.h log-internal.h rbuf.h
......@@ -139,7 +141,11 @@ logformat$(BINSUF): logformat.c $(LIBPORTABILITY_SO)
$(CC) $< $(BIN_FROM_O_FLAGS_NOLIB) $(LDFLAGS) $(ALWAYS_LINK) $(LINK_MUST_BE_LAST) $(LIBPORTABILITY_SO)
ifeq ($(PROF),1)
libs: $(NEWBRT_A)
else
libs: $(NEWBRT_SO)
endif
bins: $(BINS)
# Put the benchmarktest_256 first since it takes the longest (and we want to use parallelism in the make)
......@@ -148,7 +154,11 @@ bins: $(BINS)
check: bins
cd tests;$(MAKE) check
ifeq ($(PROF),1)
$(BINS): $(NEWBRT_A) $(LIBPORTABILITY_SO)
else
$(BINS): $(NEWBRT_SO) $(LIBPORTABILITY_SO)
endif
foo2:
echo $(BINS)
......
......@@ -12,7 +12,11 @@ DEPEND_COMPILE += \
include $(TOKUROOT)toku_include/Makefile.include
CPPFLAGS+=-D_GNU_SOURCE -D_THREAD_SAFE
ifeq ($(PROF),1)
LIBRARY=../lib/lib$(LIBTOKUDB).$(AEXT)
else
LIBRARY=../lib/lib$(LIBTOKUDB).$(SOEXT)
endif
OBJS_RAW = \
ydb_lib \
......
......@@ -24,10 +24,24 @@ LIBTDB=$(WIN_YDB)
%.tdb$(BINSUF): LINK_FILES+=$(WIN_YDB)
TDB_EXTRA_NEEDED=$(WIN_YDB)
else
ifeq ($(PROF),1)
LIBTDB=../../lib/lib$(LIBTOKUDB).$(AEXT)
STATIC_LIBS_NEEDED= \
../ydb_lib.$(OEXT) \
$(LIBTDB) \
$(LOCKTREE) \
$(RANGETREE) \
../../lib/libnewbrt.$(AEXT) \
# last line
TLIBTDB=../libtokudbtrace.$(SOEXT)
%.tdb$(BINSUF): LINK_FILES+=$(STATIC_LIBS_NEEDED)
%.tdb$(BINSUF): RPATH_DIRS+=$(TOKUROOT)/lib
else
LIBTDB=../../lib/lib$(LIBTOKUDB).$(SOEXT)
TLIBTDB=../libtokudbtrace.$(SOEXT)
%.tdb$(BINSUF): DLINK_FILES+=$(LIBTDB)
%.tdb$(BINSUF): RPATH_DIRS+=$(patsubst %/,%,$(dir $(LIBTDB)))
endif
endif
RECOVER_SRCS = $(wildcard recover-*.c)
......
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