diff --git a/Makefile b/Makefile index c2cc5d84..f5de498a 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,11 @@ ifndef CPU MFLAGS:=CPU=$(CPU) endif +ifndef O + O=-O2 + MFLAGS:=0=$(O) +endif + ifndef SYSROOT SYSROOT:=$(shell pwd)/sysroot MFLAGS:=SYSROOT=$(SYSROOT) diff --git a/sortix/Makefile b/sortix/Makefile index 893e3340..e2d5609c 100644 --- a/sortix/Makefile +++ b/sortix/Makefile @@ -1,3 +1,7 @@ +ifndef O + O:=-O3 +endif + ifndef CPU CPU=x86 endif @@ -44,7 +48,10 @@ ifeq ($(JSSORTIX),1) DEFINES:=$(DEFINES) -DPLATFORM_SERIAL -DJSSORTIX BUILDID:=$(BUILDID)-js endif -CPPFLAGSRELEASE=-s -O3 +ifeq ($(PANIC_SHORT),1) + DEFINES:=$(DEFINES) -DPANIC_SHORT +endif +CPPFLAGSRELEASE=-s $(O) CPPFLAGSDEBUG= CPPFLAGS=-I.. -I. $(CPUDEFINES) $(CPUFLAGS) -std=gnu++0x -Wall -Wextra -nostdlib -fno-builtin -nostartfiles -nodefaultlibs -fno-exceptions -fno-rtti -fno-stack-protector $(DEFINES) $(CPPFLAGSRELEASE) OBJS=$(CPUOBJS) \ diff --git a/sortix/panic.cpp b/sortix/panic.cpp index ecb5ff95..ccf6b6d6 100644 --- a/sortix/panic.cpp +++ b/sortix/panic.cpp @@ -32,7 +32,7 @@ using namespace Maxsi; namespace Sortix { -#if defined(DEBUG) || defined(PANIC_LONG) +#if defined(DEBUG) || defined(PANIC_SHORT) bool longpanic = false; #else bool longpanic = true;