build: get rid of host.mk
authorFelix Fietkau <nbd@nbd.name>
Mon, 20 Feb 2017 13:24:54 +0000 (14:24 +0100)
committerFelix Fietkau <nbd@nbd.name>
Sun, 26 Feb 2017 12:31:44 +0000 (13:31 +0100)
Defined required host related variables in toplevel.mk instead

Signed-off-by: Felix Fietkau <nbd@nbd.name>
20 files changed:
Makefile
include/host-build.mk
include/host.mk [deleted file]
include/image.mk
include/kernel-build.mk
include/package.mk
include/prereq-build.mk
include/scan.mk
include/toplevel.mk
target/imagebuilder/Makefile
target/imagebuilder/files/Makefile
target/linux/apm821xx/image/Makefile
target/linux/brcm2708/Makefile
target/linux/brcm2708/image/Makefile
target/linux/sunxi/image/Makefile
target/linux/uml/Makefile
target/linux/zynq/Makefile
target/sdk/Makefile
target/sdk/files/Makefile
target/toolchain/Makefile

index a26eeee0a8b8727581ceae2be2a603702a0c2468..670e6a25dec13755e9b3351d613734cc5d79bcf2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the LEDE direct
 
 world:
 
-include $(TOPDIR)/include/host.mk
+export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
 
 ifneq ($(OPENWRT_BUILD),1)
   _SINGLE=export MAKEFLAGS=$(space);
index ffb68468f9972a379cee39503d27433ddf2dc02a..c8477e1ddf7bd8b51a9a813bdcc1b5c85274c9d9 100644 (file)
@@ -19,7 +19,6 @@ else
 HOST_JOBS?=$(if $(HOST_BUILD_PARALLEL),$(HOST_MAKE_J),-j1)
 endif
 
-include $(INCLUDE_DIR)/host.mk
 include $(INCLUDE_DIR)/unpack.mk
 include $(INCLUDE_DIR)/depends.mk
 
diff --git a/include/host.mk b/include/host.mk
deleted file mode 100644 (file)
index 2ccab8e..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (C) 2007-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-TMP_DIR ?= $(TOPDIR)/tmp
-ifeq ($(if $(TARGET_BUILD),,$(DUMP)),)
-  -include $(TMP_DIR)/.host.mk
-endif
-
-ifneq ($(__host_inc),1)
-__host_inc:=1
-
-export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
-
-try-run = $(shell set -e; \
-       TMP_F="$(TMP_DIR)/try-run.$$$$.tmp"; \
-       if ($(1)) >/dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi; \
-       rm -f "$$TMP_F"; \
-)
-
-host-cc-option = $(call try-run, \
-       $(HOSTCC) $(HOST_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP_F",$(1),$(2) \
-)
-
-.PRECIOUS: $(TMP_DIR)/.host.mk
-$(TMP_DIR)/.host.mk: $(TOPDIR)/include/host.mk
-       @mkdir -p $(TMP_DIR)
-       @( \
-               HOST_OS=`uname`; \
-               case "$$HOST_OS" in \
-                       Linux) HOST_ARCH=`uname -m`;; \
-                       Darwin) HOST_ARCH=`uname -m`;; \
-                       *) HOST_ARCH=`uname -p`;; \
-               esac; \
-               GNU_HOST_NAME=`gcc -dumpmachine`; \
-               [ -z "$$GNU_HOST_NAME" -o "$$HOST_OS" = "Darwin" ] && \
-                       GNU_HOST_NAME=`$(TOPDIR)/scripts/config.guess`; \
-               echo "HOST_OS:=$$HOST_OS" > $@; \
-               echo "HOST_ARCH:=$$HOST_ARCH" >> $@; \
-               echo "GNU_HOST_NAME:=$$GNU_HOST_NAME" >> $@; \
-       ) >/dev/null 2>/dev/null
-
-endif
index 81519cd1834907c83f19e123aa0282768c91dd84..9bc30c663d90c297d0074d489fcb8b58faab9c18 100644 (file)
@@ -8,7 +8,6 @@
 override TARGET_BUILD=
 include $(INCLUDE_DIR)/prereq.mk
 include $(INCLUDE_DIR)/kernel.mk
-include $(INCLUDE_DIR)/host.mk
 include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/image-commands.mk
 
