- touch $(GCC_BUILD_DIR1)/.configured
-
-$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
- PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc
- touch $(GCC_BUILD_DIR1)/.compiled
-
-$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled
- PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc
-
-#############################################################
-#
-# second pass compiler build. Build the compiler targeting
-# the newly built shared uClibc library.
-#
-#############################################################
-#
-# Sigh... I had to rework things because using --with-gxx-include-dir
-# causes issues with include dir search order for g++. This seems to
-# have something to do with "path translations" and possibly doesn't
-# affect gcc-target. However, I haven't tested gcc-target yet so no
-# guarantees. mjn3
-
-GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-final
-$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(STAGING_DIR)/lib/libc.a
- mkdir -p $(GCC_BUILD_DIR2)
+endef
+define Stage1/Compile
+ export SHELL="$(BASH)"; $(MAKE) -C $(BUILD_DIR1) all-gcc
+endef
+define Stage1/Install
+ export SHELL="$(BASH)"; $(MAKE) -C $(BUILD_DIR1) install-gcc
+endef
+
+define Stage2/Configure
+ mkdir -p $(BUILD_DIR2)