forked from gperciva/gub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gub.make
81 lines (60 loc) · 2.07 KB
/
gub.make
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
CWD:=$(shell pwd)
PYTHON=python
PYTHONPATH=.
export PYTHONPATH
-include local.make
## must always have one host.
GUB_DISTCC_ALLOW_HOSTS=127.0.0.1
GUB = $(PYTHON) bin/gub
GPKG = $(PYTHON) bin/gpkg
INSTALLER_BUILDER = $(PYTHON) bin/gib
CYGWIN_PACKAGER = $(PYTHON) bin/cygwin-packager \
$(CYGWIN_PACKAGER_OPTIONS)\
$(LOCAL_CYGWIN_PACKAGER_OPTIONS)
ifneq ($(LOCAL_GUB_BUILDER_OPTIONS),)
$(warning LOCAL_GUB_BUILDER_OPTIONS is deprecated, use LOCAL_GUB_OPTIONS)
LOCAL_GUB_OPTIONS += $(LOCAL_GUB_BUILDER_OPTIONS)
endif
LOCAL_GUB_OPTIONS += $(GUB_ONLINE_OPTION)
INVOKE_GUB=$(GUB)\
--platform=$(1)\
$(foreach h,$(GUB_NATIVE_DISTCC_HOSTS), --native-distcc-host=$(h))\
$(foreach h,$(GUB_CROSS_DISTCC_HOSTS), --cross-distcc-host=$(h))\
$(GUB_OPTIONS)\
$(LOCAL_GUB_OPTIONS)
INVOKE_GUP=$(GPKG)\
--platform=$(1)\
$(GPKG_OPTIONS)\
$(LOCAL_GPKG_OPIONS)
INVOKE_INSTALLER_BUILDER=$(INSTALLER_BUILDER)\
--platform=$(1)\
$(INSTALLER_BUILDER_OPTIONS)\
$(LOCAL_INSTALLER_BUILDER_OPTIONS)
# BUILD platform build-package-name install-package-name
BUILD=$(call INVOKE_GUB,$(1)) $(2)\
&& $(call INVOKE_INSTALLER_BUILDER,$(1)) $(3)
BUILD_PLATFORM = $(shell $(PYTHON) bin/build-platform)
OTHER_PLATFORMS=$(filter-out $(BUILD_PLATFORM), $(PLATFORMS))
.PHONY: $(PLATFORMS)
download:
ifdef $(BUILD_PACKAGE)
$(call INVOKE_GUB,$(BUILD_PLATFORM)) --download-only $(BUILD_PACKAGE) $(OTHER_PLATFORMS:%=%::$(BUILD_PACKAGE))
endif
$(PLATFORMS):
$(call BUILD,$@,$(BUILD_PACKAGE),$(INSTALL_PACKAGE))
native:
$(MAKE) PLATFORMS=$(BUILD_PLATFORM) packages installers
packages:
$(call INVOKE_GUB,$(BUILD_PLATFORM)) $(BUILD_PACKAGE) $(OTHER_PLATFORMS:%=%::$(BUILD_PACKAGE))
installers: packages
$(foreach p,$(PLATFORMS),$(call INVOKE_INSTALLER_BUILDER,$(p)) $(INSTALL_PACKAGE) && ) :
lilypond-installers: packages
$(foreach p,$(PLATFORMS),$(call INVOKE_GUB,$(p)) $(INSTALL_PACKAGE) && ) :
platforms: $(PLATFORMS)
debian-%:
$(call BUILD,$@,$(BUILD_PACKAGE))
cygwin-%:
rm -f uploads/cygwin/setup.ini
$(call INVOKE_GUB,cygwin) --build-source $(@:cygwin-%=%)
cygwin-%-installer:
$(CYGWIN_PACKAGER) $(@:cygwin-%-installer=%)