jw-pkg/make/profiler-defs.mk
Jan Lindemann 58ab619f0b make: Rename CFLAGS, CXXFLAGS and CPPFLAGS variables
Rename CFLAGS and friends to follow the conventions of the implicit rules
defined by GNU Make:

 - $(CPPFLAGS) is passed to both C++ and C compiler
 - $(CXXFLAGS) is passed to C++ compiler only
 - $(CFLAGS) is passed to C compiler only
 - C++ compiler is in $(CXX)

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-19 07:07:00 +00:00

30 lines
859 B
Makefile

all:
clean:
PROF_EXE_PATH ?= $(EXE_PATH)
CALLGRIND_OUT ?= callgrind.out
OPROF_OUT_DIR ?= oprofile-data
ifeq ($(USE_GPROF),true)
PROJECT_CXXFLAGS += -pg
PROJECT_CFLAGS += -pg
PROJECT_LDFLAGS += -pg
clean: clean.gprof
endif
ifeq ($(COMPILER_SUITE),gcc)
ifeq ($(USE_GCOV),true)
PROJECT_CXXFLAGS += -fprofile-arcs -ftest-coverage
PROJECT_CFLAGS += -fprofile-arcs -ftest-coverage
PROJECT_LDFLAGS += -fprofile-arcs -ftest-coverage
clean: clean.gcov
endif
endif
ifeq ($(COMPILER_SUITE),clang)
ifeq ($(USE_XRAY),true)
PROJECT_CXXFLAGS += -fxray-instrument -fxray-instruction-threshold=1
PROJECT_CFLAGS += -fxray-instrument -fxray-instruction-threshold=1
#PROJECT_LDFLAGS += -fxray-instrument
endif
endif