summaryrefslogtreecommitdiff
path: root/src/Makefile_giz
blob: f20d02c8a0097d9a04d5873ed4e0da1b3797033e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#COPT = -static -g -I. -I C:/devkitGP2X/include -IC:/devkitGP2X/sysroot/usr/include -O3 -D__GP2X__

SDK_BASE = C:/cygwin/usr/local/arm-wince-pe/lib/KGSDK
ZLIB_BASE = C:/cygwin/usr/local/arm-wince-pe/lib/zlib

#COPT = -IC:/cygwin/usr/local/arm-wince-pe/include -I$(SDK_BASE)/include -static -g -I. -O3 -mtune=arm920t -ftracer -fstrength-reduce -Wno-unused -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math -D__GP2X__
COPT = -IC:/cygwin/usr/local/arm-wince-pe/include -I$(SDK_BASE)/include -I$(ZLIB_BASE)/include -I . -mcpu=arm920 \
		-mtune=arm920t -O2 -msoft-float -ffast-math -fstrict-aliasing -mstructure-size-boundary=8 \
		-fexpensive-optimizations -fweb -frename-registers -fomit-frame-pointer -falign-functions -finline -finline-functions \
		-fno-builtin -fno-common -D__GIZ__
GCC = arm-wince-pe-gcc
STRIP = arm-wince-pe-strip
ADSASM = armasm

#
# SNES stuff (c-based)
#
OBJS = 2xsaiwin.o apu.o c4.o c4emu.o cheats.o cheats2.o clip.o cpu.o cpuexec.o data.o 
OBJS += dma.o dsp1.o fxemu.o fxinst.o gfx.o globals.o loadzip.o memmap.o ppu.o  
OBJS += sdd1.o snapshot.o soundux.o spc700.o srtc.o tile.o 
#
# ASM CPU Core, ripped from Yoyo's OpenSnes9X
#
OBJS += os9x_asm_cpu.o os9x_65c816.o spc700a.o
#osnes9xgp_asmfunc.o 
#RenderASM/render8.o
#
# and some asm from LJP...
#
OBJS += m3d_func.o spc_decode.o
#
# 
#
OBJS += giz_kgsdk.o menu.o input.o gp2x_menutile.o gp2x_highlightbar.o \
			gp2x_menu_header.o unzip.o ioapi.o giz_kgsdkasm.o

#
# and the glue code that sticks it all together :)
#
OBJS += main.o

# Inopia's menu system, hacked for the GP2X under rlyeh's sdk
PRELIBS = -LC:/cygwin/usr/local/arm-wince-pe/lib -L$(ZLIB_BASE) -lzip -L$(SDK_BASE) -lKGSDK $(LIBS) 

all: squidgesnes.gpe
clean: tidy squidgesnes.gpe

.c.o:
	$(GCC) $(COPT) -c $< -o $@

.cpp.o:
	$(GCC) $(COPT) -c $< -o $@

# make seems to lowercase the extensions, so files with '.S' end up being passed to the compiler as '.s', which means thousands of errors.
# this is a small workaround. 

myuname.o: myuname.S
	$(GCC) $(COPT) -c $< -o $@
	
os9x_65c816.o: os9x_65c816.s
	$(GCC) $(COPT) -c $< -o $@

osnes9xgp_asmfunc.o: osnes9xgp_asmfunc.S
	$(GCC) $(COPT) -c $< -o $@

m3d_func.o: m3d_func.S
	$(GCC) $(COPT) -c $< -o $@

spc_decode.o: spc_decode.s
	$(GCC) $(COPT) -c $< -o $@

spc700a.o: spc700a.s
	$(GCC) $(COPT) -c $< -o $@

giz_kgsdkasm.o: giz_kgsdkasm.s
	$(GCC) $(COPT) -c $< -o $@

RenderASM/render8.o: RenderASM/render8.S
	$(GCC) $(COPT) -c $< -o $@

squidgesnesd.gpe: $(OBJS)
	$(GCC) $(COPT) $(OBJS) -static $(PRELIBS) -o $@ -lstdc++ -lm

squidgesnes.gpe: squidgesnesd.gpe
	$(STRIP) squidgesnesd.gpe -o squidgesnes.gpe
	cp squidgesnes.gpe autorun.exe
tidy:
	del *.o