source: packaging/Makefile.packages@ 576

Last change on this file since 576 was 549, checked in by Dmitry A. Kuminov, 16 years ago

packaging: Remove qt.conf unnecessary after r548.

File size: 7.3 KB
Line 
1#
2# Helper makefile for make_packages.cmd
3#
4
5all:
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
13ifeq ($(WIC),)
14$(error WIC unset!)
15endif
16ifeq ($(OUT_ROOT),)
17$(error OUT_ROOT unset!)
18endif
19ifeq ($(WPI_ROOT),)
20$(error WPI_ROOT unset!)
21endif
22ifeq ($(QT_BUILD),)
23$(error QT_BUILD unset!)
24endif
25ifeq ($(QT_INSTALL),)
26$(error QT_INSTALL unset!)
27endif
28ifeq ($(QT_VER_FULL),)
29$(error QT_VER_FULL unset!)
30endif
31
32$(foreach var,WPI_ROOT QT_BUILD QT_INSTALL,\
33 $(eval $(var) := $(subst \,/,$($(var)))))
34
35#-------------------------------------------------------------------------------
36# Definitions
37#-------------------------------------------------------------------------------
38
39pkg.readme.PATH = $(WPI_ROOT)/pkg.readme
40pkg.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# Runtime archive
50
51pkg.lib.runtime.PATH = $(WPI_ROOT)/pkg.lib.runtime
52pkg.lib.runtime.SOURCES = \
53 $(QT_INSTALL)/bin/QtCore4.dll \
54 $(QT_INSTALL)/bin/QtGui4.dll \
55 $(QT_INSTALL)/bin/QtNet4.dll \
56 $(QT_INSTALL)/bin/QtScri4.dll \
57 $(QT_INSTALL)/bin/QtScTl4.dll \
58 $(QT_INSTALL)/bin/QtSql4.dll \
59 $(QT_INSTALL)/bin/QtSvg4.dll \
60 $(QT_INSTALL)/bin/QtTest4.dll \
61 $(QT_INSTALL)/bin/QtXml4.dll \
62 $(QT_INSTALL)/bin/QtXmlP4.dll
63
64pkg.lib.instutils.PATH = $(WPI_ROOT)/pkg.lib.instutils
65pkg.lib.instutils.SOURCES = \
66 UpdateQtSysConf.cmd->util/
67
68pkg.lib.plugins.PATH = $(WPI_ROOT)/pkg.lib.plugins
69pkg.lib.plugins.SOURCES = \
70 $(addsuffix ->accessible/, $(wildcard $(QT_INSTALL)/plugins/accessible/*.dll)) \
71 $(addsuffix ->codecs/, $(wildcard $(QT_INSTALL)/plugins/codecs/*.dll)) \
72 $(addsuffix ->iconengines/, $(wildcard $(QT_INSTALL)/plugins/iconengines/*.dll)) \
73 $(addsuffix ->imageformats/,$(wildcard $(QT_INSTALL)/plugins/imageformats/*.dll)) \
74 $(addsuffix ->sqldrivers/, $(wildcard $(QT_INSTALL)/plugins/sqldrivers/*.dll))
75
76pkg.lib.translations.PATH = $(WPI_ROOT)/pkg.lib.translations
77pkg.lib.translations.SOURCES = \
78 $(filter-out $(wildcard $(QT_INSTALL)/translations/qt_help*.qm),\
79 $(wildcard $(QT_INSTALL)/translations/qt_*.qm))
80
81pkg.lib.systray.PATH = $(WPI_ROOT)/pkg.lib.systray
82pkg.lib.systray.SOURCES = \
83 $(QT_BUILD)/plugins/xcenter/xsystray.dll->plugins/xcenter/
84
85wpi.lib.PATH = $(OUT_ROOT)/qt-lib-$(QT_VER_FULL).wpi
86wpi.lib.SCRIPT = $(WPI_ROOT)/lib.wis
87wpi.lib.PACKAGES = pkg.lib.runtime=1 pkg.lib.instutils=2 pkg.lib.plugins=3 \
88 pkg.lib.translations=4 pkg.lib.systray=5 pkg.readme=6
89
90# Development archive
91
92# @todo QtDsgn4.dll and QtDsgC4.dll must be taken from $(QT_INSTALL)
93# on the next release
94# @todo private/qpmobjectwindow_pm_p.h must not be included at all after the fix!
95
96pkg.dev.libraries.PATH = $(WPI_ROOT)/pkg.dev.libraries
97pkg.dev.libraries.SOURCES = \
98 $(addsuffix ->bin/, $(wildcard $(QT_INSTALL)/bin/*.exe)) \
99 $(addsuffix ->lib/, $(wildcard $(QT_INSTALL)/lib/*.lib)) \
100 $(addsuffix ->lib/, $(wildcard $(QT_INSTALL)/lib/*.prl)) \
101 $(QT_INSTALL)/mkspecs/default/->mkspecs/ \
102 $(QT_INSTALL)/mkspecs/features/->mkspecs/ \
103 $(QT_INSTALL)/mkspecs/os2-g++/->mkspecs/ \
104 $(QT_INSTALL)/mkspecs/qconfig.pri->mkspecs/ \
105 $(QT_INSTALL)/include/ \
106 $(QT_INSTALL)/phrasebooks/ \
107 QtEnv.cmd->util/ \
108 $(QT_BUILD)/src/corelib/kernel/qpmobjectwindow_pm_p.h->include/QtCore/private/
109
110pkg.dev.runtime.PATH = $(WPI_ROOT)/pkg.dev.runtime
111pkg.dev.runtime.SOURCES = \
112 $(QT_BUILD)/bin/QtDsgn4.dll \
113 $(QT_BUILD)/bin/QtDsgC4.dll
114
115pkg.dev.translations.PATH = $(WPI_ROOT)/pkg.dev.translations
116pkg.dev.translations.SOURCES = \
117 $(wildcard $(QT_INSTALL)/translations/designer_*.qm) \
118 $(wildcard $(QT_INSTALL)/translations/linguist_*.qm)
119
120wpi.dev.PATH = $(OUT_ROOT)/qt-dev-$(QT_VER_FULL).wpi
121wpi.dev.SCRIPT = $(WPI_ROOT)/dev.wis
122wpi.dev.PACKAGES = pkg.dev.libraries=1 pkg.dev.runtime=2 \
123 pkg.dev.translations=3 pkg.readme=4
124
125# Examples archive
126
127pkg.examples.demos.PATH = $(WPI_ROOT)/pkg.examples.demos
128pkg.examples.demos.SOURCES = \
129 $(wildcard $(QT_INSTALL)/demos/*/) \
130
131pkg.examples.demo-plugins.PATH = $(WPI_ROOT)/pkg.examples.demo-plugins
132pkg.examples.demo-plugins.SOURCES = \
133 $(QT_INSTALL)/plugins/designer/arthurpl.dll->designer/
134
135pkg.examples.examples.PATH = $(WPI_ROOT)/pkg.examples.examples
136pkg.examples.examples.SOURCES = \
137 $(wildcard $(QT_INSTALL)/examples/*/) \
138
139# @todo add examples.example-plugins
140# @todo install qtdemo in bin/ when its' ready
141
142wpi.examples.PATH = $(OUT_ROOT)/qt-examples-$(QT_VER_FULL).wpi
143wpi.examples.SCRIPT = $(WPI_ROOT)/examples.wis
144wpi.examples.PACKAGES = pkg.examples.demos=1 pkg.examples.demo-plugins=2 \
145 pkg.examples.examples=3 \
146 pkg.readme=4
147
148# Summary
149
150WPIS = wpi.lib wpi.dev wpi.examples
151
152#-------------------------------------------------------------------------------
153# Core functions
154#-------------------------------------------------------------------------------
155
156_EMPTY_ :=
157
158_DIRS_ :=
159
160define EnsureDir
161ifneq ($(1),./)
162ifneq ($(1:%:/=:/),:/)
163ifeq ($$(filter $(1),$$(_DIRS_)),)
164_DIRS_ += $(1)
165$$(eval $$(call EnsureDir,$(dir $(1:%/=%))))
166$$(shell if not exist $(subst /,\,$(1:%/=%)) mkdir $(subst /,\,$(1:%/=%)) >nul 2>&1)
167endif
168endif
169endif
170endef
171
172# Generate rules to copy one file.
173# @param $(1) Stem whose file is to copy.
174# @param $(2) File name in format src[->tgt].
175define GenFileCopyRule
17690 := $(subst ->, ,$(2))
17791 := $$(word 1,$$(90))
17892 := $$(word 2,$$(90))
179ifeq ($$(91:%/=/),/)
18093 := 1
18191 := $$(91:%/=%)
182else
18393 := 0
184endif
185ifeq ($$(92),)
186 92 := $$(notdir $$(91))
187else
188ifeq ($$(92:%/=/),/)
189 92 := $$(92)$$(notdir $$(91))
190endif
191endif
19292 := $($(1).PATH)/$$(92)
193$(1).TARGETS += $$(92)
194$$(eval $$(call EnsureDir,$$(dir $$(92))))
195$$(92): $$(91)
196ifeq ($$(93),1)
197 xcopy /s /e /o "$$(subst /,\,$$<)" "$$(subst /,\,$$@)"\ $(_EMPTY_)
198else
199 copy "$$(subst /,\,$$<)" "$$(subst /,\,$$@)"
200endif
201endef
202
203_PACKAGES_ :=
204
205# Generate rules for one WPI package.
206# @param $(1) Package stem.
207define GenPkgRule
208ifeq ($$(filter $(1),$$(_PACKAGES_)),)
209_PACKAGES_ += $(1)
210$$(foreach file,$$($(1).SOURCES),$$(eval $$(call GenFileCopyRule,$(1),$$(file))))
211$(1): $$($(1).TARGETS)
212endif
213endef
214
215define GenWpiRuleHelper
21690 := $(subst =, ,$(2))
21791 := $$(word 1,$$(90))
21892 := $$(word 2,$$(90))
219$(1)._PACKAGES_CMD += $$(92) -c$$($$(91).PATH) -r *
220$(1).PACKAGES += $$(91)
221endef
222
223# Generate rules for one WPI archive.
224# @param $(1) WPI stem.
225define GenWpiRule
226$(eval $(1)._PACKAGES := $($(1).PACKAGES))
227$(eval $(1)._PACKAGES_CMD :=)
228$(eval $(1).PACKAGES :=)
229$(foreach pkg,$($(1)._PACKAGES),$(eval $(call GenWpiRuleHelper,$(1),$(pkg))))
230$(1): $($(1).PACKAGES) $($(1).SCRIPT)
231 -del $($(1).PATH)
232 $(WIC) $($(1).PATH) -a $($(1)._PACKAGES_CMD) -s $($(1).SCRIPT)
233$(foreach pkg,$($(1).PACKAGES),$(eval $(pkg).TARGETS :=))
234$(foreach pkg,$($(1).PACKAGES),$(eval $(call GenPkgRule,$(pkg))))
235endef
236
237#-------------------------------------------------------------------------------
238# Core function invocations
239#-------------------------------------------------------------------------------
240
241.PHONY: $(WPIS) $(foreach wpi,$(WPIS),$($(wpi).PACKAGES))
242
243$(foreach wpi,$(WPIS),$(eval $(call GenWpiRule,$(wpi))))
244
Note: See TracBrowser for help on using the repository browser.