b4137b45a8e4624fed19ac074cbe389fe546dbda
[drnoksnes] / Makefile
1
2 APPNAME = DrPocketSnes
3
4 COPT = -IC:/cygwin/opt/cegcc/arm-wince-cegcc/include -I .
5 COPT += -mcpu=arm920 -mtune=arm920t -O3 -ffast-math -fexpensive-optimizations -finline -finline-functions -msoft-float -falign-functions=32 -falign-loops -falign-labels -falign-jumps -fomit-frame-pointer
6 COPT += -D__GIZ__
7
8 GCC = gcc
9 STRIP = strip
10
11 #
12 # SNES stuff (c-based)
13 # memset.o memcpy.o 
14 OBJS = 2xsaiwin.o apu.o c4.o c4emu.o cheats.o cheats2.o clip.o cpu.o cpuexec.o data.o 
15 OBJS += dma.o dsp1.o fxemu.o fxinst.o gfx.o globals.o loadzip.o memmap.o ppu.o  
16 OBJS += sdd1.o sdd1emu.o snapshot.o soundux.o spc700.o srtc.o tile.o
17 #
18 # ASM CPU Core, ripped from Yoyo's OpenSnes9X
19 #
20 OBJS += os9x_asm_cpu.o os9x_65c816.o spc700a.o
21 #
22 # and some asm from LJP...
23 #
24 OBJS += m3d_func.o misc.o
25
26 # Dave's minimal SDK
27 #
28 OBJS += giz_sdk.o menu.o input.o gp2x_menutile.o gp2x_highlightbar.o \
29                         gp2x_menu_header.o unzip.o zip.o ioapi.o giz_kgsdkasm.o
30
31 #
32 # and the glue code that sticks it all together :)
33 #
34 OBJS += main.o
35
36 # Inopia's menu system, hacked for the GP2X under rlyeh's sdk
37 PRELIBS = -LC:/cygwin/opt/cegcc/arm-wince-cegcc/lib -lz -lGizSdk $(LIBS) 
38
39 all: $(APPNAME).exe
40 clean: tidy $(APPNAME).exe
41
42 .c.o:
43         $(GCC) $(COPT) -c $< -o $@
44
45 .cpp.o:
46         $(GCC) $(COPT) -c $< -o $@
47
48 # make seems to lowercase the extensions, so files with '.S' end up being passed to the compiler as '.s', which means thousands of errors.
49 # this is a small workaround. 
50
51 spc700a.o: spc700a.s
52         $(GCC) $(COPT) -c $< -o $@
53         
54 os9x_65c816.o: os9x_65c816.s
55         $(GCC) $(COPT) -c $< -o $@
56
57 osnes9xgp_asmfunc.o: osnes9xgp_asmfunc.s
58         $(GCC) $(COPT) -c $< -o $@
59
60 m3d_func.o: m3d_func.S
61         $(GCC) $(COPT) -c $< -o $@
62
63 spc_decode.o: spc_decode.s
64         $(GCC) $(COPT) -c $< -o $@
65
66 misc.o: misc.s
67         $(GCC) $(COPT) -c $< -o $@
68
69 memset.o: memset.s
70         $(GCC) $(COPT) -c $< -o $@
71         
72 memcpy.o: memcpy.s
73         $(GCC) $(COPT) -c $< -o $@
74
75 dspMixer.o: dspMixer.s
76         $(GCC) $(COPT) -c $< -o $@
77         
78 giz_kgsdkasm.o: giz_kgsdkasm.s
79         $(GCC) $(COPT) -c $< -o $@
80
81 RenderASM/render8.o: RenderASM/render8.S
82         $(GCC) $(COPT) -c $< -o $@
83
84 $(APPNAME)d.exe: $(OBJS)
85         $(GCC) $(COPT) $(OBJS) -static $(PRELIBS) -o $@ -lstdc++ -lm
86
87 $(APPNAME).exe: $(APPNAME)d.exe
88         $(STRIP) $(APPNAME)d.exe -o $(APPNAME).exe
89
90 tidy:
91         rm *.o
92         rm $(APPNAME)d.exe
93         rm $(APPNAME).exe