blob: 1316c91e6aa2ca477b78ad524b40424c77f4f3ca [file] [log] [blame]
# @@@ 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 @@@
ifeq ($(SQ_MTYPE),32)
CXX = $(CXX32)
CC = $(CC32)
CXXFLAGS = $(GCCMODE32) $(DBG_FLGS) $(OPTIM_FLGS) $(INTEL_TOOL_FLGS)
GCCMODEXX = $(GCCMODE32) -DNA_LINUX
else
CXX = $(CXX64)
CC = $(CC64)
CXXFLAGS = $(GCCMODE64) $(DBG_FLGS) $(OPTIM_FLGS) $(INTEL_TOOL_FLGS)
GCCMODEXX = $(GCCMODE64) -DNA_LINUX -DNA_64BIT
endif
# flags
CXXFLAGS += $(DEFINES) $(CXXWARN) -std=c++0x $(GCCMODEXX)
# common rules
.CPP.o:
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $<
# common pattern rules
# Modules in current directory
$(OUTDIR)/%.o: src/%.cpp
# echo " *****FLAGS::: $(CXX) *****"
@if [ -d "$(OUTDIR)" ]; then x=1; else mkdir -p "$(OUTDIR)"; fi
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -fPIC -o $@ $<
# Modules in logging directory
$(OUTDIR)/%.o: $(TRAF_HOME)/commonLogger/CommonLogger.cpp
# echo " *****FLAGS::: $(CXX) *****"
@if [ -d "$(OUTDIR)" ]; then x=1; else mkdir -p "$(OUTDIR)"; fi
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -fPIC -o $@ $<
#
# Now, the build type -- which defines a preset group of compiler and linker
# flags as well as the "dbg" vs. "rls" subdir prefix
#
BUILD_PLAT = ${shell uname -s}-${shell uname -m}
ifeq ($(SQ_BUILD_TYPE),release)
OUTDIR := $(BUILD_PLAT)/$(SQ_MTYPE)/rls
DBG_FLGS = -g
COVER_FLGS =
OPTIM_FLGS = -O2 -fno-omit-frame-pointer
else
export SQ_BUILD_TYPE = debug
OUTDIR := $(BUILD_PLAT)/$(SQ_MTYPE)/dbg
DBG_FLGS = -g -DDBSECURITY_DEBUG
LNK_FLGS =
OPTIM_FLGS =
ifeq ($(SQ_COVERAGE),1)
COVER_FLGS = --coverage
DBG_FLGS += $(COVER_FLGS)
LNK_FLGS += $(COVER_FLGS)
endif
endif