X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/b8885f1f93a2d6cf32afdf2e59f87a837a0d4de7..035f1eebe8cf4b5671415c13094d83e4ce44c135:/include/host-build.mk

diff --git a/include/host-build.mk b/include/host-build.mk
index 5670b6f17..ea7cd3aca 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -5,33 +5,12 @@
 # See /LICENSE for more information.
 #
 
-include $(TOPDIR)/.host.mk
-
-$(TOPDIR)/.host.mk: $(INCLUDE_DIR)/host-build.mk
-	echo "HOST_OS:=`uname`" > $@
-	echo "HOST_ARCH:=` \
-		$(HOSTCC) -dumpmachine | sed -e s'/-.*//' \
-			-e 's/sparc.*/sparc/' \
-			-e 's/arm.*/arm/' \
-			-e 's/m68k.*/m68k/' \
-			-e 's/ppc/powerpc/' \
-			-e 's/v850.*/v850/' \
-			-e 's/sh[234]/sh/' \
-			-e 's/mips-.*/mips/' \
-			-e 's/mipsel-.*/mipsel/' \
-			-e 's/cris.*/cris/' \
-			-e 's/i[3-9]86/i386/'`" >> $@
-	echo "GNU_HOST_NAME:=`$(HOSTCC) -dumpmachine`" >> $@
-
-
-ifneq ($(strip $(PKG_CAT)),)
-  ifeq ($(PKG_CAT),unzip)
-    UNPACK=unzip -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE)
-  else
-    UNPACK=$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) -
-  endif
+include $(INCLUDE_DIR)/host.mk
+include $(INCLUDE_DIR)/unpack.mk
+
+ifneq ($(strip $(PKG_UNPACK)),)
   define Build/Prepare/Default
-  	$(UNPACK)
+  	$(PKG_UNPACK)
 	@if [ -d ./patches ]; then \
 		$(PATCH) $(PKG_BUILD_DIR) ./patches; \
 	fi
@@ -94,6 +73,15 @@ ifneq ($(strip $(PKG_SOURCE)),)
 endif
 
 define HostBuild
+  ifeq ($(DUMP),)
+    ifeq ($(CONFIG_AUTOREBUILD),y)
+      ifneq ($$(shell $(SCRIPT_DIR)/timestamp.pl -p $(PKG_BUILD_DIR) . $(PKG_FILE_DEPEND)),$(PKG_BUILD_DIR))
+        $$(info Forcing package rebuild)
+        $(PKG_BUILD_DIR)/.prepared: package-clean
+      endif
+    endif
+  endif
+  
   $(PKG_BUILD_DIR)/.prepared:
 	@-rm -rf $(PKG_BUILD_DIR)
 	@mkdir -p $(PKG_BUILD_DIR)
@@ -110,10 +98,11 @@ define HostBuild
 
   $(STAGING_DIR)/stampfiles/.host_$(PKG_NAME)-installed: $(PKG_BUILD_DIR)/.built
 	$(call Build/Install)
+	mkdir -p $$(shell dirname $$@)
 	touch $$@
 	
   ifdef Build/Install
-    install-targets: $(STAGING_DIR)/stampfiles/.host_$(PKG_NAME)-installed
+    install: $(STAGING_DIR)/stampfiles/.host_$(PKG_NAME)-installed
   endif
 
   package-clean: FORCE
@@ -124,16 +113,9 @@ define HostBuild
   download:
   prepare: $(PKG_BUILD_DIR)/.prepared
   configure: $(PKG_BUILD_DIR)/.configured
-
-  compile-targets: $(PKG_BUILD_DIR)/.built
-  compile: compile-targets
-
-  install-targets:
-  install: install-targets
-
-  clean-targets:
+  compile: $(PKG_BUILD_DIR)/.built 
+  install:
   clean: FORCE
-	@$(MAKE) clean-targets
 	$(call Build/Clean)
 	rm -rf $(PKG_BUILD_DIR)