diff --git a/repos/libports/lib/import/import-qt5.inc b/repos/libports/lib/import/import-qt5.inc index a54259c84..6eeb717ed 100644 --- a/repos/libports/lib/import/import-qt5.inc +++ b/repos/libports/lib/import/import-qt5.inc @@ -35,20 +35,7 @@ QT_DEFINES += -D__GENODE__ CC_OPT += $(QT_DEFINES) -SOURCES_FILTERED = $(filter-out $(SOURCES_FILTER_OUT), $(SOURCES)) -HEADERS_FILTERED = $(filter-out $(HEADERS_FILTER_OUT), $(HEADERS)) - -# add sources defined in qmake project files -SRC_CC += $(SOURCES_FILTERED) - # handle moc-headers, resources and ui descriptions -$(addsuffix .o,$(basename $(SRC_CC))): $(addprefix ui_,$(FORMS:.ui=.h)) - -SRC_CC_QT_GENERATED = $(join $(dir $(HEADERS_FILTERED)),$(addprefix moc_,$(notdir $(HEADERS_FILTERED:.h=.cpp)))) \ - $(join $(dir $(RESOURCES)),$(addprefix qrc_,$(notdir $(RESOURCES:.qrc=.cpp)))) - -.SECONDARY: $(SRC_CC_QT_GENERATED) -SRC_CC += $(SRC_CC_QT_GENERATED) # # Locations of moc, rcc, and uic binaries @@ -104,10 +91,4 @@ ifneq ($(filter arm,$(SPECS)),) QT_DEFINES += -DQT_ARCH_ARMV6 endif -# remove generated files in clean rules -clean cleanall: clean_rule -clean_rule: - $(VERBOSE)$(RM) -f $(SRC_CC_QT_GENERATED) - $(VERBOSE)$(RM) -f $(SOURCES_FILTERED:.cpp=.moc) - $(VERBOSE)$(RM) -f $(addprefix ui_,$(FORMS:.ui=.h)) endif diff --git a/repos/libports/src/app/qt5/tmpl/target_final.inc b/repos/libports/src/app/qt5/tmpl/target_final.inc index e21499886..b9050ddb7 100644 --- a/repos/libports/src/app/qt5/tmpl/target_final.inc +++ b/repos/libports/src/app/qt5/tmpl/target_final.inc @@ -1,5 +1,25 @@ INC_DIR += $(PRG_DIR) +SOURCES_FILTERED = $(filter-out $(SOURCES_FILTER_OUT), $(SOURCES)) +HEADERS_FILTERED = $(filter-out $(HEADERS_FILTER_OUT), $(HEADERS)) + +# add sources defined in qmake project files +SRC_CC += $(SOURCES_FILTERED) + +# add generated sources +SRC_CC_QT_GENERATED = $(addprefix moc_,$(notdir $(HEADERS_FILTERED:.h=.cpp))) \ + $(addprefix qrc_,$(notdir $(RESOURCES:.qrc=.cpp))) + +SRC_CC += $(SRC_CC_QT_GENERATED) + +# handle relative paths in the 'HEADERS' variable +vpath %.h $(abspath $(addprefix $(PRG_DIR)/,$(sort $(dir $(HEADERS_FILTERED))))) + +# handle relative paths in the 'RESOURCES' variable +vpath %.qrc $(abspath $(addprefix $(PRG_DIR)/,$(sort $(dir $(RESOURCES))))) + +$(addsuffix .o,$(basename $(SRC_CC))): $(addprefix ui_,$(FORMS:.ui=.h)) + LIBS += libc base # QtCore