xref: /linux-6.15/scripts/gcc-plugins/Makefile (revision caefd8c9)
16b90bd4bSEmese RevfyGCC_PLUGINS_DIR := $(shell $(CC) -print-file-name=plugin)
26b90bd4bSEmese Revfy
36b90bd4bSEmese Revfyifeq ($(PLUGINCC),$(HOSTCC))
46b90bd4bSEmese Revfy  HOSTLIBS := hostlibs
56b90bd4bSEmese Revfy  HOST_EXTRACFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu99 -ggdb
66b90bd4bSEmese Revfy  export HOST_EXTRACFLAGS
76b90bd4bSEmese Revfyelse
86b90bd4bSEmese Revfy  HOSTLIBS := hostcxxlibs
96b90bd4bSEmese Revfy  HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti
106b90bd4bSEmese Revfy  HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb
116b90bd4bSEmese Revfy  HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable
126b90bd4bSEmese Revfy  export HOST_EXTRACXXFLAGS
136b90bd4bSEmese Revfyendif
146b90bd4bSEmese Revfy
15543c37cbSEmese Revfyifneq ($(CFLAGS_KCOV), $(SANCOV_PLUGIN))
16543c37cbSEmese Revfy  GCC_PLUGIN := $(filter-out $(SANCOV_PLUGIN), $(GCC_PLUGIN))
17543c37cbSEmese Revfyendif
18543c37cbSEmese Revfy
19*caefd8c9SEmese Revfyexport HOSTLIBS
20*caefd8c9SEmese Revfy
21*caefd8c9SEmese Revfy$(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p)))
226b90bd4bSEmese Revfyalways := $($(HOSTLIBS)-y)
236b90bd4bSEmese Revfy
247040c83bSEmese Revfy$(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o))
25543c37cbSEmese Revfy
26*caefd8c9SEmese Revfysubdir-y := $(GCC_PLUGIN_SUBDIR)
27*caefd8c9SEmese Revfysubdir-  += $(GCC_PLUGIN_SUBDIR)
28*caefd8c9SEmese Revfy
296b90bd4bSEmese Revfyclean-files += *.so
30