Emese Revfy | 6b90bd4 | 2016-05-24 00:09:38 +0200 | [diff] [blame] | 1 | GCC_PLUGINS_DIR := $(shell $(CC) -print-file-name=plugin) |
| 2 | |
| 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 |
| 14 | |
Emese Revfy | 543c37c | 2016-05-24 00:11:37 +0200 | [diff] [blame] | 15 | ifneq ($(CFLAGS_KCOV), $(SANCOV_PLUGIN)) |
| 16 | GCC_PLUGIN := $(filter-out $(SANCOV_PLUGIN), $(GCC_PLUGIN)) |
| 17 | endif |
| 18 | |
Emese Revfy | caefd8c | 2016-06-26 17:38:20 +0200 | [diff] [blame] | 19 | export HOSTLIBS |
| 20 | |
| 21 | $(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p))) |
Emese Revfy | 6b90bd4 | 2016-05-24 00:09:38 +0200 | [diff] [blame] | 22 | always := $($(HOSTLIBS)-y) |
| 23 | |
Emese Revfy | 7040c83 | 2016-06-26 17:36:43 +0200 | [diff] [blame] | 24 | $(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o)) |
Emese Revfy | 543c37c | 2016-05-24 00:11:37 +0200 | [diff] [blame] | 25 | |
Emese Revfy | caefd8c | 2016-06-26 17:38:20 +0200 | [diff] [blame] | 26 | subdir-y := $(GCC_PLUGIN_SUBDIR) |
| 27 | subdir- += $(GCC_PLUGIN_SUBDIR) |
| 28 | |
Emese Revfy | 6b90bd4 | 2016-05-24 00:09:38 +0200 | [diff] [blame] | 29 | clean-files += *.so |