Makefile 885 B

1234567891011121314151617181920212223242526272829
  1. GCC_PLUGINS_DIR := $(shell $(CC) -print-file-name=plugin)
  2. ifeq ($(PLUGINCC),$(HOSTCC))
  3. HOSTLIBS := hostlibs
  4. HOST_EXTRACFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu99 -ggdb
  5. export HOST_EXTRACFLAGS
  6. else
  7. HOSTLIBS := hostcxxlibs
  8. HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti
  9. HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb
  10. HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable
  11. export HOST_EXTRACXXFLAGS
  12. endif
  13. ifneq ($(CFLAGS_KCOV), $(SANCOV_PLUGIN))
  14. GCC_PLUGIN := $(filter-out $(SANCOV_PLUGIN), $(GCC_PLUGIN))
  15. endif
  16. export HOSTLIBS
  17. $(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p)))
  18. always := $($(HOSTLIBS)-y)
  19. $(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o))
  20. subdir-y := $(GCC_PLUGIN_SUBDIR)
  21. subdir- += $(GCC_PLUGIN_SUBDIR)
  22. clean-files += *.so