|
57 | 57 |
|
58 | 58 | COMMA := , |
59 | 59 |
|
60 | | -os := $(shell uname -o) |
61 | | -cpu := $(shell uname -m) |
| 60 | +OS := $(shell uname -o) |
| 61 | +CPU := $(shell uname -m) |
62 | 62 |
|
63 | 63 | # Figure out what platform this is building on. |
64 | | -me := $(cpu)-$(if $(findstring Linux,$(os)),linux-gnu) |
| 64 | +ME := $(CPU)-$(if $(findstring Linux,$(OS)),linux-gnu) |
65 | 65 |
|
66 | | -$(info Building on platform $(me)) |
| 66 | +$(info Building on platform $(ME)) |
67 | 67 |
|
68 | 68 | # |
69 | 69 | # By default just build for the current platform, which is assumed to be Linux |
70 | 70 | # |
71 | 71 | ifeq ($(TARGETS), ) |
72 | | - platforms := $(me) |
73 | | - host_platforms := $(platforms) |
| 72 | + PLATFORMS := $(ME) |
| 73 | + HOST_PLATFORMS := $(PLATFORMS) |
74 | 74 | else |
75 | | - platforms := $(subst $(COMMA), , $(TARGETS)) |
76 | | - host_platforms := $(me) |
| 75 | + PLATFORMS := $(subst $(COMMA), , $(TARGETS)) |
| 76 | + HOST_PLATFORMS := $(ME) |
77 | 77 | endif |
78 | | -target_platforms := $(platforms) |
79 | | -$(info host_platforms $(host_platforms)) |
80 | | -$(info target_platforms $(target_platforms)) |
| 78 | +TARGET_PLATFORMS := $(PLATFORMS) |
| 79 | +$(info HOST_PLATFORMS $(HOST_PLATFORMS)) |
| 80 | +$(info TARGET_PLATFORMS $(TARGET_PLATFORMS)) |
81 | 81 |
|
82 | | -all compile : $(platforms) |
| 82 | +all compile : $(PLATFORMS) |
83 | 83 |
|
84 | 84 | ifeq ($(SKIP_ME), ) |
85 | | - $(foreach p,$(filter-out $(me),$(platforms)),$(eval $(p) : $$(me))) |
| 85 | + $(foreach p,$(filter-out $(ME),$(PLATFORMS)),$(eval $(p) : $$(ME))) |
86 | 86 | endif |
87 | 87 |
|
88 | 88 | OUTPUT_ROOT = $(abspath ../../build/devkit) |
89 | 89 | RESULT = $(OUTPUT_ROOT)/result |
90 | 90 |
|
91 | | -submakevars = HOST=$@ BUILD=$(me) RESULT=$(RESULT) OUTPUT_ROOT=$(OUTPUT_ROOT) |
| 91 | +SUBMAKEVARS = HOST=$@ BUILD=$(ME) RESULT=$(RESULT) OUTPUT_ROOT=$(OUTPUT_ROOT) |
92 | 92 |
|
93 | | -$(host_platforms) : |
| 93 | +$(HOST_PLATFORMS) : |
94 | 94 | @echo 'Building compilers for $@' |
95 | | - @echo 'Targets: $(target_platforms)' |
96 | | - for p in $(filter $@, $(target_platforms)) $(filter-out $@, $(target_platforms)); do \ |
97 | | - $(MAKE) -f Tools.gmk download-rpms $(submakevars) \ |
| 95 | + @echo 'Targets: $(TARGET_PLATFORMS)' |
| 96 | + for p in $(filter $@, $(TARGET_PLATFORMS)) $(filter-out $@, $(TARGET_PLATFORMS)); do \ |
| 97 | + $(MAKE) -f Tools.gmk download-rpms $(SUBMAKEVARS) \ |
98 | 98 | TARGET=$$p PREFIX=$(RESULT)/$@-to-$$p && \ |
99 | | - $(MAKE) -f Tools.gmk all $(submakevars) \ |
| 99 | + $(MAKE) -f Tools.gmk all $(SUBMAKEVARS) \ |
100 | 100 | TARGET=$$p PREFIX=$(RESULT)/$@-to-$$p && \ |
101 | | - $(MAKE) -f Tools.gmk ccache $(submakevars) \ |
| 101 | + $(MAKE) -f Tools.gmk ccache $(SUBMAKEVARS) \ |
102 | 102 | TARGET=$@ PREFIX=$(RESULT)/$@-to-$$p || exit 1 ; \ |
103 | 103 | done |
104 | 104 | @echo 'All done"' |
105 | 105 |
|
106 | | -today := $(shell date +%Y%m%d) |
| 106 | +TODAY := $(shell date +%Y%m%d) |
107 | 107 |
|
108 | 108 | define Mktar |
109 | | - $(1)-to-$(2)_tar = $$(RESULT)/sdk-$(1)-to-$(2)-$$(today).tar.gz |
| 109 | + $(1)-to-$(2)_tar = $$(RESULT)/sdk-$(1)-to-$(2)-$$(TODAY).tar.gz |
110 | 110 | $$($(1)-to-$(2)_tar) : PLATFORM = $(1)-to-$(2) |
111 | 111 | TARFILES += $$($(1)-to-$(2)_tar) |
112 | 112 | endef |
113 | 113 |
|
114 | | -$(foreach p,$(host_platforms),$(foreach t,$(target_platforms),$(eval $(call Mktar,$(p),$(t))))) |
| 114 | +$(foreach p,$(HOST_PLATFORMS),$(foreach t,$(TARGET_PLATFORMS),$(eval $(call Mktar,$(p),$(t))))) |
115 | 115 |
|
116 | 116 | tars : all $(TARFILES) |
117 | 117 | onlytars : $(TARFILES) |
118 | 118 | %.tar.gz : |
119 | 119 | $(MAKE) -r -f Tars.gmk SRC_DIR=$(RESULT)/$(PLATFORM) TAR_FILE=$@ |
120 | 120 |
|
121 | 121 | clean : |
122 | | - rm -rf $(addprefix ../../build/devkit/, result $(host_platforms)) |
| 122 | + rm -rf $(addprefix ../../build/devkit/, result $(HOST_PLATFORMS)) |
123 | 123 | dist-clean: clean |
124 | 124 | rm -rf $(addprefix ../../build/devkit/, src download) |
125 | 125 |
|
126 | 126 | FORCE : |
127 | | -.PHONY : all compile tars $(configs) $(host_platforms) clean dist-clean |
| 127 | +.PHONY : all compile tars $(HOST_PLATFORMS) clean dist-clean |
0 commit comments