add submenu dependencies (used to hide the proprietary broadcom driver on anything...
[openwrt.git] / include / package.mk
index 618c3c5..757c839 100644 (file)
@@ -41,6 +41,7 @@ define Build/DefaultTargets
        touch $$@
 
   $(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed: $(PKG_BUILD_DIR)/.built
+       mkdir -p $(STAGING_DIR)/stampfiles
        $(call Build/InstallDev)
        touch $$@
        
@@ -65,6 +66,7 @@ define Package/Default
   SECTION:=opt
   CATEGORY:=Extra packages
   DEPENDS:=
+  EXTRA_DEPENDS:=
   MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
   SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd})
   ifneq ($(PKG_VERSION),)
@@ -81,6 +83,7 @@ define Package/Default
   DEFAULT:=
   MENU:=
   SUBMENU:=
+  SUBMENUDEP:=
   TITLE:=
   DESCRIPTION:=
 endef
@@ -113,12 +116,14 @@ define BuildPackage
   IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg/$(1)
   INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list
 
-  ifeq ($(CONFIG_PACKAGE_$(1)),y)
-    install-targets: $$(INFO_$(1))
-  endif
+  ifdef Package/$(1)/install
+    ifeq ($(CONFIG_PACKAGE_$(1)),y)
+      install-targets: $$(INFO_$(1))
+    endif
 
-  ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
-    compile-targets: $$(IPKG_$(1))
+    ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
+      compile-targets: $$(IPKG_$(1))
+    endif
   endif
 
   ifeq ($(FORCEREBUILD),y)
@@ -138,6 +143,10 @@ define BuildPackage
   ifneq ($(SUBMENU),)
     DUMPINFO += \
        echo "Submenu: $(SUBMENU)";
+    ifneq ($(SUBMENUDEP),)
+      DUMPINFO += \
+         echo "Submenu-Depends: $(SUBMENUDEP)";
+    endif
   endif
 
   ifneq ($(DEFAULT),)
@@ -173,7 +182,7 @@ define BuildPackage
   $(eval $(call BuildIPKGVariable,$(1),postinst))
   $(eval $(call BuildIPKGVariable,$(1),prerm))
   $(eval $(call BuildIPKGVariable,$(1),postrm))
-  $$(IDIR_$(1))/CONTROL/control: $(PKG_BUILD_DIR)/.prepared
+  $$(IDIR_$(1))/CONTROL/control: Makefile $(PKG_BUILD_DIR)/.prepared
        mkdir -p $$(IDIR_$(1))/CONTROL
        echo "Package: $(1)" > $$(IDIR_$(1))/CONTROL/control
        echo "Version: $(VERSION)" >> $$(IDIR_$(1))/CONTROL/control
@@ -182,7 +191,7 @@ define BuildPackage
                for depend in $$(filter-out @%,$$(IDEPEND_$(1))); do \
                        DEPENDS=$$$${DEPENDS:+$$$$DEPENDS, }$$$${depend##+}; \
                done; \
-               echo "Depends: $$$$DEPENDS" >> $$(IDIR_$(1))/CONTROL/control; \
+               echo "Depends: $(EXTRA_DEPENDS) $$$$DEPENDS" >> $$(IDIR_$(1))/CONTROL/control; \
        )
        echo "Source: $(SOURCE)" >> $$(IDIR_$(1))/CONTROL/control
        echo "Section: $(SECTION)" >> $$(IDIR_$(1))/CONTROL/control
@@ -290,7 +299,7 @@ else
        mkdir -p $@
                
   ifneq ($(strip $(PKG_SOURCE)),)
-    source: $(DL_DIR)/$(PKG_SOURCE)
+    download: $(DL_DIR)/$(PKG_SOURCE)
 
     $(DL_DIR)/$(PKG_SOURCE):
                mkdir -p $(DL_DIR)
@@ -299,7 +308,7 @@ else
     $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
   endif
 
-  source:
+  download:
   prepare: $(PKG_BUILD_DIR)/.prepared
   configure: $(PKG_BUILD_DIR)/.configured
 
This page took 0.025083 seconds and 4 git commands to generate.