build: introduce extra targets that contain only proper dependencies
This can be used to check if targets like prepare or compile are up to date Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
6cf067d084
commit
9228d1c066
5 changed files with 23 additions and 15 deletions
|
@ -20,6 +20,7 @@ define rdep
|
||||||
.SILENT: $(2)_check
|
.SILENT: $(2)_check
|
||||||
|
|
||||||
$(2): $(2)_check
|
$(2): $(2)_check
|
||||||
|
check-depends: $(2)_check
|
||||||
|
|
||||||
ifneq ($(wildcard $(2)),)
|
ifneq ($(wildcard $(2)),)
|
||||||
$(2)_check::
|
$(2)_check::
|
||||||
|
@ -46,3 +47,8 @@ endif
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
ifeq ($(filter .%,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),$(MAKECMDGOALS),x))
|
||||||
|
define rdep
|
||||||
|
$(2): $(2)_check
|
||||||
|
endef
|
||||||
|
endif
|
||||||
|
|
|
@ -175,10 +175,10 @@ ifndef DUMP
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
host-prepare: $(HOST_STAMP_PREPARED)
|
.host-prepare: $(HOST_STAMP_PREPARED)
|
||||||
host-configure: $(HOST_STAMP_CONFIGURED)
|
.host-configure: $(HOST_STAMP_CONFIGURED)
|
||||||
host-compile: $(HOST_STAMP_BUILT) $(if $(STAMP_BUILT),$(HOST_STAMP_INSTALLED))
|
.host-compile: $(HOST_STAMP_BUILT) $(if $(STAMP_BUILT),$(HOST_STAMP_INSTALLED))
|
||||||
host-install: $(HOST_STAMP_INSTALLED)
|
.host-install: $(HOST_STAMP_INSTALLED)
|
||||||
host-clean: FORCE
|
host-clean: FORCE
|
||||||
$(call Host/Clean)
|
$(call Host/Clean)
|
||||||
$(call Host/Uninstall)
|
$(call Host/Uninstall)
|
||||||
|
|
|
@ -106,9 +106,9 @@ ifeq ($(DUMP),)
|
||||||
ifdef do_install
|
ifdef do_install
|
||||||
ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
|
ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
|
||||||
IPKGS += $(1)
|
IPKGS += $(1)
|
||||||
compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
|
.compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
|
||||||
ifneq ($(ABI_VERSION),)
|
ifneq ($(ABI_VERSION),)
|
||||||
compile: $(PKG_INFO_DIR)/$(1).version
|
.compile: $(PKG_INFO_DIR)/$(1).version
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
$(if $(CONFIG_PACKAGE_$(1)),$$(info WARNING: skipping $(1) -- package not selected))
|
$(if $(CONFIG_PACKAGE_$(1)),$$(info WARNING: skipping $(1) -- package not selected))
|
||||||
|
|
|
@ -204,13 +204,13 @@ define Build/CoreTargets
|
||||||
touch $$@
|
touch $$@
|
||||||
|
|
||||||
ifdef Build/InstallDev
|
ifdef Build/InstallDev
|
||||||
compile: $(STAMP_INSTALLED)
|
.compile: $(STAMP_INSTALLED)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
prepare: $(STAMP_PREPARED)
|
.prepare: $(STAMP_PREPARED)
|
||||||
configure: $(STAMP_CONFIGURED)
|
.configure: $(STAMP_CONFIGURED)
|
||||||
dist: $(STAMP_CONFIGURED)
|
.dist: $(STAMP_CONFIGURED)
|
||||||
distcheck: $(STAMP_CONFIGURED)
|
.distcheck: $(STAMP_CONFIGURED)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/DefaultTargets
|
define Build/DefaultTargets
|
||||||
|
@ -289,6 +289,7 @@ $(PACKAGE_DIR):
|
||||||
mkdir -p $@
|
mkdir -p $@
|
||||||
|
|
||||||
compile: prepare-package-install
|
compile: prepare-package-install
|
||||||
|
.install: .compile
|
||||||
install: compile
|
install: compile
|
||||||
|
|
||||||
clean: FORCE
|
clean: FORCE
|
||||||
|
|
9
rules.mk
9
rules.mk
|
@ -101,12 +101,13 @@ ifdef CONFIG_MIPS64_ABI
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DEFAULT_SUBDIR_TARGETS:=clean download prepare compile install update refresh prereq dist distcheck configure check
|
DEFAULT_SUBDIR_TARGETS:=clean download prepare compile install update refresh prereq dist distcheck configure check check-depends
|
||||||
|
|
||||||
define DefaultTargets
|
define DefaultTargets
|
||||||
$(foreach t,$(DEFAULT_SUBDIR_TARGETS),
|
$(foreach t,$(DEFAULT_SUBDIR_TARGETS) $(1),
|
||||||
$(t):
|
.$(t):
|
||||||
.PHONY: $(t)
|
$(t): .$(t)
|
||||||
|
.PHONY: $(t) .$(t)
|
||||||
)
|
)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue