| # @@@ START COPYRIGHT @@@ |
| # |
| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| # |
| # @@@ END COPYRIGHT @@@ |
| |
| TMINC=$(TRAF_HOME)/src/tm |
| INC_JAVA=$(JAVA_HOME)/include |
| INC_JAVALINUX=$(JAVA_HOME)/include/linux |
| TMOS_TRACE=0 |
| #USE_THREADED_IO = 1 indicates a multithreaded TM build. |
| ifndef USE_THREADED_IO |
| USE_THREADED_IO = 1 |
| endif |
| |
| # This allows logging |
| USE_LOGGING = 0 |
| |
| ifndef SQ_MTYPE |
| SQ_MTYPE = 32 |
| endif |
| |
| |
| # monitor |
| INCMONDIR = ../../monitor/linux |
| |
| #tm |
| LIBSTMB = -L$(LIBEXPDIR) -lutil -lsbms -lsqar |
| LIBSTMX = $(LIBSTMB) $(LIBS) $(DEBUG) |
| LIBSTM = $(LIBSTMB) -lshbasetmlib $(LIBS) $(DEBUG) |
| |
| # seabed |
| SBROOT = .. |
| INCSBDIR = $(SBROOT)/src |
| |
| # uncomment this to use static libraries |
| #USE_STATIC := 1 |
| |
| # flags |
| CFLAGS = $(DEFINES) $(CWARN) $(DFLAG) |
| CXXFLAGS = $(DEFINES) $(CXXWARN) $(DFLAG) |
| ifeq ($(SQ_BUILD_TYPE),release) |
| DFLAG = -g $(OPTIM_FLGS) |
| else |
| DFLAG = -g $(COVER_FLGS) |
| endif |
| ifneq ($(USE_STATIC),1) |
| CFLAGS += -fPIC |
| CXXFLAGS += -fPIC |
| endif |
| |
| ifeq ($(SQ_USE_INTC),1) |
| # 177=variable "<variable>" was declared but never referenced |
| # 981=operands are evaluated in unspecified order |
| # 1418=external funciton definition with no prior declaration |
| # 1684=conversion from "long long" to "long" may lose significant bits |
| IOPTS = -Wall -Werror -wd177 -wd981 -wd1418 -wd383 -wd869 -wd1684 -Wcheck -Wp64 |
| CWARN = $(HPCWARN) $(IOPTS) |
| CXXWARN = $(HPCXXWARN) $(IOPTS) |
| # |
| ifeq ($(SQ_BUILD_TYPE),release) |
| DFLAG = -g $(OPTIM_FLGS) |
| else |
| DFLAG = -g |
| endif |
| else |
| CWARN = -Wall -Werror -Wextra $(HPCWARN) -Wno-long-long |
| CXXWARN = -Wall -Werror -Wextra $(HPCXXWARN) -Wno-long-long |
| endif |
| ifeq ($(SQ_USE_INTC),0) |
| HPCWARN = -Wno-unused-parameter |
| HPCXXWARN = -Wno-unused-parameter -Wno-non-virtual-dtor |
| endif |
| INCLUDES = -I$(INCEXPDIR) -I$(INCMONDIR) -I$(TMINC) -I$(TRAF_HOME)/export/include -I$(MY_SPROOT)/export/include -I$(MY_SPROOT)/source/publications -I$(PROTOBUFS_INC) -I$(INC_JAVA) -I$(INC_JAVALINUX) -I$(TRAF_HOME)/commonLogger -I$(LOG4CXX_INC_DIR) -I$(LOG4CXX_INC_DIR)/lib4cxx |
| |
| LIBSSB = -L$(JAVA_HOME)/jre/lib/i386/client -L$(JAVA_HOME)/jre/lib/amd64/server -L$(LIBEXPDIR) -ltmjni -ljvm |
| |
| #LIBSX = -lpthread |
| LIBSX = -pthread |
| ifeq ($(USE_THREADED_IO),1) |
| LIBSX = -lmtmpi |
| endif |
| #LIBSTHX = -lpthread |
| LIBSTHX = -pthread |
| USE_DMALLOC=0 |
| ifeq ($(USE_DMALLOC),1) |
| INCLUDES += -I$(DMALLOCROOT) |
| LIBSX += -L$(DMALLOCROOT) -l dmallocthcxx |
| LIBSTHX += -L$(DMALLOCROOT) -l dmallocthcxx |
| endif |
| |
| # depend |
| DEPFLAGS = $(DEFINES) $(INCLUDES) -f depend.mk $(DEPEXCLUDES) -out '$$(OUTDIR)' |
| |
| # lib suffix |
| ifeq ($(USE_STATIC),1) |
| LIBSUF = a |
| else |
| LIBSUF = so |
| endif |
| |
| # seabed libs |
| LIBSBFS = $(LIBEXPDIR)/libsbfs.$(LIBSUF) $(LIBEXPDIR)/libsbms.$(LIBSUF) |
| LIBSBFSX = -L$(LIBEXPDIR) -lsbfs -lsbms |
| LIBSBMS = $(LIBEXPDIR)/libsbms.$(LIBSUF) |
| LIBSBMSX = -L$(LIBEXPDIR) -lsbms |
| LIBSBTS = $(LIBEXPDIR)/libsbts.$(LIBSUF) |
| LIBSBTSX = -L$(LIBEXPDIR) -lsbts |
| |
| # DTM TM objects |
| TMOBJLOC = $(TRAF_HOME)/src/tm/$(OUTDIR) |
| # common rules |
| .c.o: |
| $(CC) $(CDEPFLAGS) $(CFLAGS) $(INCLUDES) -c $< |
| |
| .cpp.o: |
| $(CXX) $(CDEPFLAGS) -pthread $(CXXFLAGS) $(INCLUDES) -c $< |
| |
| .cc.o: |
| $(CXX) $(CDEPFLAGS) $(CXXFLAGS) $(INCLUDES) -c $< |
| |
| # common pattern rules |
| $(OUTDIR)/%.o: %.c |
| $(CC) $(CDEPFLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
| |
| $(OUTDIR)/%.o: %.cpp |
| $(CXX) $(CDEPFLAGS) $(CXXFLAGS) $(INCLUDES) -c -o $@ $< |
| |
| $(OUTDIR)/%.o: %.cc |
| $(CXX) $(CDEPFLAGS) $(CXXFLAGS) $(INCLUDES) -c -o $@ $< |
| |