Procházet zdrojové kódy

some minor fixes, cleanups, package build abstraction

SVN-Revision: 9051
Felix Fietkau před 18 roky
rodič
revize
800ef0f56c
5 změnil soubory, kde provedl 23 přidání a 9 odebrání
  1. 1 4
      include/package-ipkg.mk
  2. 9 2
      include/package.mk
  3. 4 0
      include/prereq.mk
  4. 4 0
      include/quilt.mk
  5. 5 3
      include/target.mk

+ 1 - 4
include/package-ipkg.mk

@@ -23,7 +23,7 @@ define BuildIPKGVariable
 endef
 
 ifeq ($(DUMP),)
-  define BuildIPKG
+  define BuildTarget/ipkg
     IPKG_$(1):=$(PACKAGE_DIR)/$(1)_$(VERSION)_$(PKGARCH).ipk
     IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg/$(1)
     INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list
@@ -92,9 +92,6 @@ ifeq ($(DUMP),)
     $(PKG_BUILD_DIR)/.version-$(1)_$(VERSION)_$(PKGARCH): $(STAMP_PREPARED)
 	-@rm -f $(PKG_BUILD_DIR)/.version-$(1)_* 2>/dev/null
 	@touch $$@
-
-    $$(eval $$(call Build/DefaultTargets,$(1)))
-
   endef
 
   $(STAGING_DIR)/etc/ipkg.conf:

+ 9 - 2
include/package.mk

@@ -97,8 +97,15 @@ endif
   $(call shexport,Package/$(1)/description)
   $(call shexport,Package/$(1)/config)
 
-  $(Dumpinfo)
-  $(BuildIPKG)
+  $(if $(DUMP), \
+    $(Dumpinfo), \
+    $(foreach target, \
+      $(if $(Package/$(1)/targets),$(Package/$(1)/targets), \
+        $(if $(PKG_TARGETS),$(PKG_TARGETS), ipkg ) \
+      ), $(BuildTarget/$(target)) \
+    ) \
+  )
+  $(if $(DUMP),,$(call Build/DefaultTargets,$(1)))
 endef
 
 # prevent libtool from setting rpath when linking

+ 4 - 0
include/prereq.mk

@@ -5,6 +5,9 @@
 # See /LICENSE for more information.
 #
 
+ifneq ($(__prereq_inc),1)
+__prereq_inc:=1
+
 prereq:
 	if [ -f $(TMP_DIR)/.prereq-error ]; then \
 		echo; \
@@ -15,6 +18,7 @@ prereq:
 	fi
 
 .SILENT: prereq
+endif
 
 define Require
   export PREREQ_CHECK=1

+ 4 - 0
include/quilt.mk

@@ -5,6 +5,9 @@
 # See /LICENSE for more information.
 #
 
+ifneq ($(__quilt_inc),1)
+__quilt_inc:=1
+
 ifeq ($(TARGET_BUILD),1)
   PKG_BUILD_DIR:=$(LINUX_DIR)
 endif
@@ -134,3 +137,4 @@ refresh: quilt-check
 update: quilt-check
 	$(if $(KERNEL_BUILD),$(Quilt/Refresh/Kernel),$(Quilt/Refresh/Package))
 
+endif

+ 5 - 3
include/target.mk

@@ -75,9 +75,11 @@ define Profile
   endif
 endef
 
--include $(PLATFORM_DIR)/profiles/*.mk
-ifneq ($(PLATFORM_DIR),$(PLATFORM_SUBDIR))
-  -include $(PLATFORM_SUBDIR)/profiles/*.mk
+ifeq ($(DUMP)$(if $(TARGET_BUILD),,1),)
+  -include $(PLATFORM_DIR)/profiles/*.mk
+  ifneq ($(PLATFORM_DIR),$(PLATFORM_SUBDIR))
+    -include $(PLATFORM_SUBDIR)/profiles/*.mk
+  endif
 endif
 
 $(eval $(call shexport,Target/Description))