# # Helper makefile for make_packages.cmd # all: @echo This Makefile is not intended to be used directly. @echo Use make_packages.cmd instead. #------------------------------------------------------------------------------- # Environment checks #------------------------------------------------------------------------------- ifeq ($(WIC),) $(error WIC unset!) endif ifeq ($(OUT_ROOT),) $(error OUT_ROOT unset!) endif ifeq ($(WPI_ROOT),) $(error WPI_ROOT unset!) endif ifeq ($(QT_BUILD),) $(error QT_BUILD unset!) endif ifeq ($(QT_INSTALL),) $(error QT_INSTALL unset!) endif ifeq ($(QT_VER_FULL),) $(error QT_VER_FULL unset!) endif $(foreach var,WPI_ROOT QT_BUILD QT_INSTALL,\ $(eval $(var) := $(subst \,/,$($(var))))) #------------------------------------------------------------------------------- # Definitions #------------------------------------------------------------------------------- pkg.readme.PATH = $(WPI_ROOT)/pkg.readme pkg.readme.SOURCES = \ $(QT_BUILD)/LGPL_EXCEPTION.txt \ $(QT_BUILD)/LICENSE.GPL3 \ $(QT_BUILD)/LICENSE.LGPL \ $(wildcard $(QT_BUILD)/changes-*) \ $(QT_BUILD)/README \ $(QT_BUILD)/README.OS2 \ $(QT_BUILD)/CHANGES.OS2 # Runtime archive pkg.lib.runtime.PATH = $(WPI_ROOT)/pkg.lib.runtime pkg.lib.runtime.SOURCES = \ $(QT_INSTALL)/bin/QtCore4.dll \ $(QT_INSTALL)/bin/QtGui4.dll \ $(QT_INSTALL)/bin/QtNet4.dll \ $(QT_INSTALL)/bin/QtScri4.dll \ $(QT_INSTALL)/bin/QtScTl4.dll \ $(QT_INSTALL)/bin/QtSql4.dll \ $(QT_INSTALL)/bin/QtSvg4.dll \ $(QT_INSTALL)/bin/QtTest4.dll \ $(QT_INSTALL)/bin/QtXml4.dll \ $(QT_INSTALL)/bin/QtXmlP4.dll pkg.lib.instutils.PATH = $(WPI_ROOT)/pkg.lib.instutils pkg.lib.instutils.SOURCES = \ UpdateQtSysConf.cmd->util/ pkg.lib.plugins.PATH = $(WPI_ROOT)/pkg.lib.plugins pkg.lib.plugins.SOURCES = \ $(addsuffix ->accessible/, $(wildcard $(QT_INSTALL)/plugins/accessible/*.dll)) \ $(addsuffix ->codecs/, $(wildcard $(QT_INSTALL)/plugins/codecs/*.dll)) \ $(addsuffix ->iconengines/, $(wildcard $(QT_INSTALL)/plugins/iconengines/*.dll)) \ $(addsuffix ->imageformats/,$(wildcard $(QT_INSTALL)/plugins/imageformats/*.dll)) \ $(addsuffix ->sqldrivers/, $(wildcard $(QT_INSTALL)/plugins/sqldrivers/*.dll)) pkg.lib.translations.PATH = $(WPI_ROOT)/pkg.lib.translations pkg.lib.translations.SOURCES = \ $(filter-out $(wildcard $(QT_INSTALL)/translations/qt_help*.qm),\ $(wildcard $(QT_INSTALL)/translations/qt_*.qm)) pkg.lib.systray.PATH = $(WPI_ROOT)/pkg.lib.systray pkg.lib.systray.SOURCES = \ $(QT_BUILD)/plugins/xcenter/xsystray.dll->plugins/xcenter/ wpi.lib.PATH = $(OUT_ROOT)/qt-lib-$(QT_VER_FULL).wpi wpi.lib.SCRIPT = $(WPI_ROOT)/lib.wis wpi.lib.PACKAGES = pkg.lib.runtime=1 pkg.lib.instutils=2 pkg.lib.plugins=3 \ pkg.lib.translations=4 pkg.lib.systray=5 pkg.readme=6 # Development archive # @todo QtDsgn4.dll and QtDsgC4.dll must be taken from $(QT_INSTALL) # on the next release # @todo private/qpmobjectwindow_pm_p.h must not be included at all after the fix! pkg.dev.libraries.PATH = $(WPI_ROOT)/pkg.dev.libraries pkg.dev.libraries.SOURCES = \ $(addsuffix ->bin/, $(wildcard $(QT_INSTALL)/bin/*.exe)) \ $(addsuffix ->lib/, $(wildcard $(QT_INSTALL)/lib/*.lib)) \ $(addsuffix ->lib/, $(wildcard $(QT_INSTALL)/lib/*.prl)) \ $(QT_INSTALL)/mkspecs/default/->mkspecs/ \ $(QT_INSTALL)/mkspecs/features/->mkspecs/ \ $(QT_INSTALL)/mkspecs/os2-g++/->mkspecs/ \ $(QT_INSTALL)/mkspecs/qconfig.pri->mkspecs/ \ $(QT_INSTALL)/include/ \ $(QT_INSTALL)/phrasebooks/ \ QtEnv.cmd->util/ \ $(QT_BUILD)/src/corelib/kernel/qpmobjectwindow_pm_p.h->include/QtCore/private/ pkg.dev.runtime.PATH = $(WPI_ROOT)/pkg.dev.runtime pkg.dev.runtime.SOURCES = \ $(QT_BUILD)/bin/QtDsgn4.dll \ $(QT_BUILD)/bin/QtDsgC4.dll pkg.dev.translations.PATH = $(WPI_ROOT)/pkg.dev.translations pkg.dev.translations.SOURCES = \ $(wildcard $(QT_INSTALL)/translations/designer_*.qm) \ $(wildcard $(QT_INSTALL)/translations/linguist_*.qm) wpi.dev.PATH = $(OUT_ROOT)/qt-dev-$(QT_VER_FULL).wpi wpi.dev.SCRIPT = $(WPI_ROOT)/dev.wis wpi.dev.PACKAGES = pkg.dev.libraries=1 pkg.dev.runtime=2 \ pkg.dev.translations=3 pkg.readme=4 # Examples archive pkg.examples.demos.PATH = $(WPI_ROOT)/pkg.examples.demos pkg.examples.demos.SOURCES = \ $(wildcard $(QT_INSTALL)/demos/*/) \ pkg.examples.demo-plugins.PATH = $(WPI_ROOT)/pkg.examples.demo-plugins pkg.examples.demo-plugins.SOURCES = \ $(QT_INSTALL)/plugins/designer/arthurpl.dll->designer/ pkg.examples.examples.PATH = $(WPI_ROOT)/pkg.examples.examples pkg.examples.examples.SOURCES = \ $(wildcard $(QT_INSTALL)/examples/*/) \ # @todo add examples.example-plugins # @todo install qtdemo in bin/ when its' ready wpi.examples.PATH = $(OUT_ROOT)/qt-examples-$(QT_VER_FULL).wpi wpi.examples.SCRIPT = $(WPI_ROOT)/examples.wis wpi.examples.PACKAGES = pkg.examples.demos=1 pkg.examples.demo-plugins=2 \ pkg.examples.examples=3 \ pkg.readme=4 # Summary WPIS = wpi.lib wpi.dev wpi.examples #------------------------------------------------------------------------------- # Core functions #------------------------------------------------------------------------------- _EMPTY_ := _DIRS_ := define EnsureDir ifneq ($(1),./) ifneq ($(1:%:/=:/),:/) ifeq ($$(filter $(1),$$(_DIRS_)),) _DIRS_ += $(1) $$(eval $$(call EnsureDir,$(dir $(1:%/=%)))) $$(shell if not exist $(subst /,\,$(1:%/=%)) mkdir $(subst /,\,$(1:%/=%)) >nul 2>&1) endif endif endif endef # Generate rules to copy one file. # @param $(1) Stem whose file is to copy. # @param $(2) File name in format src[->tgt]. define GenFileCopyRule 90 := $(subst ->, ,$(2)) 91 := $$(word 1,$$(90)) 92 := $$(word 2,$$(90)) ifeq ($$(91:%/=/),/) 93 := 1 91 := $$(91:%/=%) else 93 := 0 endif ifeq ($$(92),) 92 := $$(notdir $$(91)) else ifeq ($$(92:%/=/),/) 92 := $$(92)$$(notdir $$(91)) endif endif 92 := $($(1).PATH)/$$(92) $(1).TARGETS += $$(92) $$(eval $$(call EnsureDir,$$(dir $$(92)))) $$(92): $$(91) ifeq ($$(93),1) xcopy /s /e /o "$$(subst /,\,$$<)" "$$(subst /,\,$$@)"\ $(_EMPTY_) else copy "$$(subst /,\,$$<)" "$$(subst /,\,$$@)" endif endef _PACKAGES_ := # Generate rules for one WPI package. # @param $(1) Package stem. define GenPkgRule ifeq ($$(filter $(1),$$(_PACKAGES_)),) _PACKAGES_ += $(1) $$(foreach file,$$($(1).SOURCES),$$(eval $$(call GenFileCopyRule,$(1),$$(file)))) $(1): $$($(1).TARGETS) endif endef define GenWpiRuleHelper 90 := $(subst =, ,$(2)) 91 := $$(word 1,$$(90)) 92 := $$(word 2,$$(90)) $(1)._PACKAGES_CMD += $$(92) -c$$($$(91).PATH) -r * $(1).PACKAGES += $$(91) endef # Generate rules for one WPI archive. # @param $(1) WPI stem. define GenWpiRule $(eval $(1)._PACKAGES := $($(1).PACKAGES)) $(eval $(1)._PACKAGES_CMD :=) $(eval $(1).PACKAGES :=) $(foreach pkg,$($(1)._PACKAGES),$(eval $(call GenWpiRuleHelper,$(1),$(pkg)))) $(1): $($(1).PACKAGES) $($(1).SCRIPT) -del $($(1).PATH) $(WIC) $($(1).PATH) -a $($(1)._PACKAGES_CMD) -s $($(1).SCRIPT) $(foreach pkg,$($(1).PACKAGES),$(eval $(pkg).TARGETS :=)) $(foreach pkg,$($(1).PACKAGES),$(eval $(call GenPkgRule,$(pkg)))) endef #------------------------------------------------------------------------------- # Core function invocations #------------------------------------------------------------------------------- .PHONY: $(WPIS) $(foreach wpi,$(WPIS),$($(wpi).PACKAGES)) $(foreach wpi,$(WPIS),$(eval $(call GenWpiRule,$(wpi))))