X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=e520669730e1da03c41575269fffd647aaf5b6df;hb=a765263b80ef38fb8e0d9ede85b938e47b7d944e;hp=d7a01dfed9a533e93600a926e8cca5148e924093;hpb=3124638fac4b5bf200cfb70ddb0cd5a7d896f144;p=picodrive.git diff --git a/Makefile b/Makefile index d7a01df..e520669 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,31 @@ TARGET ?= PicoDrive -CFLAGS += -Wall -ggdb -falign-functions=2 +DEBUG = 0 +CFLAGS += -Wall CFLAGS += -I. -DINLINE=inline -ifndef DEBUG -CFLAGS += -O2 -DNDEBUG -ffunction-sections -ifeq ($(findstring clang,$(CC)),) -LDFLAGS += -Wl,--gc-sections + +ifeq ($(DEBUG),1) + CFLAGS += -g -O0 +else + ifeq ($(platform), vita) + CFLAGS += -O3 -DNDEBUG + else + CFLAGS += -O2 -DNDEBUG -ffunction-sections + endif endif + +ifneq ($(APPLE),1) + LDFLAGS += -Wl,--gc-sections endif + #CFLAGS += -DEVT_LOG #CFLAGS += -DDRC_CMP #cpu_cmp = 1 #drc_debug = 7 #profile = 1 +ifeq ($(WANT_GDB),1) +CFLAGS += ggdb -falign-functions=2 +endif all: config.mak target_ @@ -42,7 +55,6 @@ asm_memory ?= 1 asm_render ?= 1 asm_ym2612 ?= 1 asm_misc ?= 1 -asm_cdpico ?= 1 asm_cdmemory ?= 1 asm_mix ?= 1 else # if not arm @@ -54,7 +66,6 @@ endif ifneq "$(use_cyclone)" "1" # due to CPU stop flag access -asm_cdpico = 0 asm_cdmemory = 0 endif @@ -193,6 +204,9 @@ tools/textfilter: tools/textfilter.c .s.o: $(CC) $(CFLAGS) -c $< -o $@ +.S.o: + $(CC) $(CFLAGS) -c $< -o $@ + # special flags - perhaps fix this someday instead? pico/draw.o: CFLAGS += -fno-strict-aliasing pico/draw2.o: CFLAGS += -fno-strict-aliasing