|
| 1 | +# Copyright (c) 2026 Project CHIP Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +include $(TOPDIR)/rules.mk |
| 16 | + |
| 17 | +PKG_NAME:=arm-gnu-rm-toolchain |
| 18 | +UPSTREAM_VERSION:=10.3-2021.10 |
| 19 | +PKG_VERSION:=$(subst -,.,$(UPSTREAM_VERSION)) |
| 20 | + |
| 21 | +PrebuiltTarball=gcc-arm-none-eabi-$(UPSTREAM_VERSION)-$(1).tar.bz2 |
| 22 | +define Download/prebuilt |
| 23 | + URL:=https://developer.arm.com/-/media/files/downloads/gnu-rm/$(UPSTREAM_VERSION)/ |
| 24 | + FILE:=$(call PrebuiltTarball,$(1)) |
| 25 | +endef |
| 26 | +define Download/x86_64-linux |
| 27 | + $(call Download/prebuilt,x86_64-linux) |
| 28 | + MD5SUM:=2383e4eb4ea23f248d33adc70dc3227e |
| 29 | +endef |
| 30 | +define Download/aarch64-linux |
| 31 | + $(call Download/prebuilt,aarch64-linux) |
| 32 | + MD5SUM:=3fe3d8bb693bd0a6e4615b6569443d0d |
| 33 | +endef |
| 34 | +define Download/mac |
| 35 | + $(call Download/prebuilt,mac) |
| 36 | + MD5SUM:=7f2a7b7b23797302a9d6182c6e482449 |
| 37 | +endef |
| 38 | + |
| 39 | +PKG_LICENSE:=GPL-3.0-or-later LGPL-3.0-or-later MIT Zlib |
| 40 | +PKG_LICENSE_FILES:=license.txt |
| 41 | + |
| 42 | +PKG_HOST_ONLY:=1 |
| 43 | + |
| 44 | +include $(INCLUDE_DIR)/package.mk |
| 45 | +include $(INCLUDE_DIR)/host-build.mk |
| 46 | + |
| 47 | +define Package/arm-gnu-rm-toolchain |
| 48 | + SECTION:=devel |
| 49 | + CATEGORY:=Development |
| 50 | + TITLE:=arm-gnu-rm-toolchain |
| 51 | + URL:=https://developer.arm.com/downloads/-/gnu-rm |
| 52 | + BUILDONLY:=1 |
| 53 | +endef |
| 54 | + |
| 55 | +define Package/arm-gnu-rm-toolchain/description |
| 56 | + The GNU Arm Embedded Toolchain for 32-bit Arm Cortex-A, Arm Cortex-M, and Arm Cortex-R processor families. |
| 57 | +endef |
| 58 | + |
| 59 | +PREBUILT_FLAVOR:=$(if $(filter Darwin,$(HOST_OS)),mac,$(HOST_ARCH)-$(call tolower,$(HOST_OS))) |
| 60 | +PREBUILT_TARBALL:=$(DL_DIR)/$(call PrebuiltTarball,$(PREBUILT_FLAVOR)) |
| 61 | +$(if $(strip $(Download/$(PREBUILT_FLAVOR))),$(eval $(call Download,$(PREBUILT_FLAVOR)))) |
| 62 | + |
| 63 | +Host/Prepare:=$(empty) |
| 64 | +Host/Configure:=$(empty) |
| 65 | + |
| 66 | +define Host/Compile |
| 67 | + test -f $(PREBUILT_TARBALL) || { echo "ERROR: Unsupported host platform '$(PREBUILT_FLAVOR)'"; false; } |
| 68 | +endef |
| 69 | + |
| 70 | +define Host/Install |
| 71 | + bzcat $(PREBUILT_TARBALL) | $(HOST_TAR) -C $(1) --strip-components 1 -xf - |
| 72 | +endef |
| 73 | + |
| 74 | +$(eval $(call BuildPackage,arm-gnu-rm-toolchain)) |
| 75 | +$(eval $(call HostBuild)) |
0 commit comments