blob: 88c8ec47232b1c8595992109fbdd8a503cc6cc09 [file] [log] [blame]
Emese Revfy6b90bd42016-05-24 00:09:38 +02001GCC_PLUGINS_DIR := $(shell $(CC) -print-file-name=plugin)
2
3ifeq ($(PLUGINCC),$(HOSTCC))
4 HOSTLIBS := hostlibs
5 HOST_EXTRACFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu99 -ggdb
6 export HOST_EXTRACFLAGS
7else
8 HOSTLIBS := hostcxxlibs
9 HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti
10 HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb
11 HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable
12 export HOST_EXTRACXXFLAGS
13endif
14
15export GCCPLUGINS_DIR HOSTLIBS
16
Emese Revfy543c37c2016-05-24 00:11:37 +020017ifneq ($(CFLAGS_KCOV), $(SANCOV_PLUGIN))
18 GCC_PLUGIN := $(filter-out $(SANCOV_PLUGIN), $(GCC_PLUGIN))
19endif
20
Emese Revfy6b90bd42016-05-24 00:09:38 +020021$(HOSTLIBS)-y := $(GCC_PLUGIN)
22always := $($(HOSTLIBS)-y)
23
Emese Revfy0dae7762016-05-24 00:10:35 +020024cyc_complexity_plugin-objs := cyc_complexity_plugin.o
Emese Revfy543c37c2016-05-24 00:11:37 +020025sancov_plugin-objs := sancov_plugin.o
26
Emese Revfy6b90bd42016-05-24 00:09:38 +020027clean-files += *.so