Skip to content
Snippets Groups Projects
Commit 6cf067d0 authored by Felix Fietkau's avatar Felix Fietkau
Browse files

build: define common subdir targets in rules.mk


Reduce build system clutter and enable further rework

Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent c99f8815
No related branches found
No related tags found
No related merge requests found
......@@ -168,13 +168,11 @@ ifndef DUMP
touch $(HOST_STAMP_BUILT)
touch $$@
$(call DefaultTargets,$(patsubst %,host-%,$(DEFAULT_SUBDIR_TARGETS)))
ifndef STAMP_BUILT
prepare: host-prepare
compile: host-compile
install: host-install
clean: host-clean
update: host-update
refresh: host-refresh
$(foreach t,$(DEFAULT_SUBDIR_TARGETS),
$(t): host-$(t)
)
endif
host-prepare: $(HOST_STAMP_PREPARED)
......@@ -187,13 +185,6 @@ ifndef DUMP
rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_INSTALLED) $(HOST_STAMP_BUILT)
endef
download:
prepare:
compile:
install:
clean:
endif
define HostBuild
......
......@@ -143,6 +143,7 @@ Build/Exports=$(Build/Exports/Default)
define Build/CoreTargets
$(if $(QUILT),$(Build/Quilt))
$(call Build/Autoclean)
$(call DefaultTargets)
download:
$(foreach hook,$(Hooks/Download),
......@@ -287,10 +288,6 @@ prepare-package-install:
$(PACKAGE_DIR):
mkdir -p $@
dumpinfo:
download:
prepare:
configure:
compile: prepare-package-install
install: compile
......
......@@ -9,7 +9,7 @@ ifeq ($(MAKECMDGOALS),prereq)
SUBTARGETS:=prereq
PREREQ_ONLY:=1
else
SUBTARGETS:=clean download prepare compile install update refresh prereq dist distcheck configure check
SUBTARGETS:=$(DEFAULT_SUBDIR_TARGETS)
endif
subtarget-default = $(filter-out ., \
......
......@@ -101,6 +101,15 @@ ifdef CONFIG_MIPS64_ABI
endif
endif
DEFAULT_SUBDIR_TARGETS:=clean download prepare compile install update refresh prereq dist distcheck configure check
define DefaultTargets
$(foreach t,$(DEFAULT_SUBDIR_TARGETS),
$(t):
.PHONY: $(t)
)
endef
DL_DIR:=$(if $(call qstrip,$(CONFIG_DOWNLOAD_FOLDER)),$(call qstrip,$(CONFIG_DOWNLOAD_FOLDER)),$(TOPDIR)/dl)
OUTPUT_DIR:=$(if $(call qstrip,$(CONFIG_BINARY_FOLDER)),$(call qstrip,$(CONFIG_BINARY_FOLDER)),$(TOPDIR)/bin)
BIN_DIR:=$(OUTPUT_DIR)/targets/$(BOARD)/$(SUBTARGET)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment