source: packaging/Makefile.packages@ 619

Last change on this file since 619 was 581, checked in by Dmitry A. Kuminov, 15 years ago

packaging: qpmobjectwindow_pm_p.h isn't necessary in the "dev" package after r580.

File size: 7.1 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
95pkg.dev.libraries.PATH = $(WPI_ROOT)/pkg.dev.libraries
96pkg.dev.libraries.SOURCES = \
97 $(addsuffix ->bin/, $(wildcard $(QT_INSTALL)/bin/*.exe)) \
98 $(addsuffix ->lib/, $(wildcard $(QT_INSTALL)/lib/*.lib)) \
99 $(addsuffix ->lib/, $(wildcard $(QT_INSTALL)/lib/*.prl)) \
100 $(QT_INSTALL)/mkspecs/default/->mkspecs/ \
101 $(QT_INSTALL)/mkspecs/features/->mkspecs/ \
102 $(QT_INSTALL)/mkspecs/os2-g++/->mkspecs/ \
103 $(QT_INSTALL)/mkspecs/qconfig.pri->mkspecs/ \
104 $(QT_INSTALL)/include/ \
105 $(QT_INSTALL)/phrasebooks/ \
106 QtEnv.cmd->util/
107
108pkg.dev.runtime.PATH = $(WPI_ROOT)/pkg.dev.runtime
109pkg.dev.runtime.SOURCES = \
110 $(QT_BUILD)/bin/QtDsgn4.dll \
111 $(QT_BUILD)/bin/QtDsgC4.dll
112
113pkg.dev.translations.PATH = $(WPI_ROOT)/pkg.dev.translations
114pkg.dev.translations.SOURCES = \
115 $(wildcard $(QT_INSTALL)/translations/designer_*.qm) \
116 $(wildcard $(QT_INSTALL)/translations/linguist_*.qm)
117
118wpi.dev.PATH = $(OUT_ROOT)/qt-dev-$(QT_VER_FULL).wpi
119wpi.dev.SCRIPT = $(WPI_ROOT)/dev.wis
120wpi.dev.PACKAGES = pkg.dev.libraries=1 pkg.dev.runtime=2 \
121 pkg.dev.translations=3 pkg.readme=4
122
123# Examples archive
124
125pkg.examples.demos.PATH = $(WPI_ROOT)/pkg.examples.demos
126pkg.examples.demos.SOURCES = \
127 $(wildcard $(QT_INSTALL)/demos/*/) \
128
129pkg.examples.demo-plugins.PATH = $(WPI_ROOT)/pkg.examples.demo-plugins
130pkg.examples.demo-plugins.SOURCES = \
131 $(QT_INSTALL)/plugins/designer/arthurpl.dll->designer/
132
133pkg.examples.examples.PATH = $(WPI_ROOT)/pkg.examples.examples
134pkg.examples.examples.SOURCES = \
135 $(wildcard $(QT_INSTALL)/examples/*/) \
136
137# @todo add examples.example-plugins
138# @todo install qtdemo in bin/ when its' ready
139
140wpi.examples.PATH = $(OUT_ROOT)/qt-examples-$(QT_VER_FULL).wpi
141wpi.examples.SCRIPT = $(WPI_ROOT)/examples.wis
142wpi.examples.PACKAGES = pkg.examples.demos=1 pkg.examples.demo-plugins=2 \
143 pkg.examples.examples=3 \
144 pkg.readme=4
145
146# Summary
147
148WPIS = wpi.lib wpi.dev wpi.examples
149
150#-------------------------------------------------------------------------------
151# Core functions
152#-------------------------------------------------------------------------------
153
154_EMPTY_ :=
155
156_DIRS_ :=
157
158define EnsureDir
159ifneq ($(1),./)
160ifneq ($(1:%:/=:/),:/)
161ifeq ($$(filter $(1),$$(_DIRS_)),)
162_DIRS_ += $(1)
163$$(eval $$(call EnsureDir,$(dir $(1:%/=%))))
164$$(shell if not exist $(subst /,\,$(1:%/=%)) mkdir $(subst /,\,$(1:%/=%)) >nul 2>&1)
165endif
166endif
167endif
168endef
169
170# Generate rules to copy one file.
171# @param $(1) Stem whose file is to copy.
172# @param $(2) File name in format src[->tgt].
173define GenFileCopyRule
17490 := $(subst ->, ,$(2))
17591 := $$(word 1,$$(90))
17692 := $$(word 2,$$(90))
177ifeq ($$(91:%/=/),/)
17893 := 1
17991 := $$(91:%/=%)
180else
18193 := 0
182endif
183ifeq ($$(92),)
184 92 := $$(notdir $$(91))
185else
186ifeq ($$(92:%/=/),/)
187 92 := $$(92)$$(notdir $$(91))
188endif
189endif
19092 := $($(1).PATH)/$$(92)
191$(1).TARGETS += $$(92)
192$$(eval $$(call EnsureDir,$$(dir $$(92))))
193$$(92): $$(91)
194ifeq ($$(93),1)
195 xcopy /s /e /o "$$(subst /,\,$$<)" "$$(subst /,\,$$@)"\ $(_EMPTY_)
196else
197 copy "$$(subst /,\,$$<)" "$$(subst /,\,$$@)"
198endif
199endef
200
201_PACKAGES_ :=
202
203# Generate rules for one WPI package.
204# @param $(1) Package stem.
205define GenPkgRule
206ifeq ($$(filter $(1),$$(_PACKAGES_)),)
207_PACKAGES_ += $(1)
208$$(foreach file,$$($(1).SOURCES),$$(eval $$(call GenFileCopyRule,$(1),$$(file))))
209$(1): $$($(1).TARGETS)
210endif
211endef
212
213define GenWpiRuleHelper
21490 := $(subst =, ,$(2))
21591 := $$(word 1,$$(90))
21692 := $$(word 2,$$(90))
217$(1)._PACKAGES_CMD += $$(92) -c$$($$(91).PATH) -r *
218$(1).PACKAGES += $$(91)
219endef
220
221# Generate rules for one WPI archive.
222# @param $(1) WPI stem.
223define GenWpiRule
224$(eval $(1)._PACKAGES := $($(1).PACKAGES))
225$(eval $(1)._PACKAGES_CMD :=)
226$(eval $(1).PACKAGES :=)
227$(foreach pkg,$($(1)._PACKAGES),$(eval $(call GenWpiRuleHelper,$(1),$(pkg))))
228$(1): $($(1).PACKAGES) $($(1).SCRIPT)
229 -del $(subst /,\,$($(1).PATH))
230 $(WIC) $($(1).PATH) -a $($(1)._PACKAGES_CMD) -s $($(1).SCRIPT)
231$(foreach pkg,$($(1).PACKAGES),$(eval $(pkg).TARGETS :=))
232$(foreach pkg,$($(1).PACKAGES),$(eval $(call GenPkgRule,$(pkg))))
233endef
234
235#-------------------------------------------------------------------------------
236# Core function invocations
237#-------------------------------------------------------------------------------
238
239.PHONY: $(WPIS) $(foreach wpi,$(WPIS),$($(wpi).PACKAGES))
240
241$(foreach wpi,$(WPIS),$(eval $(call GenWpiRule,$(wpi))))
242
Note: See TracBrowser for help on using the repository browser.