diff --git a/Makefile b/Makefile index 72a3a66..fa5360d 100644 --- a/Makefile +++ b/Makefile @@ -28,15 +28,16 @@ INCLUDES := src src/ext/inih src/lang common #------------------------------------------------------------------------------- # options for code generation #------------------------------------------------------------------------------- -CFLAGS := -Wall -O2 -ffunction-sections\ - $(MACHDEP) +OPT := -Os -fno-exceptions -fno-asynchronous-unwind-tables +CFLAGS := -Wall -ffunction-sections -fdata-sections \ + $(MACHDEP) $(OPT) CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ CXXFLAGS := $(CFLAGS) -std=c++20 ASFLAGS := -g $(ARCH) -LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections -T$(WUMS_ROOT)/share/libkernel.ld $(WUMSSPECS) +LDFLAGS = -g $(ARCH) $(OPT) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections -T$(WUMS_ROOT)/share/libkernel.ld $(WUMSSPECS) ifeq ($(DEBUG),1) CXXFLAGS += -DDEBUG -g diff --git a/plugin/Makefile b/plugin/Makefile index fee7a0b..dfcda53 100644 --- a/plugin/Makefile +++ b/plugin/Makefile @@ -29,8 +29,9 @@ INCLUDES := src ../src/lang ../common #------------------------------------------------------------------------------- # options for code generation #------------------------------------------------------------------------------- -CFLAGS := -Wall -O2 -ffunction-sections -fdata-sections \ - $(MACHDEP) +OPT := -Os -fno-exceptions -fno-asynchronous-unwind-tables +CFLAGS := -Wall -ffunction-sections -fdata-sections \ + $(MACHDEP) $(OPT) CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ -D__WUPS__ @@ -41,7 +42,7 @@ endif CXXFLAGS := $(CFLAGS) -std=c++20 ASFLAGS := -g $(ARCH) -LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections +LDFLAGS = -g $(ARCH) $(OPT) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections -Wl,--discard-all LDFLAGS += $(WUPSSPECS)