Linux 4.9.42
[linux/fpc-iii.git] / scripts / gcc-plugins / Makefile
blob8b29dc17c73cad2730531464d3528c27973cb659
1 GCC_PLUGINS_DIR := $(shell $(CC) -print-file-name=plugin)
3 ifeq ($(PLUGINCC),$(HOSTCC))
4 HOSTLIBS := hostlibs
5 HOST_EXTRACFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu99 -ggdb
6 export HOST_EXTRACFLAGS
7 else
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
13 endif
15 ifneq ($(CFLAGS_KCOV), $(SANCOV_PLUGIN))
16 GCC_PLUGIN := $(filter-out $(SANCOV_PLUGIN), $(GCC_PLUGIN))
17 endif
19 export HOSTLIBS
21 $(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p)))
22 always := $($(HOSTLIBS)-y)
24 $(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o))
26 subdir-y := $(GCC_PLUGIN_SUBDIR)
27 subdir- += $(GCC_PLUGIN_SUBDIR)
29 clean-files += *.so