diff --git a/reactos/config b/reactos/config index 8edf2b8696f..3ae886f24c3 100644 --- a/reactos/config +++ b/reactos/config @@ -15,6 +15,11 @@ KDBG := 0 # DBG := 0 +# +# Whether to compile with optimizations +# +OPTIMIZED := 0 + # # Whether to compile a multiprocessor or single processor version # diff --git a/reactos/ntoskrnl/Makefile b/reactos/ntoskrnl/Makefile index 352d8478a74..77a819785d1 100644 --- a/reactos/ntoskrnl/Makefile +++ b/reactos/ntoskrnl/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.132 2004/07/17 05:13:05 ion Exp $ +# $Id: Makefile,v 1.133 2004/07/19 04:52:23 ion Exp $ # # ReactOS Operating System # @@ -25,6 +25,12 @@ LINKER_SCRIPT := ntoskrnl.lnk STRIP_FLAGS := -Wl,-s endif +ifeq ($(OPTIMIZED), 1) +CFLAGS_OPT := -O2 -fno-strict-aliasing +else +CFLAGS_OPT := +endif + ifeq ($(KDBG), 1) OBJECTS_KDBG := dbg/kdb.o dbg/kdb_serial.o dbg/kdb_keyboard.o dbg/rdebug.o \ dbg/i386/kdb_help.o dbg/kdb_stabs.o dbg/profile.o \ @@ -40,10 +46,10 @@ endif ifeq ($(strip $(SDK_PATH_INC)),) ASFLAGS += -I./include -CFLAGS += -I./include -D__NTOSKRNL__ $(CFLAGS_DBG) -Wall -Werror +CFLAGS += -I./include -D__NTOSKRNL__ $(CFLAGS_DBG) $(CFLAGS_OPT) -Wall -Werror else ASFLAGS += -I./include -I$(SDK_PATH_INC) -CFLAGS += -I./include -I$(SDK_PATH_INC) -D__NTOSKRNL__ $(CFLAGS_DBG) -Wall -Werror +CFLAGS += -I./include -I$(SDK_PATH_INC) -D__NTOSKRNL__ $(CFLAGS_DBG) $(CFLAGS_OPT) -Wall -Werror endif # ASFLAGS += -D__USE_W32API -D_NTOSKRNL_ diff --git a/reactos/subsys/win32k/makefile b/reactos/subsys/win32k/makefile index e5843d6434c..11bc6d48450 100644 --- a/reactos/subsys/win32k/makefile +++ b/reactos/subsys/win32k/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.101 2004/07/03 13:55:36 navaraf Exp $ +# $Id: makefile,v 1.102 2004/07/19 04:52:24 ion Exp $ PATH_TO_TOP = ../.. @@ -26,6 +26,12 @@ else CFLAGS_DBG := endif +ifeq ($(OPTIMIZED), 1) +CFLAGS_OPT := -O2 -Wno-strict-aliasing +else +CFLAGS_OPT := +endif + TARGET_CFLAGS =\ $(CFLAGS_DBG) \ -I. \ @@ -34,7 +40,8 @@ TARGET_CFLAGS =\ -DUNICODE \ -Wall -Werror \ -D__USE_W32API -D_WIN32_WINNT=0x0501 \ - -DWINVER=0x600 -D_WIN32K_ + -DWINVER=0x600 -D_WIN32K_ \ + $(CFLAGS_OPT) TARGET_LFLAGS =\ $(PATH_TO_TOP)/dk/nkm/lib/freetype.a \