$(package/stamp-rootfs-prepare): $(package/stamp-install)
$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install) $(package/stamp-rootfs-prepare)
-$(BUILD_DIR)/.prepared: Makefile
- @mkdir -p $$(dirname $@)
- @touch $@
+printdb:
+ @true
prepare: $(target/stamp-compile)
rm -rf $(STAGING_DIR) $(STAGING_DIR_HOST) $(STAGING_DIR_TOOLCHAIN) $(TOOLCHAIN_DIR) $(BUILD_DIR_HOST) $(BUILD_DIR_TOOLCHAIN)
rm -rf $(TMP_DIR)
+ifndef DUMP_TARGET_DB
+$(BUILD_DIR)/.prepared: Makefile
+ @mkdir -p $$(dirname $@)
+ @touch $@
+
tmp/.prereq_packages: .config
unset ERROR; \
for package in $(sort $(prereq-y) $(prereq-m)); do \
false; \
fi
touch $@
+endif
# check prerequisites before starting to build
prereq: $(target/stamp-prereq) tmp/.prereq_packages
+$(if $(BUILD_LOG),set -o pipefail;) $$(SUBMAKE) -C $(1)/$(bd) $(target) BUILD_VARIANT="$(filter-out __default,$(variant))" $(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)/$(bd)/$(target).txt) $(if $(findstring $(bd),$($(1)/builddirs-ignore-$(target))), || $(call MESSAGE, ERROR: $(1)/$(bd) failed to build$(if $(filter-out __default,$(variant)), (build variant: $(variant))).))
)
$$(if $(call debug,$(1)/$(bd),v),,.SILENT: $(1)/$(bd)/$(target))
-
- # legacy targets
- $(call warn_eval,$(1)/$(bd),l,T,$(1)/$(bd)-$(target): $(1)/$(bd)/$(target))
- # aliases
- $(if $(call diralias,$(bd)),$(call warn_eval,$(1)/$(bd),l,T,$(1)/$(call diralias,$(bd))/$(target): $(1)/$(bd)/$(target)))
+ $(if $(DUMP_TARGET_DB),,
+ # legacy targets
+ $(call warn_eval,$(1)/$(bd),l,T,$(1)/$(bd)-$(target): $(1)/$(bd)/$(target))
+ # aliases
+ $(if $(call diralias,$(bd)),$(call warn_eval,$(1)/$(bd),l,T,$(1)/$(call diralias,$(bd))/$(target): $(1)/$(bd)/$(target)))
+ )
)
)
$(foreach target,$(SUBTARGETS),$(call subtarget,$(1),$(target)))
endef
+ifndef DUMP_TARGET_DB
# Parameters: <subdir> <name> <target> <depends> <config options> <stampfile location>
define stampfile
$(1)/stamp-$(3):=$(if $(6),$(6),$(STAGING_DIR))/stamp/.$(2)_$(3)$(if $(5),_$(call confvar,$(5)))
@rm -f $$($(1)/stamp-$(3))
endef
+endif
}
touch $@
+printdb: FORCE
+ @$(_SINGLE)$(NO_TRACE_MAKE) -p $@ V=99 DUMP_TARGET_DB=1 2>&1
+
download: .config FORCE
@+$(SUBMAKE) tools/download
@+$(SUBMAKE) toolchain/download
next unless $cmds;
print <<EOF
+ifndef DUMP_TARGET_DB
\$(TARGET_DIR)/etc/uci-defaults/$preconfig: FORCE
( \\
$cmds \\
ifneq (\$(IMAGEOPT)\$(CONFIG_IMAGEOPT),)
package/preconfig: \$(TARGET_DIR)/etc/uci-defaults/$preconfig
endif
+endif
+
EOF
}
}
$(curdir)/gcc/minimal/compile += $(curdir)/llvm/install
endif
+ifndef DUMP_TARGET_DB
ifneq ($(ARCH),)
$(TOOLCHAIN_DIR)/info.mk: .config
@for dir in $(TOOLCHAIN_DIR); do ( \
@grep GCC_VERSION $@ >/dev/null 2>&1 || $(INSTALL_DATA) $(TOPDIR)/toolchain/info.mk $@
@touch $@
endif
+endif
# prerequisites for the individual targets
$(curdir)/ := .config prereq
$(curdir)//compile = $(1)/prepare
$(curdir)//install = $(1)/compile
+ifndef DUMP_TARGET_DB
$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed:
+endif
$(eval $(call stampfile,$(curdir),toolchain,install,$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed,,$(TOOLCHAIN_DIR)))
$(eval $(call subdir,$(curdir)))
$(curdir)/builddirs := $(tools-y) $(tools-dep) $(tools-)
$(curdir)/builddirs-default := $(tools-y)
+ifndef DUMP_TARGET_DB
define PrepareStaging
@for dir in $(1); do ( \
set -x; \
}; ln -s "$$$$FILE" "$$@"
endef
+endif
$(eval $(call PrepareCommand,find,gfind find))
$(eval $(call PrepareCommand,md5sum,md5sum $(SCRIPT_DIR)/md5sum))