2 CFLAGS += -Wall -ggdb -falign-functions=2
14 all: config.mak target_
17 ifneq ($(wildcard config.mak),)
18 config.mak: ./configure
19 @echo $@ is out-of-date, running configure
20 @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
24 @echo "Please run ./configure before running make!"
51 -include Makefile.local
53 ifneq "$(use_cyclone)" "1"
54 # due to CPU stop flag access
60 ifeq "$(PLATFORM)" "generic"
61 OBJS += platform/linux/emu.o platform/linux/blit.o # FIXME
62 OBJS += platform/common/plat_sdl.o
63 OBJS += platform/libpicofe/plat_sdl.o platform/libpicofe/in_sdl.o
64 OBJS += platform/libpicofe/plat_dummy.o
67 ifeq "$(PLATFORM)" "pandora"
68 platform/common/menu_pico.o: CFLAGS += -DPANDORA
69 OBJS += platform/pandora/plat.o
70 OBJS += platform/pandora/asm_utils.o
71 OBJS += platform/common/arm_utils.o
72 OBJS += platform/libpicofe/linux/fbdev.o
73 OBJS += platform/libpicofe/linux/xenv.o
74 OBJS += platform/libpicofe/pandora/plat.o
77 ifeq "$(PLATFORM)" "libretro"
78 OBJS += platform/libretro.o
81 ifeq "$(USE_FRONTEND)" "1"
84 OBJS += platform/common/main.o platform/common/emu.o \
85 platform/common/menu_pico.o platform/common/config_file.o
88 OBJS += platform/libpicofe/input.o platform/libpicofe/readpng.o \
89 platform/libpicofe/fonts.o platform/libpicofe/linux/in_evdev.o \
90 platform/libpicofe/linux/plat.o
93 OBJS += platform/libpicofe/sndout.o
94 ifneq ($(findstring oss,$(SOUND_DRIVERS)),)
95 platform/libpicofe/sndout.o: CFLAGS += -DHAVE_OSS
96 OBJS += platform/libpicofe/linux/sndout_oss.o
98 ifneq ($(findstring alsa,$(SOUND_DRIVERS)),)
99 platform/libpicofe/sndout.o: CFLAGS += -DHAVE_ALSA
100 OBJS += platform/libpicofe/linux/sndout_alsa.o
102 ifneq ($(findstring sdl,$(SOUND_DRIVERS)),)
103 platform/libpicofe/sndout.o: CFLAGS += -DHAVE_SDL
104 OBJS += platform/libpicofe/sndout_sdl.o
108 OBJS += platform/libpicofe/arm_linux.o
113 OBJS += platform/common/mp3.o
114 ifeq "$(HAVE_LIBAVCODEC)" "1"
115 OBJS += platform/common/mp3_libavcodec.o
117 OBJS += platform/common/mp3_dummy.o
121 OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
122 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
124 OBJS += unzip/unzip.o unzip/unzip_stream.o
127 include platform/common/common.mak
129 OBJS += $(OBJS_COMMON)
130 CFLAGS += $(addprefix -D,$(DEFINES))
132 ifneq ($(findstring gcc,$(CC)),)
133 LDFLAGS += -Wl,-Map=$(TARGET).map
140 $(RM) $(TARGET) $(OBJS)
143 $(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) $(LDLIBS)
145 pprof: platform/linux/pprof.c
146 $(CC) -O2 -ggdb -DPPROF -DPPROF_TOOL -I../../ -I. $^ -o $@
148 tools/textfilter: tools/textfilter.c
149 make -C tools/ textfilter
152 $(CC) $(CFLAGS) -c $< -o $@
154 # special flags - perhaps fix this someday instead?
155 pico/draw.o: CFLAGS += -fno-strict-aliasing
156 pico/draw2.o: CFLAGS += -fno-strict-aliasing
157 pico/mode4.o: CFLAGS += -fno-strict-aliasing
158 pico/cd/memory.o: CFLAGS += -fno-strict-aliasing
159 pico/cd/cd_file.o: CFLAGS += -fno-strict-aliasing
160 pico/cd/pcm.o: CFLAGS += -fno-strict-aliasing
161 pico/cd/LC89510.o: CFLAGS += -fno-strict-aliasing
162 pico/cd/gfx_cd.o: CFLAGS += -fno-strict-aliasing
165 pico/carthw/svp/compiler.o : cpu/drc/emit_$(ARCH).c
166 cpu/sh2/compiler.o : cpu/drc/emit_$(ARCH).c
167 cpu/sh2/mame/sh2pico.o : cpu/sh2/mame/sh2.c
168 pico/pico.o pico/cd/pico.o pico/32x/32x.o : pico/pico_cmn.c pico/pico_int.h
169 pico/memory.o pico/cd/memory.o : pico/pico_int.h pico/memory.h
170 cpu/fame/famec.o: cpu/fame/famec.c cpu/fame/famec_opcodes.h
172 # ----------- release -----------
174 VER ?= $(shell head -n 1 platform/common/version.h | \
175 sed 's/.*"\(.*\)\.\(.*\)".*/\1\2/g')
177 ifeq "$(PLATFORM)" "pandora"
179 PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
181 /tmp/readme.txt: tools/textfilter platform/base_readme.txt
182 tools/textfilter platform/base_readme.txt $@ PANDORA
184 /tmp/PicoDrive.pxml: platform/pandora/PicoDrive.pxml.template
185 platform/pandora/make_pxml.sh $^ $@
187 rel: PicoDrive platform/pandora/PicoDrive.run platform/pandora/picorestore \
188 pico/carthw.cfg /tmp/readme.txt platform/pandora/skin \
189 platform/pandora/PicoDrive.png platform/pandora/PicoDrive_p.png \
194 $(PND_MAKE) -p PicoDrive_$(VER).pnd -d out -x out/PicoDrive.pxml -i out/PicoDrive.png -c