vanhofen
4 years ago
16 changed files with 196 additions and 195 deletions
@ -1,134 +0,0 @@ |
|||
#
|
|||
# makefile to build crosstools
|
|||
#
|
|||
# -----------------------------------------------------------------------------
|
|||
|
|||
crosstool: $(CROSS_DIR) |
|||
|
|||
crosstools: |
|||
for boxseries in hd1 hd2 hd5x hd6x vusolo4k vuduo4k vuduo4kse vuultimo4k vuzero4k vuuno4k vuuno4kse vuduo; do \
|
|||
echo "make crosstool-ng for $${boxseries}"; \
|
|||
make BOXSERIES=$${boxseries} crosstool || exit; \
|
|||
done; |
|||
|
|||
# -----------------------------------------------------------------------------
|
|||
|
|||
CROSSTOOL_BACKUP = $(DL_DIR)/crosstool-ng-$(TARGET_ARCH)-linux-$(KERNEL_VERSION)-backup.tar.gz |
|||
|
|||
$(CROSSTOOL_BACKUP): |
|||
$(call draw_line); |
|||
@echo "CROSSTOOL_BACKUP does not exist. You probably need to run 'make crosstool-backup' first." |
|||
$(call draw_line); |
|||
@false |
|||
|
|||
crosstool-backup: |
|||
$(CD) $(CROSS_DIR); \
|
|||
tar -czvf $(CROSSTOOL_BACKUP) * |
|||
|
|||
crosstool-restore: $(CROSSTOOL_BACKUP) |
|||
make cross-clean |
|||
mkdir -p $(CROSS_DIR) |
|||
tar -xzvf $(CROSSTOOL_BACKUP) -C $(CROSS_DIR) |
|||
|
|||
# -----------------------------------------------------------------------------
|
|||
|
|||
crosstools-renew: |
|||
for boxseries in hd1 hd2 hd5x hd6x vusolo4k vuduo4k vuduo4kse vuultimo4k vuzero4k vuuno4k vuuno4kse vuduo; do \
|
|||
make BOXSERIES=$${boxseries} ccache-clean || exit; \
|
|||
done; |
|||
make host-clean |
|||
make static-base-clean |
|||
make cross-base-clean |
|||
make crosstools |
|||
make clean |
|||
|
|||
# -----------------------------------------------------------------------------
|
|||
|
|||
# wrapper for manually call
|
|||
kernel-tarball: $(BUILD_DIR)/linux-$(KERNEL_VERSION).tar |
|||
|
|||
# create kernel-tarball
|
|||
$(BUILD_DIR)/linux-$(KERNEL_VERSION).tar: | $(BUILD_DIR) |
|||
$(MAKE) kernel.do_prepare_$(if $(filter $(KERNEL_SOURCE),git),git,tar) |
|||
tar cf $(@) --exclude-vcs -C $(BUILD_DIR)/$(KERNEL_DIR) . |
|||
|
|||
# -----------------------------------------------------------------------------
|
|||
|
|||
CROSSTOOL_NG_VERSION = git |
|||
CROSSTOOL_NG_DIR = crosstool-ng.$(CROSSTOOL_NG_VERSION) |
|||
CROSSTOOL_NG_SOURCE = crosstool-ng.$(CROSSTOOL_NG_VERSION) |
|||
CROSSTOOL_NG_SITE = https://github.com/neutrino-images |
|||
|
|||
CROSSTOOL_NG_PATCH = crosstool-ng-bash-version.patch |
|||
|
|||
CROSSTOOL_NG_CONFIG = $(PACKAGE_DIR)/crosstool-ng/files/ct-ng-$(BOXTYPE).config |
|||
ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd1 hd2)) |
|||
CROSSTOOL_NG_CONFIG = $(PACKAGE_DIR)/crosstool-ng/files/ct-ng-$(BOXTYPE)-$(BOXSERIES).config |
|||
endif |
|||
|
|||
# crosstool for hd2 depends on gcc-linaro
|
|||
GCC_LINARO_VERSION = 4.9-2017.01 |
|||
GCC_LINARO_SOURCE = gcc-linaro-$(GCC_LINARO_VERSION).tar.xz |
|||
GCC_LINARO_SITE = https://releases.linaro.org/components/toolchain/gcc-linaro/$(GCC_LINARO_VERSION) |
|||
|
|||
$(DL_DIR)/$(GCC_LINARO_SOURCE): |
|||
$(DOWNLOAD) $(GCC_LINARO_SITE)/$(GCC_LINARO_SOURCE) |
|||
|
|||
UCLIBC_VERSION = 1.0.24 |
|||
|
|||
# -----------------------------------------------------------------------------
|
|||
|
|||
# crosstool for arm-hd2 depends on gcc-linaro
|
|||
$(CROSS_BASE)/arm/hd2: $(DL_DIR)/$(GCC_LINARO_SOURCE) |
|||
|
|||
$(CROSS_DIR): | $(BUILD_DIR) |
|||
make $(BUILD_DIR)/linux-$(KERNEL_VERSION).tar |
|||
# |
|||
$(REMOVE)/$(CROSSTOOL_NG_DIR) |
|||
$(GET-GIT-SOURCE) $(CROSSTOOL_NG_SITE)/$(CROSSTOOL_NG_SOURCE) $(DL_DIR)/$(CROSSTOOL_NG_SOURCE) |
|||
$(CPDIR)/$(CROSSTOOL_NG_SOURCE) |
|||
ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd1 hd2)) |
|||
$(CHDIR)/$(CROSSTOOL_NG_DIR); \
|
|||
git checkout 1dbb06f2; \
|
|||
$(call apply_patches,$(PACKAGE_DIR)/crosstool-ng/patches/$(CROSSTOOL_NG_PATCH)) |
|||
ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd2)) |
|||
$(CHDIR)/$(CROSSTOOL_NG_DIR); \
|
|||
$(INSTALL_COPY) $(PACKAGE_DIR)/crosstool-ng/patches/gcc/* patches/gcc/linaro-6.3-2017.02 |
|||
endif |
|||
endif |
|||
$(CHDIR)/$(CROSSTOOL_NG_DIR); \
|
|||
unset CONFIG_SITE LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE; \
|
|||
$(INSTALL_DATA) $(CROSSTOOL_NG_CONFIG) .config; \
|
|||
$(SED) "s|^CT_PARALLEL_JOBS=.*|CT_PARALLEL_JOBS=$(PARALLEL_JOBS)|" .config; \
|
|||
export NI_LOCAL_TARBALLS_DIR=$(DL_DIR); \
|
|||
export NI_PREFIX_DIR=$(@); \
|
|||
export NI_KERNEL_VERSION=$(KERNEL_VERSION); \
|
|||
export NI_KERNEL_LOCATION=$(BUILD_DIR)/linux-$(KERNEL_VERSION).tar; \
|
|||
export NI_LIBC_UCLIBC_CONFIG_FILE=$(PACKAGE_DIR)/crosstool-ng/files/ct-ng-uClibc-$(UCLIBC_VERSION).config; \
|
|||
export LD_LIBRARY_PATH=; \
|
|||
test -f ./configure || ./bootstrap; \
|
|||
./configure --enable-local; \
|
|||
MAKELEVEL=0 make; \
|
|||
chmod 0755 ct-ng; \
|
|||
./ct-ng oldconfig; \
|
|||
./ct-ng build |
|||
ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd1 hd2)) |
|||
test -e $(CROSS_DIR)/$(TARGET)/lib && mv $(CROSS_DIR)/$(TARGET)/lib $(CROSS_DIR)/$(TARGET)/lib.x |
|||
endif |
|||
test -e $(CROSS_DIR)/$(TARGET)/lib || ln -sf sys-root/lib $(CROSS_DIR)/$(TARGET)/ |
|||
rm -f $(CROSS_DIR)/$(TARGET)/sys-root/lib/libstdc++.so.6.0.*-gdb.py |
|||
$(REMOVE)/$(CROSSTOOL_NG_DIR) |
|||
|
|||
# -----------------------------------------------------------------------------
|
|||
|
|||
get-gccversion: |
|||
@echo "" |
|||
@$(TARGET_CC) --version |
|||
|
|||
# -----------------------------------------------------------------------------
|
|||
|
|||
PHONY += crosstool |
|||
PHONY += crosstools |
|||
PHONY += crosstools-renew |
|||
|
|||
PHONY += get-gccversion |
@ -0,0 +1,81 @@ |
|||
################################################################################
|
|||
#
|
|||
# crosstool-ng
|
|||
#
|
|||
################################################################################
|
|||
|
|||
CROSSTOOL_NG_VERSION = git |
|||
CROSSTOOL_NG_DIR = crosstool-ng.$(CROSSTOOL_NG_VERSION) |
|||
CROSSTOOL_NG_SOURCE = crosstool-ng.$(CROSSTOOL_NG_VERSION) |
|||
CROSSTOOL_NG_SITE = https://github.com/neutrino-images |
|||
|
|||
CROSSTOOL_NG_DEPS = kernel-tarball |
|||
|
|||
CROSSTOOL_NG_CONFIG = $(PACKAGE_DIR)/crosstool-ng/files/ct-ng-$(BOXTYPE).config |
|||
ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd1 hd2)) |
|||
CROSSTOOL_NG_CONFIG = $(PACKAGE_DIR)/crosstool-ng/files/ct-ng-$(BOXTYPE)-$(BOXSERIES).config |
|||
endif |
|||
|
|||
# crosstool-ng for hd2 depends on gcc-linaro and uses uclibc
|
|||
ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd2)) |
|||
|
|||
CROSSTOOL_NG_PATCH = 0001-bash-version.patch |
|||
|
|||
GCC_LINARO_VERSION = 4.9-2017.01 |
|||
GCC_LINARO_SOURCE = gcc-linaro-$(GCC_LINARO_VERSION).tar.xz |
|||
GCC_LINARO_SITE = https://releases.linaro.org/components/toolchain/gcc-linaro/$(GCC_LINARO_VERSION) |
|||
|
|||
$(DL_DIR)/$(GCC_LINARO_SOURCE): |
|||
$(DOWNLOAD) $(GCC_LINARO_SITE)/$(GCC_LINARO_SOURCE) |
|||
|
|||
CROSSTOOL_NG_DEPS += $(DL_DIR)/$(GCC_LINARO_SOURCE) |
|||
|
|||
UCLIBC_VERSION = 1.0.24 |
|||
|
|||
CROSSTOOL_NG_DEPS += kernel-headers |
|||
|
|||
endif |
|||
|
|||
ifeq ($(wildcard $(CROSS_DIR)/build.log.bz2),) |
|||
|
|||
crosstool-ng: $(CROSSTOOL_NG_DEPS) | $(BUILD_DIR) |
|||
$(REMOVE)/$($(PKG)_DIR) |
|||
$(GET-GIT-SOURCE) $($(PKG)_SITE)/$($(PKG)_SOURCE) $(DL_DIR)/$($(PKG)_SOURCE) |
|||
$(CPDIR)/$($(PKG)_SOURCE) |
|||
ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd1 hd2)) |
|||
$(CHDIR)/$($(PKG)_DIR); \
|
|||
git checkout 1dbb06f2; \
|
|||
$(APPLY_PATCHES) |
|||
ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd2)) |
|||
$(INSTALL_COPY) $(PKG_PATCHES_DIR)/gcc/* $(PKG_BUILD_DIR)/patches/gcc/linaro-6.3-2017.02 |
|||
endif |
|||
endif |
|||
$(CHDIR)/$($(PKG)_DIR); \
|
|||
unset CONFIG_SITE LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE; \
|
|||
$(INSTALL_DATA) $(CROSSTOOL_NG_CONFIG) .config; \
|
|||
$(SED) "s|^CT_PARALLEL_JOBS=.*|CT_PARALLEL_JOBS=$(PARALLEL_JOBS)|" .config; \
|
|||
export BS_LOCAL_TARBALLS_DIR=$(DL_DIR); \
|
|||
export BS_PREFIX_DIR=$(CROSS_DIR); \
|
|||
export BS_KERNEL_VERSION=$(KERNEL_VERSION); \
|
|||
export BS_KERNEL_LOCATION=$(KERNEL_TARBALL); \
|
|||
export BS_KERNEL_HEADERS=$(KERNEL_HEADERS_DIR); \
|
|||
export BS_LIBC_UCLIBC_CONFIG_FILE=$(PACKAGE_DIR)/crosstool-ng/files/ct-ng-uClibc-$(UCLIBC_VERSION).config; \
|
|||
export LD_LIBRARY_PATH=; \
|
|||
test -f ./configure || ./bootstrap; \
|
|||
./configure --enable-local; \
|
|||
MAKELEVEL=0 make; \
|
|||
chmod 0755 ct-ng; \
|
|||
./ct-ng oldconfig; \
|
|||
./ct-ng build |
|||
ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd1 hd2)) |
|||
test -e $(CROSS_DIR)/$(TARGET)/lib && mv $(CROSS_DIR)/$(TARGET)/lib $(CROSS_DIR)/$(TARGET)/lib.x |
|||
endif |
|||
test -e $(CROSS_DIR)/$(TARGET)/lib || ln -sf sys-root/lib $(CROSS_DIR)/$(TARGET)/ |
|||
rm -f $(CROSS_DIR)/$(TARGET)/sys-root/lib/libstdc++.so.6.0.*-gdb.py |
|||
$(REMOVE)/$($(PKG)_DIR) |
|||
|
|||
else |
|||
|
|||
crosstool-ng: |
|||
|
|||
endif |
@ -0,0 +1,47 @@ |
|||
################################################################################
|
|||
#
|
|||
# crosstools
|
|||
#
|
|||
################################################################################
|
|||
|
|||
CROSSTOOL_BOXSERIES = \
|
|||
hd1 hd2 \
|
|||
hd5x hd6x \
|
|||
vusolo4k vuduo4k vuduo4kse vuultimo4k vuzero4k vuuno4k vuuno4kse \
|
|||
vuduo |
|||
|
|||
crosstool: build-clean deps-clean crosstool-ng crosstool-backup |
|||
|
|||
crosstools: |
|||
$(foreach boxseries,$(CROSSTOOL_BOXSERIES),\
|
|||
make BOXSERIES=$(boxseries) crosstool$(sep)) |
|||
|
|||
crosstools-renew: |
|||
$(foreach boxseries,$(CROSSTOOL_BOXSERIES),\
|
|||
make BOXSERIES=$(boxseries) ccache-clean$(sep)) |
|||
make host-clean |
|||
make static-base-clean |
|||
make cross-base-clean |
|||
make crosstools |
|||
make clean |
|||
|
|||
################################################################################
|
|||
#
|
|||
# crosstool-backup
|
|||
#
|
|||
################################################################################
|
|||
|
|||
CROSSTOOL_BACKUP = $(DL_DIR)/crosstool-ng-$(TARGET_ARCH)-$(TARGET_OS)-$(KERNEL_VERSION)-backup.tar.gz |
|||
|
|||
$(CROSSTOOL_BACKUP): |
|||
$(call draw_line); |
|||
@echo "CROSSTOOL_BACKUP does not exist. You probably need to run 'make crosstool-backup' first." |
|||
$(call draw_line); |
|||
@false |
|||
|
|||
crosstool-backup: |
|||
tar czvf $(CROSSTOOL_BACKUP) -C $(CROSS_DIR) . |
|||
|
|||
crosstool-restore: $(CROSSTOOL_BACKUP) cross-clean |
|||
$(INSTALL) -d $(CROSS_DIR) |
|||
tar xzvf $(CROSSTOOL_BACKUP) -C $(CROSS_DIR) |
Loading…
Reference in new issue