-all: compile
-
-include $(TMP_DIR)/.pkgdeps
-
-PREREQ_PACKAGES:=$(patsubst %,%-prereq,$(prereq-y) $(prereq-m))
-DOWNLOAD_PACKAGES:=$(patsubst %,%-download,$(package-y) $(package-m))
-COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
-INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
-
-$(STAMP_DIR) $(TARGET_DIR):
- mkdir -p $@
-
-%-prereq: $(STAMP_DIR) $(TARGET_DIR)
- $(MAKE) -C $(patsubst %-prereq,%,$@) prereq
-
-%-download: FORCE
- $(MAKE) -C $(patsubst %-download,%,$@) download
-
-%-prepare: $(TARGET_DIR) FORCE
- $(MAKE) -C $(patsubst %-prepare,%,$@) prepare
-
-%-compile: %-prepare
- $(MAKE) -C $(patsubst %-compile,%,$@) compile
-
-%-install:
- $(MAKE) -C $(patsubst %-install,%,$@) install
-
-%-clean: FORCE
- $(MAKE) -C $(patsubst %-clean,%,$@) clean
+-include $(TMP_DIR)/.packagedeps
+$(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
+ifeq ($(SDK),1)
+ $(curdir)/builddirs-install:=.
+else
+ $(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
+ $(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
+ $(curdir)/builddirs-install:=. $(sort $(package-y))
+endif