compiler_stage2_SplitObjs = NO
compiler_stage3_SplitObjs = NO
-ifeq "$(stage)" "1"
+# if stage is set to something other than "1" or "", disable stage 1
+ifneq "$(filter-out 1,$(stage))" ""
+compiler_stage1_NOT_NEEDED = YES
+endif
+# if stage is set to something other than "2" or "", disable stage 2
+ifneq "$(filter-out 2,$(stage))" ""
compiler_stage2_NOT_NEEDED = YES
endif
+# stage 3 has to be requested explicitly with stage=3
ifneq "$(stage)" "3"
compiler_stage3_NOT_NEEDED = YES
endif
-
$(eval $(call build-package,compiler,stage1,0))
$(eval $(call build-package,compiler,stage2,1))
$(eval $(call build-package,compiler,stage3,2))