2009-11-14 17:51:32 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2008-2009 Industrie Dial Face S.p.A.
|
|
|
|
# Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com>
|
|
|
|
# Copyright (C) 2006-2008 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
2016-01-03 14:44:36 +00:00
|
|
|
include $(INCLUDE_DIR)/version.mk
|
2009-11-14 17:51:32 +00:00
|
|
|
|
|
|
|
override MAKEFLAGS=
|
|
|
|
|
2016-05-26 14:22:09 +00:00
|
|
|
TOOLCHAIN_NAME:=$(VERSION_DIST_SANITIZED)-toolchain-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))_gcc-$(GCCV)$(DIR_SUFFIX).$(HOST_OS)-$(HOST_ARCH)
|
2009-11-14 17:51:32 +00:00
|
|
|
TOOLCHAIN_BUILD_DIR:=$(BUILD_DIR)/$(TOOLCHAIN_NAME)
|
2020-06-12 18:43:46 +00:00
|
|
|
EXCLUDE_DIRS:= \
|
2014-08-26 12:32:51 +00:00
|
|
|
*/initial \
|
2009-11-14 17:51:32 +00:00
|
|
|
*/stamp \
|
|
|
|
*/stampfiles \
|
|
|
|
*/man \
|
|
|
|
*/info
|
|
|
|
|
|
|
|
all: compile
|
|
|
|
|
2010-04-15 00:33:40 +00:00
|
|
|
TOOLCHAIN_PREFIX:=$(TOOLCHAIN_BUILD_DIR)/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)$(DIR_SUFFIX)
|
2009-11-19 17:23:31 +00:00
|
|
|
|
2024-02-13 00:03:44 +00:00
|
|
|
$(BIN_DIR)/$(TOOLCHAIN_NAME).tar.zst: clean
|
2009-11-14 17:51:32 +00:00
|
|
|
mkdir -p $(TOOLCHAIN_BUILD_DIR)
|
|
|
|
$(TAR) -cf - -C $(TOPDIR)/staging_dir/ \
|
|
|
|
$(foreach exclude,$(EXCLUDE_DIRS),--exclude="$(exclude)") \
|
2010-04-15 00:33:40 +00:00
|
|
|
toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)$(DIR_SUFFIX) | \
|
2009-11-14 17:51:32 +00:00
|
|
|
$(TAR) -xf - -C $(TOOLCHAIN_BUILD_DIR)
|
|
|
|
|
2021-02-14 20:51:14 +00:00
|
|
|
$(CP) \
|
|
|
|
$(TOPDIR)/LICENSES \
|
|
|
|
$(TOPDIR)/COPYING \
|
|
|
|
./files/README.TOOLCHAIN \
|
2009-11-14 17:51:32 +00:00
|
|
|
$(TOOLCHAIN_BUILD_DIR)/
|
|
|
|
|
2010-09-04 11:56:33 +00:00
|
|
|
$(CP) ./files/wrapper.sh $(TOOLCHAIN_PREFIX)/bin/$(REAL_GNU_TARGET_NAME)-wrapper.sh
|
|
|
|
chmod +x $(TOOLCHAIN_PREFIX)/bin/$(REAL_GNU_TARGET_NAME)-wrapper.sh
|
|
|
|
(cd $(TOOLCHAIN_PREFIX)/bin; \
|
2009-11-19 17:23:31 +00:00
|
|
|
for app in cc gcc g++ c++ cpp ld as ; do \
|
|
|
|
[ -f $(REAL_GNU_TARGET_NAME)-$${app} ] && mv $(REAL_GNU_TARGET_NAME)-$${app} $(REAL_GNU_TARGET_NAME)-$${app}.bin ; \
|
|
|
|
ln -sf $(REAL_GNU_TARGET_NAME)-wrapper.sh $(REAL_GNU_TARGET_NAME)-$${app} ; \
|
|
|
|
done; \
|
|
|
|
)
|
2014-08-26 12:32:51 +00:00
|
|
|
|
|
|
|
@-( \
|
|
|
|
find \
|
|
|
|
$(TOOLCHAIN_BUILD_DIR)/*/bin \
|
|
|
|
$(TOOLCHAIN_BUILD_DIR)/*/*/bin \
|
|
|
|
$(TOOLCHAIN_BUILD_DIR)/*/libexec \
|
|
|
|
-type f; \
|
|
|
|
) | xargs strip 2>/dev/null >/dev/null
|
|
|
|
|
2009-11-14 17:51:32 +00:00
|
|
|
echo REVISION:="$(REVISION)" > $(TOOLCHAIN_BUILD_DIR)/version.mk
|
|
|
|
find $(TOOLCHAIN_BUILD_DIR) -name .git | $(XARGS) rm -rf
|
|
|
|
find $(TOOLCHAIN_BUILD_DIR) -name .svn | $(XARGS) rm -rf
|
|
|
|
find $(TOOLCHAIN_BUILD_DIR) -name CVS | $(XARGS) rm -rf
|
2016-08-09 10:59:06 +00:00
|
|
|
mkdir -p $(BIN_DIR)
|
2009-11-14 17:51:32 +00:00
|
|
|
(cd $(BUILD_DIR); \
|
2024-02-13 00:03:44 +00:00
|
|
|
tar -I '$(STAGING_DIR_HOST)/bin/zstd -T0 --ultra -20' -cf $@ $(TOOLCHAIN_NAME) \
|
2021-10-21 01:54:26 +00:00
|
|
|
--mtime="$(shell date --date=@$(SOURCE_DATE_EPOCH))"; \
|
2009-11-14 17:51:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
download:
|
|
|
|
prepare:
|
2024-02-13 00:03:44 +00:00
|
|
|
compile: $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.zst
|
2009-11-14 17:51:32 +00:00
|
|
|
install: compile
|
|
|
|
|
|
|
|
clean:
|
2024-02-13 00:03:44 +00:00
|
|
|
rm -rf $(TOOLCHAIN_BUILD_DIR) $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.zst
|