diff --git a/Makefile b/Makefile index 9a55b5c0..8f316da2 100755 --- a/Makefile +++ b/Makefile @@ -82,6 +82,7 @@ include make/archives.mk include make/prerequisites.mk include make/crosstool.mk include make/bootstrap.mk +include make/host-tools.mk include make/clean.mk include make/update.mk include make/kernel-$(BOXTYPE_SC).mk diff --git a/make/archives.mk b/make/archives.mk index abfb9660..d843c58f 100644 --- a/make/archives.mk +++ b/make/archives.mk @@ -12,10 +12,6 @@ TZDATA_VER=2018e $(ARCHIVE)/tzdata$(TZDATA_VER).tar.gz: $(WGET) ftp://ftp.iana.org/tz/releases/tzdata$(TZDATA_VER).tar.gz -TZCODE_VER=2018e -$(ARCHIVE)/tzcode$(TZCODE_VER).tar.gz: - $(WGET) ftp://ftp.iana.org/tz/releases/tzcode$(TZCODE_VER).tar.gz - PUGIXML_VER=1.9 $(ARCHIVE)/pugixml-$(PUGIXML_VER).tar.gz: $(WGET) http://github.com/zeux/pugixml/releases/download/v$(PUGIXML_VER)/pugixml-$(PUGIXML_VER).tar.gz @@ -288,10 +284,6 @@ LIBASS_VER=0.14.0 $(ARCHIVE)/libass-$(LIBASS_VER).tar.xz: $(WGET) https://github.com/libass/libass/releases/download/$(LIBASS_VER)/libass-$(LIBASS_VER).tar.xz -PKGCONF_VER=0.29.2 -$(ARCHIVE)/pkg-config-$(PKGCONF_VER).tar.gz: - $(WGET) https://pkg-config.freedesktop.org/releases/pkg-config-$(PKGCONF_VER).tar.gz - LIBBDPLUS_VER=0.1.2 $(ARCHIVE)/libbdplus-$(LIBBDPLUS_VER).tar.bz2: $(WGET) ftp://ftp.videolan.org/pub/videolan/libbdplus/$(LIBBDPLUS_VER)/libbdplus-$(LIBBDPLUS_VER).tar.bz2 @@ -318,10 +310,6 @@ CORTEX-STRINGS_VER=48fd30c346ff2ab14ca574b770b5c1bcbefadba8 $(ARCHIVE)/cortex-strings-$(CORTEX-STRINGS_VER).tar.bz2: get-git-archive.sh http://git.linaro.org/git-ro/toolchain/cortex-strings.git $(CORTEX-STRINGS_VER) $(notdir $@) $(ARCHIVE) -U_BOOT_VER=2018.09 -$(ARCHIVE)/u-boot-$(U_BOOT_VER).tar.bz2: - $(WGET) ftp://ftp.denx.de/pub/u-boot/u-boot-$(U_BOOT_VER).tar.bz2 - DOSFSTOOLS_VER=4.1 $(ARCHIVE)/dosfstools-$(DOSFSTOOLS_VER).tar.xz: $(WGET) https://github.com/dosfstools/dosfstools/releases/download/v$(DOSFSTOOLS_VER)/dosfstools-$(DOSFSTOOLS_VER).tar.xz @@ -373,10 +361,6 @@ WGET_VER=1.19.2 $(ARCHIVE)/wget-$(WGET_VER).tar.gz: $(WGET) http://ftp.gnu.org/gnu/wget/wget-$(WGET_VER).tar.gz -MTOOLS_VER=4.0.19 -$(ARCHIVE)/mtools-$(MTOOLS_VER).tar.gz: - $(WGET) ftp://ftp.gnu.org/gnu/mtools/mtools-$(MTOOLS_VER).tar.gz - ALSA-LIB_VER = 1.1.6 ALSA-LIB_SOURCE = alsa-lib-$(ALSA-LIB_VER).tar.bz2 $(ARCHIVE)/$(ALSA-LIB_SOURCE): diff --git a/make/bootstrap.mk b/make/bootstrap.mk index 02f23d19..4fe5d760 100644 --- a/make/bootstrap.mk +++ b/make/bootstrap.mk @@ -1,14 +1,25 @@ # makefile to setup and initialize the final buildsystem -BOOTSTRAP = targetprefix $(D) $(BUILD_TMP) $(CROSS_DIR) $(STAGING_DIR) $(IMAGE_DIR) $(UPDATE_DIR) $(HOST_DIR)/bin includes-and-libs modules host-preqs +BOOTSTRAP = targetprefix +BOOTSTRAP += $(D) +BOOTSTRAP += $(BUILD_TMP) +BOOTSTRAP += $(CROSS_DIR) +BOOTSTRAP += $(STAGING_DIR) +BOOTSTRAP += $(IMAGE_DIR) +BOOTSTRAP += $(UPDATE_DIR) +BOOTSTRAP += $(HOST_DIR)/bin +BOOTSTRAP += includes-and-libs +BOOTSTRAP += modules +BOOTSTRAP += host-preqs BOOTSTRAP += $(TARGET_LIB_DIR)/libc.so.6 ifeq ($(BOXSERIES), $(filter $(BOXSERIES), hd2 hd51)) - BOOTSTRAP += static-libs blobs + BOOTSTRAP += static-libs + BOOTSTRAP += blobs endif -PLAT_INCS = $(TARGET_LIB_DIR)/firmware -PLAT_LIBS = $(TARGET_LIB_DIR) $(STATIC_LIB_DIR) +PLAT_INCS = $(TARGET_LIB_DIR)/firmware +PLAT_LIBS = $(TARGET_LIB_DIR) $(STATIC_LIB_DIR) bootstrap: $(BOOTSTRAP) @echo -e "$(TERM_YELLOW)Bootstrapped for $(shell echo $(BOXTYPE) | sed 's/.*/\u&/') $(BOXMODEL)$(TERM_NORMAL)" @@ -79,11 +90,11 @@ $(TARGET_DIR)/var/update: | $(TARGET_DIR) mkdir -p $@ ifeq ($(BOXTYPE), coolstream) cp -a $(SOURCE_DIR)/$(NI_DRIVERS-BIN)/$(DRIVERS_DIR)/uldr.bin $@/ -ifeq ($(BOXMODEL), kronos_v2) + ifeq ($(BOXMODEL), kronos_v2) cp -a $(SOURCE_DIR)/$(NI_DRIVERS-BIN)/$(DRIVERS_DIR)/u-boot.bin.link $@/u-boot.bin -else + else cp -a $(SOURCE_DIR)/$(NI_DRIVERS-BIN)/$(DRIVERS_DIR)/u-boot.bin $@/ -endif + endif endif includes-and-libs: $(PLAT_INCS) $(PLAT_LIBS) @@ -92,143 +103,6 @@ modules: $(TARGET_LIB_DIR)/modules blobs: $(TARGET_DIR)/var/update -# helper target to create ccache links (make sure to have ccache installed in /usr/bin ;) -ccache: find-ccache $(CCACHE) $(HOST_DIR)/bin - @ln -sf $(CCACHE) $(HOST_DIR)/bin/cc - @ln -sf $(CCACHE) $(HOST_DIR)/bin/gcc - @ln -sf $(CCACHE) $(HOST_DIR)/bin/g++ - @ln -sf $(CCACHE) $(HOST_DIR)/bin/$(TARGET)-gcc - @ln -sf $(CCACHE) $(HOST_DIR)/bin/$(TARGET)-g++ - -# build all needed host-binaries -host-preqs: pkg-config mkfs.jffs2 mkfs.fat sumtool mkimage zic parted_host mtools resize2fs ccache - -pkg-config-preqs: - @PATH=$(subst $(HOST_DIR)/bin:,,$(PATH)); \ - if ! pkg-config --exists glib-2.0; then \ - echo "pkg-config and glib2-devel packages are needed for building cross-pkg-config."; false; \ - fi - -pkg-config: $(HOST_DIR)/bin/pkg-config -$(HOST_DIR)/bin/pkg-config: $(ARCHIVE)/pkg-config-$(PKGCONF_VER).tar.gz | $(HOST_DIR)/bin pkg-config-preqs - $(REMOVE)/pkg-config-$(PKGCONF_VER) - $(UNTAR)/pkg-config-$(PKGCONF_VER).tar.gz - $(CHDIR)/pkg-config-$(PKGCONF_VER); \ - ./configure \ - --with-pc_path=$(PKG_CONFIG_PATH); \ - $(MAKE); \ - cp -a pkg-config $(HOST_DIR)/bin; \ - ln -sf pkg-config $(HOST_DIR)/bin/arm-cx2450x-linux-gnueabi-pkg-config - ln -sf pkg-config $(HOST_DIR)/bin/arm-cortex-linux-uclibcgnueabi-pkg-config - ln -sf pkg-config $(HOST_DIR)/bin/arm-cortex-linux-gnueabihf-pkg-config - $(REMOVE)/pkg-config-$(PKGCONF_VER) - -mkfs.jffs2: $(HOST_DIR)/bin/mkfs.jffs2 -sumtool: $(HOST_DIR)/bin/sumtool -$(HOST_DIR)/bin/mkfs.jffs2 \ -$(HOST_DIR)/bin/sumtool: $(ARCHIVE)/mtd-utils-$(MTD-UTILS_VER).tar.bz2 | $(HOST_DIR)/bin - $(REMOVE)/mtd-utils-$(MTD-UTILS_VER) - $(UNTAR)/mtd-utils-$(MTD-UTILS_VER).tar.bz2 - $(CHDIR)/mtd-utils-$(MTD-UTILS_VER) && \ - ./configure \ - ZLIB_CFLAGS=" " \ - ZLIB_LIBS="-lz" \ - UUID_CFLAGS=" " \ - UUID_LIBS="-luuid" \ - --enable-silent-rules \ - --without-ubifs \ - --without-xattr \ - --disable-tests && \ - $(MAKE) - install -D -m 0755 $(BUILD_TMP)/mtd-utils-$(MTD-UTILS_VER)/sumtool $(HOST_DIR)/bin/ - install -D -m 0755 $(BUILD_TMP)/mtd-utils-$(MTD-UTILS_VER)/mkfs.jffs2 $(HOST_DIR)/bin/ - $(REMOVE)/mtd-utils-$(MTD-UTILS_VER) - -mkimage: $(HOST_DIR)/bin/mkimage -$(HOST_DIR)/bin/mkimage: $(ARCHIVE)/u-boot-$(U_BOOT_VER).tar.bz2 | $(HOST_DIR)/bin - $(REMOVE)/u-boot-$(U_BOOT_VER) - $(UNTAR)/u-boot-$(U_BOOT_VER).tar.bz2 - $(CHDIR)/u-boot-$(U_BOOT_VER) && \ - $(MAKE) defconfig && \ - $(MAKE) silentoldconfig && \ - $(MAKE) tools-only - install -D -m 0755 $(BUILD_TMP)/u-boot-$(U_BOOT_VER)/tools/mkimage $(HOST_DIR)/bin/ - $(REMOVE)/u-boot-$(U_BOOT_VER) - -zic: $(HOST_DIR)/bin/zic -$(HOST_DIR)/bin/zic: $(ARCHIVE)/tzdata$(TZDATA_VER).tar.gz $(ARCHIVE)/tzcode$(TZCODE_VER).tar.gz | $(HOST_DIR)/bin - $(REMOVE)/tzcode - mkdir $(BUILD_TMP)/tzcode && \ - tar -C $(BUILD_TMP)/tzcode -xf $(ARCHIVE)/tzcode$(TZCODE_VER).tar.gz - tar -C $(BUILD_TMP)/tzcode -xf $(ARCHIVE)/tzdata$(TZDATA_VER).tar.gz - $(CHDIR)/tzcode && \ - $(MAKE) zic - install -D -m 0755 $(BUILD_TMP)/tzcode/zic $(HOST_DIR)/bin/ - $(REMOVE)/tzcode - -parted_host: $(HOST_DIR)/bin/parted -$(HOST_DIR)/bin/parted: $(ARCHIVE)/parted-$(PARTED_VER).tar.xz | $(HOST_DIR)/bin - $(REMOVE)/parted-$(PARTED_VER) - $(UNTAR)/parted-$(PARTED_VER).tar.xz - $(CHDIR)/parted-$(PARTED_VER) && \ - $(PATCH)/parted-3.2-devmapper-1.patch && \ - $(PATCH)/parted-3.2-sysmacros.patch && \ - ./configure \ - --enable-silent-rules \ - --enable-static \ - --disable-shared \ - --disable-device-mapper \ - --without-readline && \ - $(MAKE) - install -D -m 0755 $(BUILD_TMP)/parted-$(PARTED_VER)/parted/parted $(HOST_DIR)/bin/ - $(REMOVE)/parted-$(PARTED_VER) - -mkfs.fat: $(HOST_DIR)/bin/mkfs.fat -$(HOST_DIR)/bin/mkfs.fat: $(ARCHIVE)/dosfstools-$(DOSFSTOOLS_VER).tar.xz | $(HOST_DIR)/bin - $(REMOVE)/dosfstools-$(DOSFSTOOLS_VER) - $(UNTAR)/dosfstools-$(DOSFSTOOLS_VER).tar.xz - $(CHDIR)/dosfstools-$(DOSFSTOOLS_VER); \ - ./configure \ - --without-udev \ - ; \ - $(MAKE) - install -D -m 0755 $(BUILD_TMP)/dosfstools-$(DOSFSTOOLS_VER)/src/mkfs.fat $(HOST_DIR)/bin/ - ln -sf mkfs.fat $(HOST_DIR)/bin/mkfs.vfat - ln -sf mkfs.fat $(HOST_DIR)/bin/mkfs.msdos - ln -sf mkfs.fat $(HOST_DIR)/bin/mkdosfs - $(REMOVE)/dosfstools-$(DOSFSTOOLS_VER) - -mtools: $(HOST_DIR)/bin/mtools -$(HOST_DIR)/bin/mtools: $(ARCHIVE)/mtools-$(MTOOLS_VER).tar.gz | $(HOST_DIR)/bin - $(REMOVE)/mtools-$(MTOOLS_VER) - $(UNTAR)/mtools-$(MTOOLS_VER).tar.gz - $(CHDIR)/mtools-$(MTOOLS_VER); \ - ./configure; \ - $(MAKE) - install -D -m 0755 $(BUILD_TMP)/mtools-$(MTOOLS_VER)/mtools $(HOST_DIR)/bin/ - ln -sf mtools $(HOST_DIR)/bin/mcopy - $(REMOVE)/mtools-$(MTOOLS_VER) - -resize2fs: $(HOST_DIR)/bin/resize2fs -$(HOST_DIR)/bin/resize2fs: $(ARCHIVE)/e2fsprogs-$(E2FSPROGS_VER).tar.gz | $(HOST_DIR)/bin - $(REMOVE)/e2fsprogs-$(E2FSPROGS_VER) - $(UNTAR)/e2fsprogs-$(E2FSPROGS_VER).tar.gz - $(CHDIR)/e2fsprogs-$(E2FSPROGS_VER) && \ - ./configure; \ - $(MAKE) - install -D -m 0755 $(BUILD_TMP)/e2fsprogs-$(E2FSPROGS_VER)/resize/resize2fs $(HOST_DIR)/bin/ - install -D -m 0755 $(BUILD_TMP)/e2fsprogs-$(E2FSPROGS_VER)/misc/mke2fs $(HOST_DIR)/bin/ - ln -sf mke2fs $(HOST_DIR)/bin/mkfs.ext2 - ln -sf mke2fs $(HOST_DIR)/bin/mkfs.ext3 - ln -sf mke2fs $(HOST_DIR)/bin/mkfs.ext4 - ln -sf mke2fs $(HOST_DIR)/bin/mkfs.ext4dev - install -D -m 0755 $(BUILD_TMP)/e2fsprogs-$(E2FSPROGS_VER)/e2fsck/e2fsck $(HOST_DIR)/bin/ - ln -sf e2fsck $(HOST_DIR)/bin/fsck.ext2 - ln -sf e2fsck $(HOST_DIR)/bin/fsck.ext3 - ln -sf e2fsck $(HOST_DIR)/bin/fsck.ext4 - ln -sf e2fsck $(HOST_DIR)/bin/fsck.ext4dev - $(REMOVE)/e2fsprogs-$(E2FSPROGS_VER) - # ----------------------------------------------------------------------------- # hack to make sure they are always copied @@ -245,6 +119,3 @@ PHONY += targetprefix PHONY += includes-and-libs PHONY += modules PHONY += blobs -PHONY += ccache -PHONY += host-preqs -PHONY += pkg-config-preqs diff --git a/make/host-tools.mk b/make/host-tools.mk new file mode 100644 index 00000000..0db918ca --- /dev/null +++ b/make/host-tools.mk @@ -0,0 +1,221 @@ +# makefile to build all needed host-binaries + +host-preqs: \ + host_pkg-config \ + host_mkfs.jffs2 \ + host_sumtool \ + host_mkimage \ + host_zic \ + host_parted \ + host_mkfs.fat \ + host_mtools \ + host_resize2fs \ + ccache + +# ----------------------------------------------------------------------------- + +HOST_PKG-CONFIG_VER = 0.29.2 + +$(ARCHIVE)/pkg-config-$(HOST_PKG-CONFIG_VER).tar.gz: + $(WGET) https://pkg-config.freedesktop.org/releases/pkg-config-$(HOST_PKG-CONFIG_VER).tar.gz + +pkg-config-preqs: + @PATH=$(subst $(HOST_DIR)/bin:,,$(PATH)); \ + if ! pkg-config --exists glib-2.0; then \ + echo "pkg-config and glib2-devel packages are needed for building cross-pkg-config."; false; \ + fi + +host_pkg-config: $(HOST_DIR)/bin/pkg-config +$(HOST_DIR)/bin/pkg-config: $(ARCHIVE)/pkg-config-$(HOST_PKG-CONFIG_VER).tar.gz | $(HOST_DIR)/bin pkg-config-preqs + $(REMOVE)/pkg-config-$(HOST_PKG-CONFIG_VER) + $(UNTAR)/pkg-config-$(HOST_PKG-CONFIG_VER).tar.gz + $(CHDIR)/pkg-config-$(HOST_PKG-CONFIG_VER); \ + ./configure \ + --with-pc_path=$(PKG_CONFIG_PATH) \ + ; \ + $(MAKE); \ + cp -a pkg-config $(HOST_DIR)/bin; \ + ln -sf pkg-config $(HOST_DIR)/bin/arm-cx2450x-linux-gnueabi-pkg-config + ln -sf pkg-config $(HOST_DIR)/bin/arm-cortex-linux-uclibcgnueabi-pkg-config + ln -sf pkg-config $(HOST_DIR)/bin/arm-cortex-linux-gnueabihf-pkg-config + $(REMOVE)/pkg-config-$(HOST_PKG-CONFIG_VER) + +# ----------------------------------------------------------------------------- + +HOST_MTD-UTILS_VER = $(MTD-UTILS_VER) + +#$(ARCHIVE)/mtd-utils-$(HOST_MTD-UTILS_VER).tar.bz2: +# $(WGET) ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-$(HOST_MTD-UTILS_VER).tar.bz2 + +host_mkfs.jffs2: $(HOST_DIR)/bin/mkfs.jffs2 +host_sumtool: $(HOST_DIR)/bin/sumtool +$(HOST_DIR)/bin/mkfs.jffs2 \ +$(HOST_DIR)/bin/sumtool: $(ARCHIVE)/mtd-utils-$(HOST_MTD-UTILS_VER).tar.bz2 | $(HOST_DIR)/bin + $(REMOVE)/mtd-utils-$(HOST_MTD-UTILS_VER) + $(UNTAR)/mtd-utils-$(HOST_MTD-UTILS_VER).tar.bz2 + $(CHDIR)/mtd-utils-$(HOST_MTD-UTILS_VER); \ + ./configure \ + ZLIB_CFLAGS=" " \ + ZLIB_LIBS="-lz" \ + UUID_CFLAGS=" " \ + UUID_LIBS="-luuid" \ + --enable-silent-rules \ + --without-ubifs \ + --without-xattr \ + --disable-tests \ + ; \ + $(MAKE) + install -D -m 0755 $(BUILD_TMP)/mtd-utils-$(HOST_MTD-UTILS_VER)/mkfs.jffs2 $(HOST_DIR)/bin/ + install -D -m 0755 $(BUILD_TMP)/mtd-utils-$(HOST_MTD-UTILS_VER)/sumtool $(HOST_DIR)/bin/ + $(REMOVE)/mtd-utils-$(HOST_MTD-UTILS_VER) + +# ----------------------------------------------------------------------------- + +HOST_U-BOOT_VER = 2018.09 + +$(ARCHIVE)/u-boot-$(HOST_U-BOOT_VER).tar.bz2: + $(WGET) ftp://ftp.denx.de/pub/u-boot/u-boot-$(HOST_U-BOOT_VER).tar.bz2 + +host_mkimage: $(HOST_DIR)/bin/mkimage +$(HOST_DIR)/bin/mkimage: $(ARCHIVE)/u-boot-$(HOST_U-BOOT_VER).tar.bz2 | $(HOST_DIR)/bin + $(REMOVE)/u-boot-$(HOST_U-BOOT_VER) + $(UNTAR)/u-boot-$(HOST_U-BOOT_VER).tar.bz2 + $(CHDIR)/u-boot-$(HOST_U-BOOT_VER); \ + $(MAKE) defconfig; \ + $(MAKE) silentoldconfig; \ + $(MAKE) tools-only + install -D -m 0755 $(BUILD_TMP)/u-boot-$(HOST_U-BOOT_VER)/tools/mkimage $(HOST_DIR)/bin/ + $(REMOVE)/u-boot-$(HOST_U-BOOT_VER) + +# ----------------------------------------------------------------------------- + +HOST_TZDATA_VER = $(TZDATA_VER) + +#$(ARCHIVE)/tzdata$(HOST_TZDATA_VER).tar.gz: +# $(WGET) ftp://ftp.iana.org/tz/releases/tzdata$(HOST_TZDATA_VER).tar.gz + +HOST_TZCODE_VER = 2018e + +$(ARCHIVE)/tzcode$(HOST_TZCODE_VER).tar.gz: + $(WGET) ftp://ftp.iana.org/tz/releases/tzcode$(HOST_TZCODE_VER).tar.gz + +host_zic: $(HOST_DIR)/bin/zic +$(HOST_DIR)/bin/zic: $(ARCHIVE)/tzdata$(HOST_TZDATA_VER).tar.gz $(ARCHIVE)/tzcode$(HOST_TZCODE_VER).tar.gz | $(HOST_DIR)/bin + $(REMOVE)/tzcode + mkdir $(BUILD_TMP)/tzcode + $(CHDIR)/tzcode; \ + tar -xf $(ARCHIVE)/tzcode$(HOST_TZCODE_VER).tar.gz; \ + tar -xf $(ARCHIVE)/tzdata$(HOST_TZDATA_VER).tar.gz; \ + $(MAKE) zic + install -D -m 0755 $(BUILD_TMP)/tzcode/zic $(HOST_DIR)/bin/ + #$(REMOVE)/tzcode + +# ----------------------------------------------------------------------------- + +HOST_PARTED_VER = $(PARTED_VER) + +#$(ARCHIVE)/parted-$(HOST_PARTED_VER).tar.xz: +# $(WGET) http://ftp.gnu.org/gnu/parted/parted-$(HOST_PARTED_VER).tar.xz + +HOST_PARTED_PATCH = parted-3.2-devmapper-1.patch +HOST_PARTED_PATCH += parted-3.2-sysmacros.patch + +host_parted: $(HOST_DIR)/bin/parted +$(HOST_DIR)/bin/parted: $(ARCHIVE)/parted-$(HOST_PARTED_VER).tar.xz | $(HOST_DIR)/bin + $(REMOVE)/parted-$(HOST_PARTED_VER) + $(UNTAR)/parted-$(HOST_PARTED_VER).tar.xz + $(CHDIR)/parted-$(HOST_PARTED_VER); \ + $(call apply_patches, $(HOST_PARTED_PATCH)); \ + ./configure \ + --enable-silent-rules \ + --enable-static \ + --disable-shared \ + --disable-device-mapper \ + --without-readline \ + ; \ + $(MAKE) + install -D -m 0755 $(BUILD_TMP)/parted-$(HOST_PARTED_VER)/parted/parted $(HOST_DIR)/bin/ + $(REMOVE)/parted-$(HOST_PARTED_VER) + +# ----------------------------------------------------------------------------- + +HOST_DOSFSTOOLS_VER = $(DOSFSTOOLS_VER) + +#$(ARCHIVE)/dosfstools-$(HOST_DOSFSTOOLS_VER).tar.xz: +# $(WGET) https://github.com/dosfstools/dosfstools/releases/download/v$(HOST_DOSFSTOOLS_VER)/dosfstools-$(HOST_DOSFSTOOLS_VER).tar.xz + +host_mkfs.fat: $(HOST_DIR)/bin/mkfs.fat +$(HOST_DIR)/bin/mkfs.fat: $(ARCHIVE)/dosfstools-$(HOST_DOSFSTOOLS_VER).tar.xz | $(HOST_DIR)/bin + $(REMOVE)/dosfstools-$(HOST_DOSFSTOOLS_VER) + $(UNTAR)/dosfstools-$(HOST_DOSFSTOOLS_VER).tar.xz + $(CHDIR)/dosfstools-$(HOST_DOSFSTOOLS_VER); \ + ./configure \ + --without-udev \ + ; \ + $(MAKE) + install -D -m 0755 $(BUILD_TMP)/dosfstools-$(HOST_DOSFSTOOLS_VER)/src/mkfs.fat $(HOST_DIR)/bin/ + ln -sf mkfs.fat $(HOST_DIR)/bin/mkfs.vfat + ln -sf mkfs.fat $(HOST_DIR)/bin/mkfs.msdos + ln -sf mkfs.fat $(HOST_DIR)/bin/mkdosfs + $(REMOVE)/dosfstools-$(HOST_DOSFSTOOLS_VER) + +# ----------------------------------------------------------------------------- + +HOST_MTOOLS_VER = 4.0.19 + +$(ARCHIVE)/mtools-$(HOST_MTOOLS_VER).tar.gz: + $(WGET) ftp://ftp.gnu.org/gnu/mtools/mtools-$(HOST_MTOOLS_VER).tar.gz + +host_mtools: $(HOST_DIR)/bin/mtools +$(HOST_DIR)/bin/mtools: $(ARCHIVE)/mtools-$(HOST_MTOOLS_VER).tar.gz | $(HOST_DIR)/bin + $(REMOVE)/mtools-$(HOST_MTOOLS_VER) + $(UNTAR)/mtools-$(HOST_MTOOLS_VER).tar.gz + $(CHDIR)/mtools-$(HOST_MTOOLS_VER); \ + ./configure; \ + $(MAKE) + install -D -m 0755 $(BUILD_TMP)/mtools-$(HOST_MTOOLS_VER)/mtools $(HOST_DIR)/bin/ + ln -sf mtools $(HOST_DIR)/bin/mcopy + $(REMOVE)/mtools-$(HOST_MTOOLS_VER) + +# ----------------------------------------------------------------------------- + +HOST_E2FSPROGS_VER = $(E2FSPROGS_VER) + +#$(ARCHIVE)/e2fsprogs-$(HOST_E2FSPROGS_VER).tar.gz: +# $(WGET) http://downloads.sourceforge.net/project/e2fsprogs/e2fsprogs/v$(HOST_E2FSPROGS_VER)/e2fsprogs-$(HOST_E2FSPROGS_VER).tar.gz + +host_resize2fs: $(HOST_DIR)/bin/resize2fs +$(HOST_DIR)/bin/resize2fs: $(ARCHIVE)/e2fsprogs-$(HOST_E2FSPROGS_VER).tar.gz | $(HOST_DIR)/bin + $(REMOVE)/e2fsprogs-$(HOST_E2FSPROGS_VER) + $(UNTAR)/e2fsprogs-$(HOST_E2FSPROGS_VER).tar.gz + $(CHDIR)/e2fsprogs-$(HOST_E2FSPROGS_VER) && \ + ./configure; \ + $(MAKE) + install -D -m 0755 $(BUILD_TMP)/e2fsprogs-$(HOST_E2FSPROGS_VER)/resize/resize2fs $(HOST_DIR)/bin/ + install -D -m 0755 $(BUILD_TMP)/e2fsprogs-$(HOST_E2FSPROGS_VER)/misc/mke2fs $(HOST_DIR)/bin/ + ln -sf mke2fs $(HOST_DIR)/bin/mkfs.ext2 + ln -sf mke2fs $(HOST_DIR)/bin/mkfs.ext3 + ln -sf mke2fs $(HOST_DIR)/bin/mkfs.ext4 + ln -sf mke2fs $(HOST_DIR)/bin/mkfs.ext4dev + install -D -m 0755 $(BUILD_TMP)/e2fsprogs-$(HOST_E2FSPROGS_VER)/e2fsck/e2fsck $(HOST_DIR)/bin/ + ln -sf e2fsck $(HOST_DIR)/bin/fsck.ext2 + ln -sf e2fsck $(HOST_DIR)/bin/fsck.ext3 + ln -sf e2fsck $(HOST_DIR)/bin/fsck.ext4 + ln -sf e2fsck $(HOST_DIR)/bin/fsck.ext4dev + $(REMOVE)/e2fsprogs-$(HOST_E2FSPROGS_VER) + +# ----------------------------------------------------------------------------- + +# helper target to create ccache links (make sure to have ccache installed in /usr/bin ;) +ccache: find-ccache $(CCACHE) $(HOST_DIR)/bin + @ln -sf $(CCACHE) $(HOST_DIR)/bin/cc + @ln -sf $(CCACHE) $(HOST_DIR)/bin/gcc + @ln -sf $(CCACHE) $(HOST_DIR)/bin/g++ + @ln -sf $(CCACHE) $(HOST_DIR)/bin/$(TARGET)-gcc + @ln -sf $(CCACHE) $(HOST_DIR)/bin/$(TARGET)-g++ + +# ----------------------------------------------------------------------------- + +PHONY += host-preqs +PHONY += ccache +PHONY += pkg-config-preqs