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 a26eeee..670e6a2 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 ffb6846..c8477e1 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 81519cd..9bc30c6 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 56c0fe3..7d1e23c 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 ce1aa25..a3ef302 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 af4e8b5..2d3a1fa 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 92f2dc3..86d9576 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 a9ea21b..0f68580 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 f9dd61c..e8e4641 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 baa0e1f..f0e2bd1 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 a11e989..3553336 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 07574f9..8dc9239 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 dbe0145..0b3f6a7 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 c3f368f..d0d86ee 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 7cf1614..6967e40 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 47b678d..82b5d36 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 a1b6415..ae65fd1 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 2edf7b3..8df1904 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 2fcda3e..ef2dc68 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=