add PKG_HOST_ONLY variable to prevent target builds
[openwrt.git] / include / package.mk
index d375130..c134f54 100644 (file)
@@ -27,11 +27,15 @@ include $(INCLUDE_DIR)/quilt.mk
 include $(INCLUDE_DIR)/package-defaults.mk
 include $(INCLUDE_DIR)/package-dumpinfo.mk
 include $(INCLUDE_DIR)/package-ipkg.mk
+include $(INCLUDE_DIR)/package-debug.mk
 include $(INCLUDE_DIR)/package-bin.mk
 include $(INCLUDE_DIR)/autotools.mk
 
 override MAKEFLAGS=
-export CONFIG_SITE:=$(INCLUDE_DIR)/site/$(patsubst %gnueabi,%,$(REAL_GNU_TARGET_NAME))
+CONFIG_SITE:=$(INCLUDE_DIR)/site/$(REAL_GNU_TARGET_NAME)
+ifneq ($(CONFIG_LINUX_2_4),)
+  CONFIG_SITE:=$(subst linux-,linux2.4-,$(CONFIG_SITE))
+endif
 CUR_MAKEFILE:=$(filter-out Makefile,$(firstword $(MAKEFILE_LIST)))
 SUBMAKE:=$(NO_TRACE_MAKE) $(if $(CUR_MAKEFILE),-f $(CUR_MAKEFILE))
 
@@ -64,6 +68,7 @@ define Build/DefaultTargets
   $(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))
   $(call Build/Autoclean)
 
+  $(STAMP_PREPARED) : export PATH=$$(TARGET_PATH_PKG)
   $(STAMP_PREPARED):
        @-rm -rf $(PKG_BUILD_DIR)
        @mkdir -p $(PKG_BUILD_DIR)
@@ -72,12 +77,16 @@ define Build/DefaultTargets
        $(foreach hook,$(Hooks/Prepare/Post),$(call $(hook))$(sep))
        touch $$@
 
+  $(STAMP_CONFIGURED) : export PATH=$$(TARGET_PATH_PKG)
+  $(STAMP_CONFIGURED) : export CONFIG_SITE:=$$(CONFIG_SITE)
   $(STAMP_CONFIGURED): $(STAMP_PREPARED)
        $(foreach hook,$(Hooks/Configure/Pre),$(call $(hook))$(sep))
        $(Build/Configure)
        $(foreach hook,$(Hooks/Configure/Post),$(call $(hook))$(sep))
        touch $$@
 
+  $(STAMP_BUILT) : export PATH=$$(TARGET_PATH_PKG)
+  $(STAMP_BUILT) : export CONFIG_SITE:=$$(CONFIG_SITE)
   $(STAMP_BUILT): $(STAMP_CONFIGURED)
        $(foreach hook,$(Hooks/Compile/Pre),$(call $(hook))$(sep))
        $(Build/Compile)
@@ -86,6 +95,7 @@ define Build/DefaultTargets
        $(foreach hook,$(Hooks/Install/Post),$(call $(hook))$(sep))
        touch $$@
 
+  $(STAMP_INSTALLED) : export PATH=$$(TARGET_PATH_PKG)
   $(STAMP_INSTALLED): $(STAMP_BUILT)
        $(SUBMAKE) -j1 clean-staging
        rm -rf $(TMP_DIR)/stage-$(PKG_NAME)
@@ -95,8 +105,7 @@ define Build/DefaultTargets
        )
        $(call Build/InstallDev,$(TMP_DIR)/stage-$(PKG_NAME),$(TMP_DIR)/stage-$(PKG_NAME)/host)
        $(foreach hook,$(Hooks/InstallDev/Post),\
-               $(call $(hook),$(TMP_DIR)/stage-$(PKG_NAME),$(TMP_DIR)/stage-$(PKG_NAME)/host
-)$(sep)\
+               $(call $(hook),$(TMP_DIR)/stage-$(PKG_NAME),$(TMP_DIR)/stage-$(PKG_NAME)/host)$(sep)\
        )
        if [ -d $(TMP_DIR)/stage-$(PKG_NAME) ]; then \
                (cd $(TMP_DIR)/stage-$(PKG_NAME); find ./ > $(STAGING_DIR)/packages/$(PKG_NAME).list); \
@@ -121,7 +130,7 @@ define BuildPackage
   $(eval $(Package/$(1)))
 
 ifdef DESCRIPTION
-$$(error DESCRIPTION:= is obselete, use Package/PKG_NAME/description)
+$$(error DESCRIPTION:= is obsolete, use Package/PKG_NAME/description)
 endif
 
 ifndef Package/$(1)/description
@@ -143,11 +152,11 @@ endif
     $(Dumpinfo), \
     $(foreach target, \
       $(if $(Package/$(1)/targets),$(Package/$(1)/targets), \
-        $(if $(PKG_TARGETS),$(PKG_TARGETS), ipkg ) \
+        $(if $(PKG_TARGETS),$(PKG_TARGETS), ipkg $(if $(CONFIG_DEBUG_DIR),debug)) \
       ), $(BuildTarget/$(target)) \
     ) \
   )
-  $(if $(DUMP),,$(call Build/DefaultTargets,$(1)))
+  $(if $(PKG_HOST_ONLY)$(DUMP),,$(call Build/DefaultTargets,$(1)))
 endef
 
 define pkg_install_files
This page took 0.022024 seconds and 4 git commands to generate.