summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2024-01-02 14:26:14 +0000
committerVincent Sanders <vince@kyllikki.org>2024-02-25 10:00:56 +0000
commit8978382f84b5f3aea640b406b7bf2a18d8608d56 (patch)
tree4c9309b983114c972d11061a32c04d3decf9fb31
parent928fbeaf9ae2105a238b3376d31fdce53318aa34 (diff)
downloadnetsurf-8978382f84b5f3aea640b406b7bf2a18d8608d56.tar.gz
netsurf-8978382f84b5f3aea640b406b7bf2a18d8608d56.tar.bz2
generate MOC output as a build artifact not in source tree
-rw-r--r--frontends/qt/Makefile22
1 files changed, 15 insertions, 7 deletions
diff --git a/frontends/qt/Makefile b/frontends/qt/Makefile
index 91e29fea7..a927cc2e4 100644
--- a/frontends/qt/Makefile
+++ b/frontends/qt/Makefile
@@ -15,10 +15,6 @@ $(eval $(call pkg_config_find_and_add,Qt6Gui,Qt6Gui))
LDFLAGS += -lm -lstdc++
-# Generate cpp from h via Qt's Meta Object Compiler
-%.moc.cpp: %.h
- $(MOC) $(IFLAGS) $< -o $@
-
# ---------------------------------------------------------------------------
# Target setup
# ---------------------------------------------------------------------------
@@ -38,6 +34,19 @@ MESSAGES_TARGET=$(FRONTEND_RESOURCES_DIR)
S_RESOURCE :=
# ----------------------------------------------------------------------------
+# Meta Object Compiler (MOC) handling
+# ----------------------------------------------------------------------------
+
+MOC_CLASS := window.cls widget.cls urlbar.cls
+
+# Generate cpp from h via Qt's Meta Object Compiler
+$(OBJROOT)/%.moc.cpp: $(FRONTEND_SOURCE_DIR)/%.h
+ $(VQ)echo " MOC: $<"
+ $(Q)$(MOC) $(IFLAGS) $< -o $@
+
+S_MOC := $(foreach CLS,$(MOC_CLASS),$(OBJROOT)/$(CLS).moc.cpp)
+
+# ----------------------------------------------------------------------------
# Source file setup
# ----------------------------------------------------------------------------
@@ -51,10 +60,9 @@ S_FRONTEND := main.cpp \
bitmap.cpp \
layout.cpp \
plotters.cpp \
- resources.cpp \
- window.cls.moc.cpp widget.cls.moc.cpp urlbar.cls.moc.cpp
+ resources.cpp
# This is the final source build list
# Note this is deliberately *not* expanded here as common and image
# are not yet available
-SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_RESOURCE) $(S_FRONTEND)
+SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_RESOURCE) $(S_FRONTEND) $(S_MOC)