mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 18:20:27 +00:00
25 lines
643 B
Makefile
25 lines
643 B
Makefile
include Makefile.common
|
|
|
|
# Qt MOC generation, required for QObject-derived classes
|
|
ifneq ($(MOC_HEADERS),)
|
|
# prefix moc_ to base filename of paths and change extension from h to cpp, so a/b/foo.h becomes a/b/moc_foo.cpp
|
|
MOC_SRC := $(join $(addsuffix moc_,$(dir $(MOC_HEADERS))), $(notdir $(MOC_HEADERS:.h=.cpp)))
|
|
endif
|
|
|
|
MOC ?= $(error missing moc path)
|
|
|
|
.PHONY: generate
|
|
|
|
$(MOC_SRC):
|
|
@$(if $(Q), $(shell echo echo MOC $<),)
|
|
$(eval MOC_TMP := $(patsubst %.h,%_moc.cpp,$@))
|
|
$(MOC) -o $(MOC_TMP) $<
|
|
|
|
$(foreach x,$(join $(addsuffix :,$(MOC_SRC)),$(MOC_HEADERS)),$(eval $x))
|
|
|
|
generate: $(MOC_SRC)
|
|
@echo $(MOC_SRC)
|
|
|
|
print-%:
|
|
@echo '$*=$($*)'
|