X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=rules.mk;h=15b330c792615156d9bdb65fa847ce9fb2c80164;hp=ed796a54024adc4d4cbcb13d46a03bf6e0c1c8f5;hb=1ff4cd1ff18df6595416d8345d05cc415fdfeae3;hpb=5ef0854b1109ba2dbd1dd3d9f87ce5801002d0ba diff --git a/rules.mk b/rules.mk index ed796a5402..15b330c792 100644 --- a/rules.mk +++ b/rules.mk @@ -21,6 +21,7 @@ DUMP:=1 endif export TMP_DIR:=$(TOPDIR)/tmp +export TMPDIR:=$(TMP_DIR) qstrip=$(strip $(subst ",,$(1))) #")) @@ -143,6 +144,7 @@ ifeq ($(or $(CONFIG_EXTERNAL_TOOLCHAIN),$(CONFIG_GCC_VERSION_4_8),$(CONFIG_TARGE endif PACKAGE_DIR:=$(BIN_DIR)/packages +PACKAGE_DIR_ALL:=$(TOPDIR)/staging_dir/packages/$(BOARD) BUILD_DIR:=$(BUILD_DIR_BASE)/$(TARGET_DIR_NAME) STAGING_DIR:=$(TOPDIR)/staging_dir/$(TARGET_DIR_NAME) BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/$(TOOLCHAIN_DIR_NAME) @@ -243,9 +245,9 @@ export PKG_CONFIG HOSTCC:=gcc HOSTCXX:=g++ -HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include -I$(STAGING_DIR_HOST)/usr/include $(if $(IS_PACKAGE_BUILD),-I$(STAGING_DIR_HOSTPKG)/include -I$(STAGING_DIR)/host/include) +HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include $(if $(IS_PACKAGE_BUILD),-I$(STAGING_DIR_HOSTPKG)/include -I$(STAGING_DIR)/host/include) HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS) -HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib -L$(STAGING_DIR_HOST)/usr/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib) +HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib) ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) TARGET_AR:=$(TARGET_CROSS)gcc-ar @@ -263,6 +265,7 @@ TARGET_CC:=$(TARGET_CROSS)gcc TARGET_CXX:=$(TARGET_CROSS)g++ KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh SED:=$(STAGING_DIR_HOST)/bin/sed -i -e +ESED:=$(STAGING_DIR_HOST)/bin/sed -E -i -e CP:=cp -fpR LN:=ln -sf XARGS:=xargs -r @@ -274,6 +277,7 @@ PATCH:=patch PYTHON:=python INSTALL_BIN:=install -m0755 +INSTALL_SUID:=install -m4755 INSTALL_DIR:=install -d -m0755 INSTALL_DATA:=install -m0644 INSTALL_CONF:=install -m0600 @@ -354,10 +358,6 @@ define shexport export $(call shvar,$(1))=$$(call $(1)) endef -define include_mk -$(eval -include $(if $(DUMP),,$(STAGING_DIR)/mk/$(strip $(1)))) -endef - # Execute commands under flock # $(1) => The shell expression. # $(2) => The lock name. If not given, the global lock will be used. @@ -392,8 +392,9 @@ endef # Calculate sha256sum of any plain file within a given directory # $(1) => Input directory +# $(2) => If set, recurse into subdirectories define sha256sums - (cd $(1); find . -maxdepth 1 -type f -not -name 'sha256sums' -printf "%P\n" | sort | \ + (cd $(1); find . $(if $(2),,-maxdepth 1) -type f -not -name 'sha256sums' -printf "%P\n" | sort | \ xargs -r $(STAGING_DIR_HOST)/bin/mkhash -n sha256 | sed -ne 's!^\(.*\) \(.*\)$$!\1 *\2!p' > sha256sums) endef