-TOOL_HOST_INCLUDES:=$(patsubst ./include/%.h,$(STAGING_DIR)/include-host/%.h,$(wildcard ./include/*.h))
-$(TOOL_HOST_INCLUDES): $(STAGING_DIR)/include-host/%.h: ./include/%.h
- @mkdir -p $(STAGING_DIR)/include-host
- $(CP) $< $@
-
-$(TOOL_BUILD_DIR):
- @mkdir -p $@
-
-%-prereq %-download %-clean %-refresh %-update: FORCE
- $(MAKE) -C $* $(patsubst $*-%,%,$@)
-
-%-prepare: $(TOOL_HOST_INCLUDES) $(TOOL_BUILD_DIR) FORCE
- $(MAKE) -C $* $(patsubst $*-%,%,$@)
-
-%-compile: %-prepare FORCE
- $(MAKE) -C $* $(patsubst $*-%,%,$@)
-
-%-install: %-compile FORCE
- $(MAKE) -C $* $(patsubst $*-%,%,$@)
-
-ifeq ($(MAKECMDGOALS),install-targets)
-MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
-else
-.NOTPARALLEL:
-endif
+$(eval $(call stampfile,$(curdir),tools))
+$(eval $(call subdir,$(curdir)))