Changeset 2262


Ignore:
Timestamp:
Jan 3, 2013, 12:47:53 PM (6 years ago)
Author:
matthijs
Message:

build-system: Optimize metadatascanning.

This backports r14734 from OpenWRT trunk almost literally.

In addition to optimizing the metadata scanning, it also prevents some
package Makefiles from being read twice. This duplication would cause
make warnings, which would again cause the feed update script to output
"please fix" messages.

References: #1240

Location:
trunk/openwrt
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/openwrt/include/host.mk

    r1 r2262  
    77
    88TMP_DIR ?= $(TOPDIR)/tmp
    9 -include $(TMP_DIR)/.host.mk
     9ifndef DUMP
     10  -include $(TMP_DIR)/.host.mk
     11endif
    1012
    1113export TAR FIND
  • trunk/openwrt/include/kernel-version.mk

    r1 r2262  
    3636LINUX_KERNEL_MD5SUM?=x
    3737
    38 KERNEL?=2.$(word 2,$(subst ., ,$(strip $(LINUX_VERSION))))
    39 KERNEL_PATCHVER=$(shell echo '$(LINUX_VERSION)' | cut -d. -f1,2,3 | cut -d- -f1)
     38split_version=$(subst ., ,$(1))
     39merge_version=$(subst $(space),.,$(1))
     40KERNEL=$(call merge_version,$(wordlist 1,2,$(call split_version,$(LINUX_VERSION))))
     41KERNEL_PATCHVER=$(call merge_version,$(wordlist 1,3,$(call split_version,$(LINUX_VERSION))))
    4042
  • trunk/openwrt/include/package-dumpinfo.mk

    r1 r2262  
    66#
    77
     8#  define Config
     9#    preconfig_$$(1) += echo "Preconfig: $(1)"; echo "Preconfig-Type: $(2)"; echo "Preconfig-Default: $(3)"; echo "Preconfig-Label: $(4)";
     10#  endef
     11#
     12#  define Dumpinfo
     13#    dumpinfo: dumpinfo-$(1)
     14#    .SILENT: dumpinfo-$(1)
     15#    dumpinfo-$(1): FORCE
     16#         @echo "Package: $(1)" ; \
     17#               $(if $(MENU),echo "Menu: $(MENU)";) \
     18#               $(if $(SUBMENU),echo "Submenu: $(SUBMENU)";) \
     19#               $(if $(SUBMENUDEP),echo "Submenu-Depends: $(SUBMENUDEP)";) \
     20#               $(if $(DEFAULT),echo "Default: $(DEFAULT)";)  \
     21#               if [ "$$$$PREREQ_CHECK" = 1 ]; then echo "Prereq-Check: 1"; fi; \
     22#               echo "Version: $(VERSION)"; \
     23#               echo "Depends: $(DEPENDS)"; \
     24#               echo "Provides: $(PROVIDES)"; \
     25#               echo "Build-Depends: $(PKG_BUILD_DEPENDS)"; \
     26#               echo "Section: $(SECTION)"; \
     27#               echo "Category: $(CATEGORY)"; \
     28#               echo "Title: $(TITLE)"; \
     29#               echo "Maintainer: $(MAINTAINER)"; \
     30#               echo "Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg))"; \
     31#               $(if $(KCONFIG),echo "Kernel-Config: $(KCONFIG)";) \
     32#               echo -n "Description: "; \
     33#               getvar $(call shvar,Package/$(1)/description); \
     34#               $(if $(URL),echo;echo "$(URL)";) \
     35#               echo "@@" ; \
     36#               $$(if $$(Package/$(1)/config),echo "Config: "; getvar $(call shvar,Package/$(1)/config); echo "@@"; ) \
     37#               $$(if $$(preconfig_$(1)),$$(preconfig_$(1)) echo "")
     38#
    839ifneq ($(DUMP),)
    9   define Config
    10     preconfig_$$(1) += echo "Preconfig: $(1)"; echo "Preconfig-Type: $(2)"; echo "Preconfig-Default: $(3)"; echo "Preconfig-Label: $(4)";
    11   endef
     40dumpinfo: FORCE
    1241
    13   define Dumpinfo
    14     dumpinfo: dumpinfo-$(1)
    15     .SILENT: dumpinfo-$(1)
    16     dumpinfo-$(1): FORCE
    17           @echo "Package: $(1)" ; \
    18                 $(if $(MENU),echo "Menu: $(MENU)";) \
    19                 $(if $(SUBMENU),echo "Submenu: $(SUBMENU)";) \
    20                 $(if $(SUBMENUDEP),echo "Submenu-Depends: $(SUBMENUDEP)";) \
    21                 $(if $(DEFAULT),echo "Default: $(DEFAULT)";)  \
    22                 if [ "$$$$PREREQ_CHECK" = 1 ]; then echo "Prereq-Check: 1"; fi; \
    23                 echo "Version: $(VERSION)"; \
    24                 echo "Depends: $(DEPENDS)"; \
    25                 echo "Provides: $(PROVIDES)"; \
    26                 echo "Build-Depends: $(PKG_BUILD_DEPENDS)"; \
    27                 echo "Section: $(SECTION)"; \
    28                 echo "Category: $(CATEGORY)"; \
    29                 echo "Title: $(TITLE)"; \
    30                 echo "Maintainer: $(MAINTAINER)"; \
    31                 echo "Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg))"; \
    32                 $(if $(KCONFIG),echo "Kernel-Config: $(KCONFIG)";) \
    33                 echo -n "Description: "; \
    34                 getvar $(call shvar,Package/$(1)/description); \
    35                 $(if $(URL),echo;echo "$(URL)";) \
    36                 echo "@@" ; \
    37                 $$(if $$(Package/$(1)/config),echo "Config: "; getvar $(call shvar,Package/$(1)/config); echo "@@"; ) \
    38                 $$(if $$(preconfig_$(1)),$$(preconfig_$(1)) echo "")
     42define Config/template
     43Preconfig: $(1)
     44Preconfig-Type: $(2)
     45Preconfig-Default: $(3)
     46Preconfig-Label: $(4)
     47
     48endef
     49
     50define Config
     51  Preconfig/$(1) = $$(call Config/template,$(1),$(2),$(3),$(4))
     52  preconfig_$$(1) += $(1)
     53endef
     54
     55define Dumpinfo
     56$(info Package: $(1)
     57$(if $(MENU),Menu: $(MENU)
     58)$(if $(SUBMENU),Submenu: $(SUBMENU)
     59)$(if $(SUBMENUDEP),Submenu-Depends: $(SUBMENUDEP)
     60)$(if $(DEFAULT),Default: $(DEFAULT)
     61)$(if $(findstring $(PREREQ_CHECK),1),Prereq-Check: 1
     62)Version: $(VERSION)
     63Depends: $(DEPENDS)
     64Provides: $(PROVIDES)
     65Build-Depends: $(PKG_BUILD_DEPENDS)
     66Section: $(SECTION)
     67Category: $(CATEGORY)
     68Title: $(TITLE)
     69Maintainer: $(MAINTAINER)
     70Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg))
     71$(if $(KCONFIG),Kernel-Config: $(KCONFIG)
     72)Description: $(if $(Package/$(1)/description),$(Package/$(1)/description),$(TITLE))
     73$(if $(URL),$(URL)
     74)@@
     75$(if $(Package/$(1)/config),Config:
     76$(Package/$(1)/config)
     77@@
     78)$(foreach pc,$(preconfig_$(1)),
     79$(Preconfig/$(pc))))
    3980  endef
    4081endif
  • trunk/openwrt/include/quilt.mk

    r1716 r2262  
    44# This is free software, licensed under the GNU General Public License v2.
    55# See /LICENSE for more information.
    6 #
    76
    8 ifneq ($(__quilt_inc),1)
     7ifneq ($(if $(DUMP),1,$(__quilt_inc)),1)
    98__quilt_inc:=1
    109
  • trunk/openwrt/include/target.mk

    r1 r2262  
    4141
    4242ifneq ($(TARGET_BUILD),1)
    43   include $(PLATFORM_DIR)/Makefile
    44   ifneq ($(PLATFORM_DIR),$(PLATFORM_SUBDIR))
    45     include $(PLATFORM_SUBDIR)/target.mk
     43  ifndef DUMP
     44    include $(PLATFORM_DIR)/Makefile
     45    ifneq ($(PLATFORM_DIR),$(PLATFORM_SUBDIR))
     46      include $(PLATFORM_SUBDIR)/target.mk
     47    endif
    4648  endif
    4749else
     
    103105$(eval $(call shexport,Target/Description))
    104106
    105 include $(INCLUDE_DIR)/kernel-version.mk
     107ifneq ($(TARGET_BUILD)$(if $(DUMP),,1),)
     108  include $(INCLUDE_DIR)/kernel-version.mk
     109endif
    106110
    107111GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic-$(KERNEL)
  • trunk/openwrt/rules.mk

    r2028 r2262  
    6868TARGET_LDFLAGS:=-L$(TOOLCHAIN_DIR)/lib -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
    6969
     70ifndef DUMP
    7071ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
    7172  -include $(TOOLCHAIN_DIR)/info.mk
     
    7475  TARGET_CROSS:=$(if $(TARGET_CROSS),$(TARGET_CROSS),$(OPTIMIZE_FOR_CPU)-linux-uclibc$(if $(CONFIG_EABI_SUPPORT),gnueabi)-)
    7576  TARGET_CFLAGS+= -fhonour-copts
     77endif
    7678endif
    7779
Note: See TracChangeset for help on using the changeset viewer.