summaryrefslogtreecommitdiffstats
path: root/config.profiles/symbian/qtconfig.flm
blob: aa5e05ad68fd21119fc2650c94e7e562142b7952 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# /****************************************************************************
# **
# ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
# ** Contact:
# **
# ****************************************************************************/

# FLM to build Qt tools.

QT_ROOT:= ../..
TARGETDIR:=$(EPOCROOT)/$(INSTALLPATH)
MKSPECDIR:=$(EPOCROOT)/$(INSTALLPATH)/qt
TOOLSBINDIR:=$(EXTENSION_ROOT)/$(QT_ROOT)/bin
TOOLSSRCDIR:=$(EXTENSION_ROOT)/$(QT_ROOT)/src/tools
LANGUAGETOOLDIR:=$(EXTENSION_ROOT)/$(QT_ROOT)/tools/linguist
CONFIGURE_APP:=configure$(DOTEXE)
BOOTSTRAP_LIB:=$(TOOLSSRCDIR)/bootstrap/libbootstrap.a

$(call makepath,$(TARGETDIR))

WHATTARGETS:=
CLEANTARGETS:=

ifneq ($(filter linux,$(HOSTPLATFORM)),)
PLATFORM:=$(PLATFORM.LINUX)
else
PLATFORM:=$(PLATFORM.WIN32)
endif

QT_TOOLS:=uic moc rcc

# Build every tool with it's own target
define qt_tool

TARGET:: $(TARGETDIR)/$1$(DOTEXE)

WHATTARGETS:=$$(WHATTARGETS) $(TARGETDIR)/$1$(DOTEXE) $(TOOLSBINDIR)/$1$(DOTEXE)
CLEANTARGETS:=$$(CLEANTARGETS) $(TARGETDIR)/$1$(DOTEXE) $(TOOLSBINDIR)/$1$(DOTEXE)

$(TARGETDIR)/$1$(DOTEXE): $(TOOLSBINDIR)/$1$(DOTEXE)
	$(call startrule,qtconf_deploy) \
	$(GNUCP) $$^ $$@ \
	$(call endrule,qtconf_deploy)

ifneq ($(filter linux,$(HOSTPLATFORM)),)
# On linux, the tools are built separately
$(TOOLSBINDIR)/$1$(DOTEXE): $(BOOTSTRAP_LIB)
	$(call startrule,qtconf_tools_build) \
	cd $(TOOLSSRCDIR)/$1 && $(GNUMAKE38) \
	$(call endrule,qtconf_tools_build)
else
# On windows, the tools are built by configure.exe (building of qmake)
$(TOOLSBINDIR)/$1$(DOTEXE): $(TARGETDIR)/qmake$(DOTEXE)
endif

endef

define qt_bootstrap
$(BOOTSTRAP_LIB): $(TOOLSBINDIR)/qmake$(DOTEXE)
	$(call startrule,qtconf_bootstrap_build) \
	cd $(TOOLSSRCDIR)/bootstrap && $(GNUMAKE38) && $(GNUTOUCH) $$@ \
	$(call endrule,qtconf_bootstrap_build)

CLEANTARGETS:=$$(CLEANTARGETS) $(BOOTSTRAP_LIB)
endef


define qt_qmake

TARGET:: $(TARGETDIR)/qmake$(DOTEXE)

WHATTARGETS:=$$(WHATTARGETS) $(TARGETDIR)/qmake$(DOTEXE) $(TOOLSBINDIR)/qmake$(DOTEXE)
CLEANTARGETS:=$$(CLEANTARGETS) $(TARGETDIR)/qmake$(DOTEXE) $(TOOLSBINDIR)/qmake$(DOTEXE)

$(TARGETDIR)/qmake$(DOTEXE): $(TOOLSBINDIR)/qmake$(DOTEXE)
	$(call startrule,qmake_deploy) \
	$(GNUCP) $$^ $$@ \
	$(call endrule,qmake_deploy)

$(TOOLSBINDIR)/qmake$(DOTEXE): $(EXTENSION_ROOT)/$(QT_ROOT)/$(CONFIGURE_APP)
	$(call startrule,qtconf) \
	$(GNUCHMOD) a+x  $(EXTENSION_ROOT)/$(QT_ROOT)/$(CONFIGURE_APP) $(EXTENSION_ROOT)/$(QT_ROOT)/config.tests/unix/* && \
	cd $(EXTENSION_ROOT)/$(QT_ROOT) && unset INCLUDE && unset LIB && $(EXTENSION_ROOT)/$(QT_ROOT)/$(CONFIGURE_APP) -platform $(PLATFORM) -xplatform $(XPLATFORM) $(OPTIONS) \
	$(call endrule,qtconf)
	$(call startrule,headerexport) \
	cd $(EXTENSION_ROOT)/$(QT_ROOT)/config.profiles/symbian && \
	perl headerexport -base-dir $(EXTENSION_ROOT)/$(QT_ROOT) -outdir $(EPOCROOT)/epoc32/include/ -what $(EPOCBLD)/qtconfig_what.log
	$(call endrule,headerexport)
	$(call startrule,mkspecexport) \
	$(GNUCP) -R -L $(EXTENSION_ROOT)/$(QT_ROOT)/mkspecs $(MKSPECDIR)
	$(GNUFIND) $(EXTENSION_ROOT)/$(QT_ROOT)/mkspecs -type f | \
	$(GNUSED) 's!$(EXTENSION_ROOT)/$(QT_ROOT)/!$(MKSPECDIR)/!' >> $(EPOCBLD)/qtconfig_what.log \
	$(call endrule,mkspecexport)
	$(call startrawoutput) \
	echo "$(call whatLogOpen)"; \
	$(GNUCAT) $(EPOCBLD)/qtconfig_what.log | \
		(read -r LINE; \
		while [ $$$$? -eq 0 ]; do \
			echo "$(call whatLogItem,,$$$$LINE)"; \
			read -r LINE; \
		done; \
		); \
	echo "$(call whatLogClose)" \
	$(call endrawoutput)

WHAT::
	$(call startrawoutput) \
	echo "$(call whatLogOpen)"; \
	$(GNUCAT) $(EPOCBLD)/qtconfig_what.log | \
		(read -r LINE; \
		while [ $$$$? -eq 0 ]; do \
			echo "$(call whatLogItem,,$$$$LINE)"; \
			read -r LINE; \
		done; \
		); \
	echo "$(call whatLogClose)" \
	$(call endrawoutput)

endef 


# Here a variable named "done_<sanitised $SISFILE>" gets created
GUARD:=done_$(call sanitise,$(TARGETDIR)/qmake$(DOTEXE))
# If variable "done_..." not set, set it to 1, so that
# UREL and UDEB do not execute makesis twice on the same target 
ifeq ($($(GUARD)),)
$(GUARD):=1

$(eval $(qt_qmake))

# Bootstrap is needed only on Linux
ifneq ($(filter linux,$(HOSTPLATFORM)),)
$(eval $(qt_bootstrap))
endif

$(eval $(foreach TOOL,$(QT_TOOLS),$(call qt_tool,$(TOOL))))

TOOLSSRCDIR:=$(LANGUAGETOOLDIR)
$(eval $(call qt_tool,lrelease))

$(eval $(call whatmacro,$(WHATTARGETS)))
$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),$(TARGETDIR)))

endif