-REV:=$(shell LANG=C svn info | awk '/^Revision:/ { print$$2 }' )
-ifneq ($(REV),)
-OPENWRTVERSION:=$(OPENWRTVERSION)/r$(REV)
-endif
-endif
-export OPENWRTVERSION
-
-all: world
-
-.pkginfo: FORCE
-ifneq ($(shell ./scripts/timestamp.pl -p .pkginfo package Makefile),.pkginfo)
- @echo Collecting package info...
- @-for dir in package/*/; do \
- echo Source-Makefile: $${dir}Makefile; \
- $(MAKE) --no-print-dir DUMP=1 -C $$dir 2>&- || true; \
- done > $@
+ include rules.mk
+ include $(INCLUDE_DIR)/depends.mk
+ include $(INCLUDE_DIR)/subdir.mk
+ include target/Makefile
+ include package/Makefile
+ include tools/Makefile
+ include toolchain/Makefile
+
+$(toolchain/stamp-install): $(tools/stamp-install)
+$(target/stamp-compile): $(toolchain/stamp-install) $(tools/stamp-install) $(BUILD_DIR)/.prepared
+$(package/stamp-cleanup): $(target/stamp-compile)
+$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
+$(package/stamp-install): $(package/stamp-compile)
+$(package/stamp-rootfs-prepare): $(package/stamp-install)
+$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install) $(package/stamp-rootfs-prepare)
+
+printdb:
+ @true
+
+prepare: $(target/stamp-compile)
+
+clean: FORCE
+ $(_SINGLE)$(SUBMAKE) target/linux/clean
+ rm -rf $(BUILD_DIR) $(BIN_DIR) $(BUILD_LOG_DIR)
+
+dirclean: clean
+ 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 \
+ $(_SINGLE)$(NO_TRACE_MAKE) -s -r -C package/$$package prereq || ERROR=1; \
+ done; \
+ if [ -n "$$ERROR" ]; then \
+ echo "Package prerequisite check failed."; \
+ false; \
+ fi
+ touch $@