X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=e520669730e1da03c41575269fffd647aaf5b6df;hb=8baf63e2eb38af5c2e661feea2935d0455193ed8;hp=d31779cc21618e283492220c4733ed516d5eed7e;hpb=ac9abd01bf28cc83187d7c2d5004716402d16e02;p=picodrive.git diff --git a/Makefile b/Makefile index d31779c..e520669 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,31 @@ TARGET ?= PicoDrive -CFLAGS += -Wall -ggdb -falign-functions=2 -CFLAGS += -I. -ifndef DEBUG -CFLAGS += -O2 -DNDEBUG -ffunction-sections -ifeq ($(findstring clang,$(CC)),) -LDFLAGS += -Wl,--gc-sections +DEBUG = 0 +CFLAGS += -Wall +CFLAGS += -I. -DINLINE=inline + +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 @@ -109,7 +120,7 @@ USE_FRONTEND = 1 PLATFORM_MP3 = 1 endif ifeq "$(PLATFORM)" "libretro" -OBJS += platform/libretro.o +OBJS += platform/libretro/libretro.o endif ifeq "$(USE_FRONTEND)" "1" @@ -152,11 +163,13 @@ else OBJS += platform/common/mp3_dummy.o endif +ifneq "$(DONT_COMPILE_IN_ZLIB)" "1" # zlib OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \ zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o # unzip OBJS += unzip/unzip.o unzip/unzip_stream.o +endif include platform/common/common.mak @@ -176,7 +189,11 @@ clean: $(RM) -r .opk_data $(TARGET): $(OBJS) +ifeq ($(STATIC_LINKING), 1) + $(AR) rcs $@ $(OBJS) +else $(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) $(LDLIBS) +endif pprof: platform/linux/pprof.c $(CC) -O2 -ggdb -DPPROF -DPPROF_TOOL -I../../ -I. $^ -o $@ @@ -187,11 +204,14 @@ 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 pico/mode4.o: CFLAGS += -fno-strict-aliasing -pico/cd/memory.o: CFLAGS += -fno-strict-aliasing +pico/cd/cd_memory.o: CFLAGS += -fno-strict-aliasing pico/cd/cd_file.o: CFLAGS += -fno-strict-aliasing pico/cd/pcm.o: CFLAGS += -fno-strict-aliasing pico/cd/LC89510.o: CFLAGS += -fno-strict-aliasing @@ -202,5 +222,5 @@ pico/carthw/svp/compiler.o : cpu/drc/emit_$(ARCH).c cpu/sh2/compiler.o : cpu/drc/emit_$(ARCH).c cpu/sh2/mame/sh2pico.o : cpu/sh2/mame/sh2.c pico/pico.o pico/cd/mcd.o pico/32x/32x.o : pico/pico_cmn.c pico/pico_int.h -pico/memory.o pico/cd/memory.o pico/32x/memory.o : pico/pico_int.h pico/memory.h +pico/memory.o pico/cd/cd_memory.o pico/32x/32x_memory.o : pico/pico_int.h pico/memory.h cpu/fame/famec.o: cpu/fame/famec.c cpu/fame/famec_opcodes.h