1 | #
|
---|
2 | # Helper makefile for make_packages.cmd
|
---|
3 | #
|
---|
4 |
|
---|
5 | all:
|
---|
6 | @echo This Makefile is not intended to be used directly.
|
---|
7 | @echo Use make_packages.cmd instead.
|
---|
8 |
|
---|
9 | #-------------------------------------------------------------------------------
|
---|
10 | # Environment checks
|
---|
11 | #-------------------------------------------------------------------------------
|
---|
12 |
|
---|
13 | ifeq ($(WIC),)
|
---|
14 | $(error WIC unset!)
|
---|
15 | endif
|
---|
16 | ifeq ($(OUT_ROOT),)
|
---|
17 | $(error OUT_ROOT unset!)
|
---|
18 | endif
|
---|
19 | ifeq ($(WPI_ROOT),)
|
---|
20 | $(error WPI_ROOT unset!)
|
---|
21 | endif
|
---|
22 | ifeq ($(QT_BUILD),)
|
---|
23 | $(error QT_BUILD unset!)
|
---|
24 | endif
|
---|
25 | ifeq ($(QT_INSTALL),)
|
---|
26 | $(error QT_INSTALL unset!)
|
---|
27 | endif
|
---|
28 | ifeq ($(QT_VER_FULL),)
|
---|
29 | $(error QT_VER_FULL unset!)
|
---|
30 | endif
|
---|
31 |
|
---|
32 | $(foreach var,WPI_ROOT QT_BUILD QT_INSTALL,\
|
---|
33 | $(eval $(var) := $(subst \,/,$($(var)))))
|
---|
34 |
|
---|
35 | #-------------------------------------------------------------------------------
|
---|
36 | # Definitions
|
---|
37 | #-------------------------------------------------------------------------------
|
---|
38 |
|
---|
39 | pkg.readme.PATH = $(WPI_ROOT)/pkg.readme
|
---|
40 | pkg.readme.SOURCES = \
|
---|
41 | $(QT_BUILD)/LGPL_EXCEPTION.txt \
|
---|
42 | $(QT_BUILD)/LICENSE.GPL3 \
|
---|
43 | $(QT_BUILD)/LICENSE.LGPL \
|
---|
44 | $(wildcard $(QT_BUILD)/changes-*) \
|
---|
45 | $(QT_BUILD)/README \
|
---|
46 | $(QT_BUILD)/README.OS2 \
|
---|
47 | $(QT_BUILD)/CHANGES.OS2
|
---|
48 |
|
---|
49 | #
|
---|
50 | # Runtime archive
|
---|
51 | #
|
---|
52 |
|
---|
53 | pkg.lib.runtime.PATH = $(WPI_ROOT)/pkg.lib.runtime
|
---|
54 | pkg.lib.runtime.SOURCES = \
|
---|
55 | $(QT_INSTALL)/bin/QtCore4.dll \
|
---|
56 | $(QT_INSTALL)/bin/QtGui4.dll \
|
---|
57 | $(QT_INSTALL)/bin/QtNet4.dll \
|
---|
58 | $(QT_INSTALL)/bin/QtScri4.dll \
|
---|
59 | $(QT_INSTALL)/bin/QtScTl4.dll \
|
---|
60 | $(QT_INSTALL)/bin/QtSql4.dll \
|
---|
61 | $(QT_INSTALL)/bin/QtSvg4.dll \
|
---|
62 | $(QT_INSTALL)/bin/QtTest4.dll \
|
---|
63 | $(QT_INSTALL)/bin/QtXml4.dll \
|
---|
64 | $(QT_INSTALL)/bin/QtXmlP4.dll
|
---|
65 |
|
---|
66 | pkg.lib.instutils.PATH = $(WPI_ROOT)/pkg.lib.instutils
|
---|
67 | pkg.lib.instutils.SOURCES = \
|
---|
68 | UpdateQtSysConf.cmd->util/
|
---|
69 |
|
---|
70 | pkg.lib.plugins.PATH = $(WPI_ROOT)/pkg.lib.plugins
|
---|
71 | pkg.lib.plugins.SOURCES = \
|
---|
72 | $(addsuffix ->accessible/, $(wildcard $(QT_INSTALL)/plugins/accessible/*.dll)) \
|
---|
73 | $(addsuffix ->codecs/, $(wildcard $(QT_INSTALL)/plugins/codecs/*.dll)) \
|
---|
74 | $(addsuffix ->iconengines/, $(wildcard $(QT_INSTALL)/plugins/iconengines/*.dll)) \
|
---|
75 | $(addsuffix ->imageformats/,$(wildcard $(QT_INSTALL)/plugins/imageformats/*.dll)) \
|
---|
76 | $(addsuffix ->sqldrivers/, $(wildcard $(QT_INSTALL)/plugins/sqldrivers/*.dll))
|
---|
77 |
|
---|
78 | pkg.lib.translations.PATH = $(WPI_ROOT)/pkg.lib.translations
|
---|
79 | pkg.lib.translations.SOURCES = \
|
---|
80 | $(filter-out $(wildcard $(QT_INSTALL)/translations/qt_help*.qm),\
|
---|
81 | $(wildcard $(QT_INSTALL)/translations/qt_*.qm))
|
---|
82 |
|
---|
83 | pkg.lib.systray.PATH = $(WPI_ROOT)/pkg.lib.systray
|
---|
84 | pkg.lib.systray.SOURCES = \
|
---|
85 | $(QT_BUILD)/plugins/xcenter/xsystray.dll->plugins/xcenter/
|
---|
86 |
|
---|
87 | wpi.lib.PATH = $(OUT_ROOT)/qt-lib-$(QT_VER_FULL).wpi
|
---|
88 | wpi.lib.SCRIPT = $(WPI_ROOT)/lib.wis
|
---|
89 | wpi.lib.PACKAGES = \
|
---|
90 | pkg.lib.runtime=1 \
|
---|
91 | pkg.lib.instutils=2 \
|
---|
92 | pkg.lib.plugins=3 \
|
---|
93 | pkg.lib.translations=4 \
|
---|
94 | pkg.lib.systray=5 \
|
---|
95 | pkg.readme=6
|
---|
96 |
|
---|
97 | #
|
---|
98 | # Development archive
|
---|
99 | #
|
---|
100 |
|
---|
101 | # @todo QtDsgn4.dll and QtDsgC4.dll must be taken from $(QT_INSTALL)
|
---|
102 | # on the next release
|
---|
103 |
|
---|
104 | pkg.dev.libraries.PATH = $(WPI_ROOT)/pkg.dev.libraries
|
---|
105 | pkg.dev.libraries.SOURCES = \
|
---|
106 | $(addsuffix ->bin/, $(wildcard $(QT_INSTALL)/bin/*.exe)) \
|
---|
107 | $(addsuffix ->lib/, $(wildcard $(QT_INSTALL)/lib/*.lib)) \
|
---|
108 | $(addsuffix ->lib/, $(wildcard $(QT_INSTALL)/lib/*.prl)) \
|
---|
109 | $(QT_INSTALL)/mkspecs/default/->mkspecs/ \
|
---|
110 | $(QT_INSTALL)/mkspecs/features/->mkspecs/ \
|
---|
111 | $(QT_INSTALL)/mkspecs/os2-g++/->mkspecs/ \
|
---|
112 | $(QT_INSTALL)/mkspecs/qconfig.pri->mkspecs/ \
|
---|
113 | $(QT_INSTALL)/include/ \
|
---|
114 | $(QT_INSTALL)/phrasebooks/ \
|
---|
115 | QtEnv.cmd->util/
|
---|
116 |
|
---|
117 | pkg.dev.runtime.PATH = $(WPI_ROOT)/pkg.dev.runtime
|
---|
118 | pkg.dev.runtime.SOURCES = \
|
---|
119 | $(QT_BUILD)/bin/QtDsgn4.dll \
|
---|
120 | $(QT_BUILD)/bin/QtDsgC4.dll
|
---|
121 |
|
---|
122 | pkg.dev.translations.PATH = $(WPI_ROOT)/pkg.dev.translations
|
---|
123 | pkg.dev.translations.SOURCES = \
|
---|
124 | $(wildcard $(QT_INSTALL)/translations/designer_*.qm) \
|
---|
125 | $(wildcard $(QT_INSTALL)/translations/linguist_*.qm)
|
---|
126 |
|
---|
127 | wpi.dev.PATH = $(OUT_ROOT)/qt-dev-$(QT_VER_FULL).wpi
|
---|
128 | wpi.dev.SCRIPT = $(WPI_ROOT)/dev.wis
|
---|
129 | wpi.dev.PACKAGES = \
|
---|
130 | pkg.dev.libraries=1 \
|
---|
131 | pkg.dev.runtime=2 \
|
---|
132 | pkg.dev.translations=3 \
|
---|
133 | pkg.readme=4
|
---|
134 |
|
---|
135 | #
|
---|
136 | # Examples archive
|
---|
137 | #
|
---|
138 |
|
---|
139 | pkg.examples.demos.PATH = $(WPI_ROOT)/pkg.examples.demos
|
---|
140 | pkg.examples.demos.SOURCES = \
|
---|
141 | $(wildcard $(QT_INSTALL)/demos/*/) \
|
---|
142 |
|
---|
143 | pkg.examples.demo-plugins.PATH = $(WPI_ROOT)/pkg.examples.demo-plugins
|
---|
144 | pkg.examples.demo-plugins.SOURCES = \
|
---|
145 | $(QT_INSTALL)/plugins/designer/arthurpl.dll->designer/
|
---|
146 |
|
---|
147 | pkg.examples.examples.PATH = $(WPI_ROOT)/pkg.examples.examples
|
---|
148 | pkg.examples.examples.SOURCES = \
|
---|
149 | $(wildcard $(QT_INSTALL)/examples/*/) \
|
---|
150 |
|
---|
151 | # @todo add examples.example-plugins
|
---|
152 | # @todo install qtdemo in bin/ when it's ready
|
---|
153 |
|
---|
154 | wpi.examples.PATH = $(OUT_ROOT)/qt-examples-$(QT_VER_FULL).wpi
|
---|
155 | wpi.examples.SCRIPT = $(WPI_ROOT)/examples.wis
|
---|
156 | wpi.examples.PACKAGES = \
|
---|
157 | pkg.examples.demos=1 \
|
---|
158 | pkg.examples.demo-plugins=2 \
|
---|
159 | pkg.examples.examples=3 \
|
---|
160 | pkg.readme=4
|
---|
161 |
|
---|
162 | #
|
---|
163 | # Summary
|
---|
164 | #
|
---|
165 |
|
---|
166 | WPIS = wpi.lib wpi.dev wpi.examples
|
---|
167 |
|
---|
168 | #-------------------------------------------------------------------------------
|
---|
169 | # Core functions
|
---|
170 | #-------------------------------------------------------------------------------
|
---|
171 |
|
---|
172 | _EMPTY_ :=
|
---|
173 |
|
---|
174 | _DIRS_ :=
|
---|
175 |
|
---|
176 | define EnsureDir
|
---|
177 | ifneq ($(1),./)
|
---|
178 | ifneq ($(1:%:/=:/),:/)
|
---|
179 | ifeq ($$(filter $(1),$$(_DIRS_)),)
|
---|
180 | _DIRS_ += $(1)
|
---|
181 | $$(eval $$(call EnsureDir,$(dir $(1:%/=%))))
|
---|
182 | $$(shell if not exist "$(subst /,\,$(1:%/=%))" mkdir "$(subst /,\,$(1:%/=%))" >nul 2>&1)
|
---|
183 | endif
|
---|
184 | endif
|
---|
185 | endif
|
---|
186 | endef
|
---|
187 |
|
---|
188 | # Generate rules to copy one file.
|
---|
189 | # @param $(1) Stem which file is to copy.
|
---|
190 | # @param $(2) File name in format src[->tgt].
|
---|
191 | define GenFileCopyRule
|
---|
192 | 90 := $(subst ->, ,$(2))
|
---|
193 | 91 := $$(word 1,$$(90))
|
---|
194 | 92 := $$(word 2,$$(90))
|
---|
195 | ifeq ($$(91:%/=/),/)
|
---|
196 | 93 := 1
|
---|
197 | 91 := $$(91:%/=%)
|
---|
198 | else
|
---|
199 | 93 := 0
|
---|
200 | endif
|
---|
201 | ifeq ($$(92),)
|
---|
202 | 92 := $$(notdir $$(91))
|
---|
203 | else
|
---|
204 | ifeq ($$(92:%/=/),/)
|
---|
205 | 92 := $$(92)$$(notdir $$(91))
|
---|
206 | endif
|
---|
207 | endif
|
---|
208 | 92 := $($(1).PATH)/$$(92)
|
---|
209 | $(1).TARGETS += $$(92)
|
---|
210 | $$(eval $$(call EnsureDir,$$(dir $$(92))))
|
---|
211 | $$(92): $$(91)
|
---|
212 | ifeq ($$(93),1)
|
---|
213 | xcopy /s /e /o "$$(subst /,\,$$<)" "$$(subst /,\,$$@)"\ $(_EMPTY_)
|
---|
214 | else
|
---|
215 | copy "$$(subst /,\,$$<)" "$$(subst /,\,$$@)"
|
---|
216 | endif
|
---|
217 | endef
|
---|
218 |
|
---|
219 | _PACKAGES_ :=
|
---|
220 |
|
---|
221 | # Generate rules for one WPI package.
|
---|
222 | # @param $(1) Package stem.
|
---|
223 | define GenPkgRule
|
---|
224 | ifeq ($$(filter $(1),$$(_PACKAGES_)),)
|
---|
225 | _PACKAGES_ += $(1)
|
---|
226 | $$(foreach file,$$($(1).SOURCES),$$(eval $$(call GenFileCopyRule,$(1),$$(file))))
|
---|
227 | $(1): $$($(1).TARGETS)
|
---|
228 | clean-$(1):
|
---|
229 | if exist "$($(1).PATH)" deltree.cmd "$(subst /,\,$($(1).PATH))" /Y /S
|
---|
230 | endif
|
---|
231 | endef
|
---|
232 |
|
---|
233 | define GenWpiRuleHelper
|
---|
234 | 90 := $(subst =, ,$(2))
|
---|
235 | 91 := $$(word 1,$$(90))
|
---|
236 | 92 := $$(word 2,$$(90))
|
---|
237 | $(1)._PACKAGES_CMD += $$(92) -c$$($$(91).PATH) -r *
|
---|
238 | $(1).PACKAGES += $$(91)
|
---|
239 | endef
|
---|
240 |
|
---|
241 | # Generate rules for one WPI archive.
|
---|
242 | # @param $(1) WPI stem.
|
---|
243 | define GenWpiRule
|
---|
244 | $(eval $(1)._PACKAGES := $($(1).PACKAGES))
|
---|
245 | $(eval $(1)._PACKAGES_CMD :=)
|
---|
246 | $(eval $(1).PACKAGES :=)
|
---|
247 | $(foreach pkg,$($(1)._PACKAGES),$(eval $(call GenWpiRuleHelper,$(1),$(pkg))))
|
---|
248 | # generate WPI target (depends on clean to make sure the removed files are not packed)
|
---|
249 | $(1): clean-$(1) $($(1).PACKAGES) $($(1).SCRIPT)
|
---|
250 | -del $(subst /,\,$($(1).PATH))
|
---|
251 | $(WIC) $($(1).PATH) -a $($(1)._PACKAGES_CMD) -s $($(1).SCRIPT)
|
---|
252 | # clean WPI target
|
---|
253 | clean-$(1): $(foreach pkg,$($(1).PACKAGES),clean-$(pkg))
|
---|
254 | # helpers
|
---|
255 | $(foreach pkg,$($(1).PACKAGES),$(eval $(pkg).TARGETS :=))
|
---|
256 | $(foreach pkg,$($(1).PACKAGES),$(eval $(call GenPkgRule,$(pkg))))
|
---|
257 | endef
|
---|
258 |
|
---|
259 | #-------------------------------------------------------------------------------
|
---|
260 | # Core function invocations
|
---|
261 | #-------------------------------------------------------------------------------
|
---|
262 |
|
---|
263 | .PHONY: $(WPIS) $(foreach wpi,$(WPIS),$($(wpi).PACKAGES))
|
---|
264 |
|
---|
265 | $(foreach wpi,$(WPIS),$(eval $(call GenWpiRule,$(wpi))))
|
---|
266 |
|
---|