| 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/QtCLuc4.dll \
|
|---|
| 56 | $(QT_INSTALL)/bin/QtCore4.dll \
|
|---|
| 57 | $(QT_INSTALL)/bin/QtGui4.dll \
|
|---|
| 58 | $(QT_INSTALL)/bin/QtHelp4.dll \
|
|---|
| 59 | $(QT_INSTALL)/bin/QtNet4.dll \
|
|---|
| 60 | $(QT_INSTALL)/bin/QtScri4.dll \
|
|---|
| 61 | $(QT_INSTALL)/bin/QtScTl4.dll \
|
|---|
| 62 | $(QT_INSTALL)/bin/QtSql4.dll \
|
|---|
| 63 | $(QT_INSTALL)/bin/QtSvg4.dll \
|
|---|
| 64 | $(QT_INSTALL)/bin/QtTest4.dll \
|
|---|
| 65 | $(QT_INSTALL)/bin/QtWebK4.dll \
|
|---|
| 66 | $(QT_INSTALL)/bin/QtXml4.dll \
|
|---|
| 67 | $(QT_INSTALL)/bin/QtXmlP4.dll
|
|---|
| 68 |
|
|---|
| 69 | pkg.lib.instutils.PATH = $(WPI_ROOT)/pkg.lib.instutils
|
|---|
| 70 | pkg.lib.instutils.SOURCES = \
|
|---|
| 71 | UpdateQtSysConf.cmd->util/
|
|---|
| 72 |
|
|---|
| 73 | pkg.lib.plugins.PATH = $(WPI_ROOT)/pkg.lib.plugins
|
|---|
| 74 | pkg.lib.plugins.SOURCES = \
|
|---|
| 75 | $(addsuffix ->accessible/, $(wildcard $(QT_INSTALL)/plugins/accessible/*.dll)) \
|
|---|
| 76 | $(addsuffix ->codecs/, $(wildcard $(QT_INSTALL)/plugins/codecs/*.dll)) \
|
|---|
| 77 | $(addsuffix ->graphicssystems/, $(wildcard $(QT_INSTALL)/plugins/graphicssystems/*.dll)) \
|
|---|
| 78 | $(addsuffix ->iconengines/, $(wildcard $(QT_INSTALL)/plugins/iconengines/*.dll)) \
|
|---|
| 79 | $(addsuffix ->imageformats/, $(wildcard $(QT_INSTALL)/plugins/imageformats/*.dll)) \
|
|---|
| 80 | $(addsuffix ->sqldrivers/, $(wildcard $(QT_INSTALL)/plugins/sqldrivers/*.dll))
|
|---|
| 81 |
|
|---|
| 82 | pkg.lib.translations.PATH = $(WPI_ROOT)/pkg.lib.translations
|
|---|
| 83 | pkg.lib.translations.SOURCES = \
|
|---|
| 84 | $(wildcard $(QT_INSTALL)/translations/qt_*.qm) \
|
|---|
| 85 | $(wildcard $(QT_INSTALL)/translations/qt_help_*.qm)
|
|---|
| 86 |
|
|---|
| 87 | pkg.lib.systray.PATH = $(WPI_ROOT)/pkg.lib.systray
|
|---|
| 88 | pkg.lib.systray.SOURCES = \
|
|---|
| 89 | $(QT_BUILD)/plugins/xcenter/xsystray.dll->plugins/xcenter/
|
|---|
| 90 |
|
|---|
| 91 | wpi.lib.PATH = $(OUT_ROOT)/qt-lib-$(QT_VER_FULL).wpi
|
|---|
| 92 | wpi.lib.SCRIPT = $(WPI_ROOT)/lib.wis
|
|---|
| 93 | wpi.lib.PACKAGES = \
|
|---|
| 94 | pkg.lib.runtime=1 \
|
|---|
| 95 | pkg.lib.instutils=2 \
|
|---|
| 96 | pkg.lib.plugins=3 \
|
|---|
| 97 | pkg.lib.translations=4 \
|
|---|
| 98 | pkg.lib.systray=5 \
|
|---|
| 99 | pkg.readme=6
|
|---|
| 100 |
|
|---|
| 101 | # create another WPI with no XWorkplace dependency, see #146
|
|---|
| 102 | wpi.lib_noxwpdep.PATH = $(OUT_ROOT)/qt-lib-$(QT_VER_FULL)-noxwpdep.wpi
|
|---|
| 103 | wpi.lib_noxwpdep.SCRIPT = $(WPI_ROOT)/lib_noxwpdep.wis
|
|---|
| 104 | wpi.lib_noxwpdep.PACKAGES = \
|
|---|
| 105 | pkg.lib.runtime=1 \
|
|---|
| 106 | pkg.lib.instutils=2 \
|
|---|
| 107 | pkg.lib.plugins=3 \
|
|---|
| 108 | pkg.lib.translations=4 \
|
|---|
| 109 | pkg.readme=6
|
|---|
| 110 |
|
|---|
| 111 | #
|
|---|
| 112 | # Development archive
|
|---|
| 113 | #
|
|---|
| 114 |
|
|---|
| 115 | pkg.dev.libraries.PATH = $(WPI_ROOT)/pkg.dev.libraries
|
|---|
| 116 | pkg.dev.libraries.SOURCES = \
|
|---|
| 117 | $(addsuffix ->bin/, $(filter-out \
|
|---|
| 118 | %/qtdemo.exe, \
|
|---|
| 119 | $(wildcard $(QT_INSTALL)/bin/*.exe))) \
|
|---|
| 120 | $(addsuffix ->lib/, $(wildcard $(QT_INSTALL)/lib/*.lib)) \
|
|---|
| 121 | $(addsuffix ->lib/, $(wildcard $(QT_INSTALL)/lib/*.prl)) \
|
|---|
| 122 | $(QT_INSTALL)/mkspecs/default/->mkspecs/ \
|
|---|
| 123 | $(QT_INSTALL)/mkspecs/features/->mkspecs/ \
|
|---|
| 124 | $(QT_INSTALL)/mkspecs/os2-g++/->mkspecs/ \
|
|---|
| 125 | $(QT_INSTALL)/mkspecs/qconfig.pri->mkspecs/ \
|
|---|
| 126 | $(QT_INSTALL)/include/ \
|
|---|
| 127 | $(QT_INSTALL)/phrasebooks/ \
|
|---|
| 128 | QtEnv.cmd->util/
|
|---|
| 129 |
|
|---|
| 130 | pkg.dev.runtime.PATH = $(WPI_ROOT)/pkg.dev.runtime
|
|---|
| 131 | pkg.dev.runtime.SOURCES = \
|
|---|
| 132 | $(QT_INSTALL)/bin/QtAsCl4.dll \
|
|---|
| 133 | $(QT_INSTALL)/bin/QtDsgn4.dll \
|
|---|
| 134 | $(QT_INSTALL)/bin/QtDsgC4.dll
|
|---|
| 135 |
|
|---|
| 136 | pkg.dev.plugins.PATH = $(WPI_ROOT)/pkg.dev.plugins
|
|---|
| 137 | pkg.dev.plugins.SOURCES = \
|
|---|
| 138 | $(QT_INSTALL)/plugins/designer/qwebview.dll->designer/
|
|---|
| 139 |
|
|---|
| 140 | pkg.dev.translations.PATH = $(WPI_ROOT)/pkg.dev.translations
|
|---|
| 141 | pkg.dev.translations.SOURCES = \
|
|---|
| 142 | $(wildcard $(QT_INSTALL)/translations/designer_*.qm) \
|
|---|
| 143 | $(wildcard $(QT_INSTALL)/translations/linguist_*.qm) \
|
|---|
| 144 | $(wildcard $(QT_INSTALL)/translations/assistant_*.qm)
|
|---|
| 145 |
|
|---|
| 146 | wpi.dev.PATH = $(OUT_ROOT)/qt-dev-$(QT_VER_FULL).wpi
|
|---|
| 147 | wpi.dev.SCRIPT = $(WPI_ROOT)/dev.wis
|
|---|
| 148 | wpi.dev.PACKAGES = \
|
|---|
| 149 | pkg.dev.libraries=1 \
|
|---|
| 150 | pkg.dev.runtime=2 \
|
|---|
| 151 | pkg.dev.plugins=3 \
|
|---|
| 152 | pkg.dev.translations=4 \
|
|---|
| 153 | pkg.readme=5
|
|---|
| 154 |
|
|---|
| 155 | #
|
|---|
| 156 | # Examples archive
|
|---|
| 157 | #
|
|---|
| 158 |
|
|---|
| 159 | pkg.examples.demos.PATH = $(WPI_ROOT)/pkg.examples.demos
|
|---|
| 160 | pkg.examples.demos.SOURCES = \
|
|---|
| 161 | $(wildcard $(QT_INSTALL)/demos/*/)
|
|---|
| 162 |
|
|---|
| 163 | pkg.examples.demo-plugins.PATH = $(WPI_ROOT)/pkg.examples.demo-plugins
|
|---|
| 164 | pkg.examples.demo-plugins.SOURCES = \
|
|---|
| 165 | $(QT_INSTALL)/plugins/designer/arthurpl.dll->designer/
|
|---|
| 166 |
|
|---|
| 167 | pkg.examples.examples.PATH = $(WPI_ROOT)/pkg.examples.examples
|
|---|
| 168 | pkg.examples.examples.SOURCES = \
|
|---|
| 169 | $(wildcard $(QT_INSTALL)/examples/*/) \
|
|---|
| 170 |
|
|---|
| 171 | pkg.examples.example-plugins.PATH = $(WPI_ROOT)/pkg.examples.example-plugins
|
|---|
| 172 | pkg.examples.example-plugins.SOURCES = \
|
|---|
| 173 | $(QT_INSTALL)/plugins/designer/cntrext.dll->designer/ \
|
|---|
| 174 | $(QT_INSTALL)/plugins/designer/cstmwgt.dll->designer/ \
|
|---|
| 175 | $(QT_INSTALL)/plugins/designer/tskmext.dll->designer/ \
|
|---|
| 176 | $(QT_INSTALL)/plugins/designer/wrldclk.dll->designer/
|
|---|
| 177 |
|
|---|
| 178 | pkg.examples.qtdemo.PATH = $(WPI_ROOT)/pkg.examples.qtdemo
|
|---|
| 179 | pkg.examples.qtdemo.SOURCES = \
|
|---|
| 180 | $(QT_INSTALL)/bin/qtdemo.exe
|
|---|
| 181 |
|
|---|
| 182 | wpi.examples.PATH = $(OUT_ROOT)/qt-examples-$(QT_VER_FULL).wpi
|
|---|
| 183 | wpi.examples.SCRIPT = $(WPI_ROOT)/examples.wis
|
|---|
| 184 | wpi.examples.PACKAGES = \
|
|---|
| 185 | pkg.examples.demos=1 \
|
|---|
| 186 | pkg.examples.demo-plugins=2 \
|
|---|
| 187 | pkg.examples.examples=3 \
|
|---|
| 188 | pkg.examples.example-plugins=4 \
|
|---|
| 189 | pkg.examples.qtdemo=5 \
|
|---|
| 190 | pkg.readme=6
|
|---|
| 191 |
|
|---|
| 192 | #
|
|---|
| 193 | # Documentation archive
|
|---|
| 194 | #
|
|---|
| 195 |
|
|---|
| 196 | pkg.doc.qch.PATH = $(WPI_ROOT)/pkg.doc.qch
|
|---|
| 197 | pkg.doc.qch.SOURCES = \
|
|---|
| 198 | $(wildcard $(QT_INSTALL)/doc/qch/)
|
|---|
| 199 |
|
|---|
| 200 | wpi.doc.PATH = $(OUT_ROOT)/qt-doc-$(QT_VER_FULL).wpi
|
|---|
| 201 | wpi.doc.SCRIPT = $(WPI_ROOT)/doc.wis
|
|---|
| 202 | wpi.doc.PACKAGES = \
|
|---|
| 203 | pkg.doc.qch=1 \
|
|---|
| 204 | pkg.readme=2
|
|---|
| 205 |
|
|---|
| 206 | #
|
|---|
| 207 | # Summary
|
|---|
| 208 | #
|
|---|
| 209 |
|
|---|
| 210 | WPIS = wpi.lib wpi.lib_noxwpdep wpi.dev wpi.examples wpi.doc
|
|---|
| 211 |
|
|---|
| 212 | #-------------------------------------------------------------------------------
|
|---|
| 213 | # Core functions
|
|---|
| 214 | #-------------------------------------------------------------------------------
|
|---|
| 215 |
|
|---|
| 216 | _EMPTY_ :=
|
|---|
| 217 |
|
|---|
| 218 | _DIRS_ :=
|
|---|
| 219 |
|
|---|
| 220 | define DirRule
|
|---|
| 221 | ifeq ($(filter $(1),$(_DIRS_)),)
|
|---|
| 222 | _DIRS_ += $(1)
|
|---|
| 223 | $(1):
|
|---|
| 224 | mkdir-p.cmd $$@
|
|---|
| 225 | endif
|
|---|
| 226 | endef
|
|---|
| 227 |
|
|---|
| 228 | define EnsureDir
|
|---|
| 229 | $(eval $(call DirRule,$(1)))$(1)
|
|---|
| 230 | endef
|
|---|
| 231 |
|
|---|
| 232 | # Generate rules to copy one file.
|
|---|
| 233 | # @param $(1) Stem which file is to copy.
|
|---|
| 234 | # @param $(2) File name in format src[->tgt].
|
|---|
| 235 | define GenFileCopyRule
|
|---|
| 236 | 90 := $(subst ->, ,$(2))
|
|---|
| 237 | 91 := $$(word 1,$$(90))
|
|---|
| 238 | 92 := $$(word 2,$$(90))
|
|---|
| 239 | ifeq ($$(91:%/=/),/)
|
|---|
| 240 | 93 := 1
|
|---|
| 241 | 91 := $$(91:%/=%)
|
|---|
| 242 | else
|
|---|
| 243 | 93 := 0
|
|---|
| 244 | endif
|
|---|
| 245 | ifeq ($$(92),)
|
|---|
| 246 | 92 := $$(notdir $$(91))
|
|---|
| 247 | else
|
|---|
| 248 | ifeq ($$(92:%/=/),/)
|
|---|
| 249 | 92 := $$(92)$$(notdir $$(91))
|
|---|
| 250 | endif
|
|---|
| 251 | endif
|
|---|
| 252 | 92 := $($(1).PATH)/$$(92)
|
|---|
| 253 | $(1).TARGETS += $$(92)
|
|---|
| 254 | $$(92): $$(91) | $$(call EnsureDir,$$(dir $$(92)))
|
|---|
| 255 | ifeq ($$(93),1)
|
|---|
| 256 | xcopy /s /e /o "$$(subst /,\,$$<)" "$$(subst /,\,$$@)"\ $(_EMPTY_)
|
|---|
| 257 | else
|
|---|
| 258 | copy "$$(subst /,\,$$<)" "$$(subst /,\,$$@)"
|
|---|
| 259 | endif
|
|---|
| 260 | endef
|
|---|
| 261 |
|
|---|
| 262 | _PACKAGES_ :=
|
|---|
| 263 |
|
|---|
| 264 | # Generate rules for one WPI package.
|
|---|
| 265 | # @param $(1) Package stem.
|
|---|
| 266 | define GenPkgRule
|
|---|
| 267 | ifeq ($$(filter $(1),$$(_PACKAGES_)),)
|
|---|
| 268 | _PACKAGES_ += $(1)
|
|---|
| 269 | $$(foreach file,$$($(1).SOURCES),$$(eval $$(call GenFileCopyRule,$(1),$$(file))))
|
|---|
| 270 | $(1): $$($(1).TARGETS)
|
|---|
| 271 | clean-$(1):
|
|---|
| 272 | if exist "$($(1).PATH)" deltree.cmd "$(subst /,\,$($(1).PATH))" /Y /S
|
|---|
| 273 | endif
|
|---|
| 274 | endef
|
|---|
| 275 |
|
|---|
| 276 | define GenWpiRuleHelper
|
|---|
| 277 | 90 := $(subst =, ,$(2))
|
|---|
| 278 | 91 := $$(word 1,$$(90))
|
|---|
| 279 | 92 := $$(word 2,$$(90))
|
|---|
| 280 | $(1)._PACKAGES_CMD += $$(92) -c$$($$(91).PATH) -r *
|
|---|
| 281 | $(1).PACKAGES += $$(91)
|
|---|
| 282 | endef
|
|---|
| 283 |
|
|---|
| 284 | # Generate rules for one WPI archive.
|
|---|
| 285 | # @param $(1) WPI stem.
|
|---|
| 286 | define GenWpiRule
|
|---|
| 287 | $(eval $(1)._PACKAGES := $($(1).PACKAGES))
|
|---|
| 288 | $(eval $(1)._PACKAGES_CMD :=)
|
|---|
| 289 | $(eval $(1).PACKAGES :=)
|
|---|
| 290 | $(foreach pkg,$($(1)._PACKAGES),$(eval $(call GenWpiRuleHelper,$(1),$(pkg))))
|
|---|
| 291 | # generate WPI target (depends on clean to make sure the removed files are not packed)
|
|---|
| 292 | $(1): clean-$(1) $($(1).PACKAGES) $($(1).SCRIPT)
|
|---|
| 293 | -del $(subst /,\,$($(1).PATH))
|
|---|
| 294 | $(WIC) $($(1).PATH) -a $($(1)._PACKAGES_CMD) -s $($(1).SCRIPT)
|
|---|
| 295 | # clean WPI target
|
|---|
| 296 | clean-$(1): $(foreach pkg,$($(1).PACKAGES),clean-$(pkg))
|
|---|
| 297 | # helpers
|
|---|
| 298 | $(foreach pkg,$($(1).PACKAGES),$(eval $(pkg).TARGETS :=))
|
|---|
| 299 | $(foreach pkg,$($(1).PACKAGES),$(eval $(call GenPkgRule,$(pkg))))
|
|---|
| 300 | endef
|
|---|
| 301 |
|
|---|
| 302 | #-------------------------------------------------------------------------------
|
|---|
| 303 | # Core function invocations
|
|---|
| 304 | #-------------------------------------------------------------------------------
|
|---|
| 305 |
|
|---|
| 306 | .PHONY: $(WPIS) $(foreach wpi,$(WPIS),$($(wpi).PACKAGES))
|
|---|
| 307 |
|
|---|
| 308 | $(foreach wpi,$(WPIS),$(eval $(call GenWpiRule,$(wpi))))
|
|---|
| 309 |
|
|---|