index 56c0fe386b0732c0fd1c628809a43eb95f0ccec2..7d1e23c6eaa10972de071f28cbbb40047c49de15 100644 (file)
@@ -4,7 +4,6 @@
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
-include $(INCLUDE_DIR)/host.mk
 include $(INCLUDE_DIR)/prereq.mk
 include $(INCLUDE_DIR)/depends.mk
 
index ce1aa256bdf0eaf78c298fcba0f207e6ca9047fc..a3ef3029d80b79af6d8a8481f3b4374effcf0d27 100644 (file)
@@ -37,7 +37,6 @@ endif
 
 include $(INCLUDE_DIR)/hardening.mk
 include $(INCLUDE_DIR)/prereq.mk
-include $(INCLUDE_DIR)/host.mk
 include $(INCLUDE_DIR)/unpack.mk
 include $(INCLUDE_DIR)/depends.mk
 
index af4e8b5e14640af95a136c1abcf36c653f7c2214..2d3a1faf2dbcaf61cb4c32cf7a06bdca69f389da 100644 (file)
@@ -7,7 +7,6 @@
 
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/prereq.mk
-include $(INCLUDE_DIR)/host.mk
 include $(INCLUDE_DIR)/host-build.mk
 
 SHELL:=sh
@@ -123,9 +122,9 @@ $(eval $(call SetupHostCommand,getopt, \
        getopt -o t --long test -- --test | grep '^ *--test *--'))
 
 $(eval $(call SetupHostCommand,stat,Cannot find a file stat utility, \
-       gnustat -c%s $(TMP_DIR)/.host.mk, \
-       gstat -c%s $(TMP_DIR)/.host.mk, \
-       stat -c%s $(TMP_DIR)/.host.mk))
+       gnustat -c%s $(TOPDIR)/Makefile, \
+       gstat -c%s $(TOPDIR)/Makefile, \
+       stat -c%s $(TOPDIR)/Makefile))
 
 $(eval $(call SetupHostCommand,unzip,Please install 'unzip', \
        unzip 2>&1 | grep zipfile, \
index 92f2dc3f93d02d5a8eff136624fede30b85fbabd..86d9576c8247be8a49a795d54e9c43594ee64e5a 100644 (file)
@@ -3,8 +3,6 @@ TMP_DIR:=$(TOPDIR)/tmp
 
 all: $(TMP_DIR)/.$(SCAN_TARGET)
 
-include $(TOPDIR)/include/host.mk
-
 SCAN_TARGET ?= packageinfo
 SCAN_NAME ?= package
 SCAN_DIR ?= package
@@ -12,6 +10,8 @@ TARGET_STAMP:=$(TMP_DIR)/info/.files-$(SCAN_TARGET).stamp
 FILELIST:=$(TMP_DIR)/info/.files-$(SCAN_TARGET)-$(SCAN_COOKIE)
 OVERRIDELIST:=$(TMP_DIR)/info/.overrides-$(SCAN_TARGET)-$(SCAN_COOKIE)
 
+export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
+
 ifeq ($(IS_TTY),1)
   define progress
        printf "\033[M\r$(1)" >&2;
index a9ea21bbef3eb8f3c794b5086a62a5a978600df2..0f685809557e48f5fec9b8d154dea30d442e0b91 100644 (file)
@@ -24,6 +24,9 @@ export REVISION
 export SOURCE_DATE_EPOCH
 export GIT_CONFIG_PARAMETERS='core.autocrlf=false'
 export MAKE_JOBSERVER=$(filter --jobserver%,$(MAKEFLAGS))
+export GNU_HOST_NAME:=$(shell $(TOPDIR)/scripts/config.guess)
+export HOST_OS:=$(shell uname)
+export HOST_ARCH:=$(shell uname -m)
 
 # prevent perforce from messing with the patch utility
 unexport P4PORT P4USER P4CONFIG P4CLIENT
@@ -148,7 +151,6 @@ kernel_nconfig: prepare_kernel_conf
 
 staging_dir/host/.prereq-build: include/prereq-build.mk
        mkdir -p tmp
-       rm -f tmp/.host.mk
        @$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
                echo "Prerequisite check failed. Use FORCE=1 to override."; \
                false; \
index f9dd61c031b054764b4215404f4b3c246c7049f6..e8e4641f6700726fed3713c338cf27445cff815d 100644 (file)
@@ -7,7 +7,6 @@
 
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
-include $(INCLUDE_DIR)/host.mk
 include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
index baa0e1f271993d1d063c55f045cf7eaf413559f7..f0e2bd12819de307bc635801a0d17df4c8becc2d 100644 (file)
@@ -13,7 +13,7 @@ export TOPDIR LC_ALL LANG
 export OPENWRT_VERBOSE=s
 all: help
 
-include $(TOPDIR)/include/host.mk
+export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
 
 ifneq ($(OPENWRT_BUILD),1)
   override OPENWRT_BUILD=1
@@ -82,7 +82,6 @@ PROFILE_LIST = $(foreach p,$(PROFILE_NAMES), \
 
 staging_dir/host/.prereq-build: include/prereq-build.mk
        mkdir -p tmp
-       rm -f tmp/.host.mk
        @$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
                echo "Prerequisite check failed. Use FORCE=1 to override."; \
                false; \
index a11e9897052f4c957cd2c01305557762d04f71ef..355333695dccd9cc31c0845991fdf74ea4f15643 100644 (file)
@@ -4,7 +4,6 @@
 #
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
-include $(INCLUDE_DIR)/host.mk
 
 DEVICE_VARS += DEVICE_PROFILE IMAGE_SIZE DTB_SIZE
 
index 07574f981540574bb723672e93b9543be3026ef1..8dc923907d23f7d694c54ee395ed66d4811b5602 100644 (file)
@@ -5,7 +5,6 @@
 # See /LICENSE for more information.
 #
 include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/host.mk
 
 ARCH:=arm
 BOARD:=brcm2708
index dbe014565eb2b1f1d16d24732c14a86027635f7e..0b3f6a7588c1d3582acecf34f4e0bc7489c30ad0 100644 (file)
@@ -7,7 +7,6 @@
 #
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
-include $(INCLUDE_DIR)/host.mk
 
 FAT32_BLOCK_SIZE=1024
 FAT32_BLOCKS=$(shell echo $$(($(CONFIG_BRCM2708_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
index c3f368f2e4906ffc926e5cdebcd5df6041579ee5..d0d86ee10d764c1977c41b1b11676ddfb88e138d 100644 (file)
@@ -7,7 +7,6 @@
 #
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
-include $(INCLUDE_DIR)/host.mk
 
 FAT32_BLOCK_SIZE=1024
 FAT32_BLOCKS=$(shell echo $$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
index 7cf1614218f07fbcee3e198400d5f49219d19ad8..6967e403cb7eaba9294913d8d6f010326e0f29ab 100644 (file)
@@ -5,7 +5,6 @@
 # See /LICENSE for more information.
 #
 include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/host.mk
 
 # UML only makes sense on linux
 ifeq ($(HOST_OS),Linux)
index 47b678ddbd9380e8fb723bf676a99d9e0a10982d..82b5d369425ceef52e70018ea33a94a796cae496 100644 (file)
@@ -5,7 +5,6 @@
 # See /LICENSE for more information.
 #
 include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/host.mk
 
 ARCH:=arm
 BOARD:=zynq
index a1b64155bb04f2a9316d1ba15b5ab8438f45d2ff..ae65fd1c8f4a43ee9201d583150e2aa9d9a4e4ce 100644 (file)
@@ -8,7 +8,6 @@
 
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
-include $(INCLUDE_DIR)/host.mk
 include $(INCLUDE_DIR)/version.mk
 
 override MAKEFLAGS=
index 2edf7b3a20461b81b122261976f33bef9845ff7d..8df1904cb02b9e0a0d3a6c0fdaa9f7e688673fbf 100644 (file)
@@ -14,7 +14,7 @@ export TOPDIR LC_ALL LANG SDK
 
 world:
 
-include $(TOPDIR)/include/host.mk
+export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
 
 ifneq ($(OPENWRT_BUILD),1)
   override OPENWRT_BUILD=1
index 2fcda3e25ff6a457c4a6cc15ba55eb295504494f..ef2dc68a97e433917f8e9e8f6727e5b28d60c262 100644 (file)
@@ -9,7 +9,6 @@
 
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
-include $(INCLUDE_DIR)/host.mk
 include $(INCLUDE_DIR)/version.mk
 
 override MAKEFLAGS=