Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision 68f46712429fd2645b41fba94e5e2913e9ec3be0)
+++ HelenOS.config	(revision 2c52073b51829e4d3a28d8bdf50247d3316218d0)
@@ -621,6 +621,13 @@
 ! CONFIG_STRIP_BINARIES (n/y)
 
-% Optimize for size
-! CONFIG_OPTIMIZE_FOR_SIZE (n/y)
+% Optimization level
+@ "3" Level 3 (recommended).
+@ "2" Level 2.
+@ "1" Level 1.
+@ "0" Disable optimizations.
+@ "s" Optimize for size.
+@ "g" Enable only optimizations that don't harm debugging.
+@ "fast" Level 3 + aggressive optimizations that can affect adherence to standards.
+! OPTIMIZATION (choice)
 
 % Barebone build with essential binaries only 
Index: defaults/amd64/Makefile.config
===================================================================
--- defaults/amd64/Makefile.config	(revision 68f46712429fd2645b41fba94e5e2913e9ec3be0)
+++ defaults/amd64/Makefile.config	(revision 2c52073b51829e4d3a28d8bdf50247d3316218d0)
@@ -73,2 +73,5 @@
 # GRUB boot loader architecture
 GRUB_ARCH = pc
+
+# Optimization level
+OPTIMIZATION = 3
Index: defaults/arm32/Makefile.config
===================================================================
--- defaults/arm32/Makefile.config	(revision 68f46712429fd2645b41fba94e5e2913e9ec3be0)
+++ defaults/arm32/Makefile.config	(revision 2c52073b51829e4d3a28d8bdf50247d3316218d0)
@@ -37,2 +37,5 @@
 # What is your output device?
 CONFIG_HID_OUT = generic
+
+# Optimization level
+OPTIMIZATION = 3
Index: defaults/ia32/Makefile.config
===================================================================
--- defaults/ia32/Makefile.config	(revision 68f46712429fd2645b41fba94e5e2913e9ec3be0)
+++ defaults/ia32/Makefile.config	(revision 2c52073b51829e4d3a28d8bdf50247d3316218d0)
@@ -85,2 +85,5 @@
 # GRUB boot loader architecture
 GRUB_ARCH = pc
+
+# Optimization level
+OPTIMIZATION = 3
Index: defaults/ia64/Makefile.config
===================================================================
--- defaults/ia64/Makefile.config	(revision 68f46712429fd2645b41fba94e5e2913e9ec3be0)
+++ defaults/ia64/Makefile.config	(revision 2c52073b51829e4d3a28d8bdf50247d3316218d0)
@@ -49,2 +49,5 @@
 # Output device class
 CONFIG_HID_OUT = generic
+
+# Optimization level
+OPTIMIZATION = 3
Index: defaults/mips32/Makefile.config
===================================================================
--- defaults/mips32/Makefile.config	(revision 68f46712429fd2645b41fba94e5e2913e9ec3be0)
+++ defaults/mips32/Makefile.config	(revision 2c52073b51829e4d3a28d8bdf50247d3316218d0)
@@ -46,2 +46,5 @@
 # Barebone build with essential binaries only
 CONFIG_BAREBONE = y
+
+# Optimization level
+OPTIMIZATION = 3
Index: defaults/ppc32/Makefile.config
===================================================================
--- defaults/ppc32/Makefile.config	(revision 68f46712429fd2645b41fba94e5e2913e9ec3be0)
+++ defaults/ppc32/Makefile.config	(revision 2c52073b51829e4d3a28d8bdf50247d3316218d0)
@@ -46,2 +46,5 @@
 # OHCI root hub power switch, ganged is enough
 OHCI_POWER_SWITCH = ganged
+
+# Optimization level
+OPTIMIZATION = 3
Index: defaults/sparc64/Makefile.config
===================================================================
--- defaults/sparc64/Makefile.config	(revision 68f46712429fd2645b41fba94e5e2913e9ec3be0)
+++ defaults/sparc64/Makefile.config	(revision 2c52073b51829e4d3a28d8bdf50247d3316218d0)
@@ -55,2 +55,5 @@
 # Start AP processors by the loader
 CONFIG_AP = y
+
+# Optimization level
+OPTIMIZATION = 3
Index: defaults/special/Makefile.config
===================================================================
--- defaults/special/Makefile.config	(revision 68f46712429fd2645b41fba94e5e2913e9ec3be0)
+++ defaults/special/Makefile.config	(revision 2c52073b51829e4d3a28d8bdf50247d3316218d0)
@@ -32,2 +32,4 @@
 RCU = PREEMPT_A
 
+# Optimization level
+OPTIMIZATION = 3
Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision 68f46712429fd2645b41fba94e5e2913e9ec3be0)
+++ kernel/Makefile	(revision 2c52073b51829e4d3a28d8bdf50247d3316218d0)
@@ -81,10 +81,4 @@
 INCLUDES = generic/include genarch/include arch/$(KARCH)/include ../abi/include
 INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))
-
-ifeq ($(CONFIG_OPTIMIZE_FOR_SIZE),y)
-	OPTIMIZATION = s
-else
-	OPTIMIZATION = 3
-endif
 
 DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
Index: uspace/Makefile.common
===================================================================
--- uspace/Makefile.common	(revision 68f46712429fd2645b41fba94e5e2913e9ec3be0)
+++ uspace/Makefile.common	(revision 2c52073b51829e4d3a28d8bdf50247d3316218d0)
@@ -203,10 +203,4 @@
 endif
 
-ifeq ($(CONFIG_OPTIMIZE_FOR_SIZE),y)
-	OPTIMIZATION = s
-else
-	OPTIMIZATION = 3
-endif
-
 # PCUT-based unit tests
 ifneq ($(TEST_SOURCES),)
