diff options
author | Felix Fietkau <nbd@nbd.name> | 2016-12-14 15:36:39 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2016-12-17 10:36:25 +0100 |
commit | 7a315b0b5d6aa91695853a8647383876e4b49a7a (patch) | |
tree | ca99d91b9ec9408e37d30f2983847fc5a500d4a7 /include/package.mk | |
parent | 720b99215da295a2e7b4acdef30b58bec6acedc2 (diff) | |
download | mtk-20170518-7a315b0b5d6aa91695853a8647383876e4b49a7a.zip mtk-20170518-7a315b0b5d6aa91695853a8647383876e4b49a7a.tar.gz mtk-20170518-7a315b0b5d6aa91695853a8647383876e4b49a7a.tar.bz2 |
build: implement make check and make package/X/check
This is intended to be used for a wide array of package sanity checks.
The first check that is implemented is for the hash of downloaded files.
It checks:
- Missing hash
- Use of SHA256 instead of MD5
- dl/<file> hash not matching hash in makefile
- deprecated MD5SUM variable
The deprecated MD5SUM variable check is skipped for feeds/ until OpenWrt
is updated as well
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'include/package.mk')
-rw-r--r-- | include/package.mk | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/include/package.mk b/include/package.mk index 26fc30c..f51232f 100644 --- a/include/package.mk +++ b/include/package.mk @@ -7,7 +7,7 @@ __package_mk:=1 -all: $(if $(DUMP),dumpinfo,compile) +all: $(if $(DUMP),dumpinfo,$(if $(CHECK),check,compile)) PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION)) PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install @@ -144,9 +144,8 @@ define Build/Exports/Default endef Build/Exports=$(Build/Exports/Default) -define Build/DefaultTargets +define Build/CoreTargets $(if $(QUILT),$(Build/Quilt)) - $(if $(USE_SOURCE_DIR)$(USE_GIT_TREE),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))) $(call Build/Autoclean) download: @@ -211,15 +210,20 @@ define Build/DefaultTargets compile: $(STAMP_INSTALLED) endif - define Build/DefaultTargets - endef - prepare: $(STAMP_PREPARED) configure: $(STAMP_CONFIGURED) dist: $(STAMP_CONFIGURED) distcheck: $(STAMP_CONFIGURED) endef +define Build/DefaultTargets + $(if $(USE_SOURCE_DIR)$(USE_GIT_TREE),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))) + $(if $(DUMP),,$(Build/CoreTargets)) + + define Build/DefaultTargets + endef +endef + define Build/IncludeOverlay $(eval -include $(wildcard $(TOPDIR)/overlay/*/$(PKG_DIR_NAME).mk)) define Build/IncludeOverlay @@ -251,14 +255,14 @@ endif ) $(if $(DUMP), \ - $(Dumpinfo/Package), \ + $(if $(CHECK),,$(Dumpinfo/Package)), \ $(foreach target, \ $(if $(Package/$(1)/targets),$(Package/$(1)/targets), \ $(if $(PKG_TARGETS),$(PKG_TARGETS), ipkg) \ ), $(BuildTarget/$(target)) \ ) \ ) - $(if $(PKG_HOST_ONLY)$(DUMP),,$(call Build/DefaultTargets,$(1))) + $(if $(PKG_HOST_ONLY),,$(call Build/DefaultTargets,$(1))) endef define pkg_install_files @@ -286,7 +290,7 @@ prepare-package-install: $(PACKAGE_DIR): mkdir -p $@ - + dumpinfo: download: prepare: |