summaryrefslogtreecommitdiff
path: root/src/Makefile.last
blob: 9249d222c8f3dd7f773140a546ea137950ba70ec (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
89
90
91
92
93
94
95
96
97
98
99
MNAME = wiz
COPT = -mcpu=arm926ej-s -mtune=arm926ej-s -g -D__WIZ__
COPT += -O3
COPT += -ffast-math -msoft-float
COPT += -finline -finline-functions -fexpensive-optimizations 
COPT += -falign-functions=32 -falign-loops -falign-labels 
COPT += -falign-jumps
COPT += -fomit-frame-pointer
#COPT += -fprofile-generate
#COPT += -fprofile-use
#COPT += -pg  
ARCH = arm-open2x-linux
SDK = /opt/open2x/gcc-4.1.1-glibc-2.3.6/$(ARCH)
TOOLS = $(SDK)/bin
GCC = $(TOOLS)/$(ARCH)-gcc
STRIP = $(TOOLS)/$(ARCH)-strip
ADSASM = $(TOOLS)/$(ARCH)-as
COPT += -I$(SDK)/include
COPT += -L$(SDK)/lib
#
# SNES stuff (c-based)
#
OBJS = memcpy.o 
#OBJS += touchscreen.o
OBJS += apu.o apuaux.o c4.o c4emu.o cheats.o cheats2.o clip.o   data.o 
OBJS += dsp1.o fxemu.o fxinst.o globals.o loadzip.o  ppu.o 
OBJS += dma.o memmap.o
OBJS += cpu.o cpuexec.o
OBJS += cpuops.o 
OBJS += sa1.o sa1cpu.o 
OBJS += sdd1.o sdd1emu.o snapshot.o soundux.o spc700.o spc700a.o srtc.o
OBJS += spc_decode.o 
OBJS += tile16.o tile16add.o tile16add1_2.o tile16fadd1_2.o tile16sub.o tile16sub1_2.o tile16fsub1_2.o 
OBJS += mode7new.o mode7.o mode7add.o mode7add1_2.o mode7sub.o mode7sub1_2.o
OBJS += mode7prio.o mode7addprio.o mode7add1_2prio.o mode7subprio.o mode7sub1_2prio.o
OBJS += gfx16.o 
OBJS += os9x_65c816_global.o os9x_65c816_spcasm.o os9x_65c816_spcc.o os9x_asm_cpu.o
OBJS += usbjoy.o 
#
# and some asm from LJP...
#
OBJS += m3d_func.o
#
# Dave's minimal SDK
#
OBJS += loadlast.o wiz_sdk.o warm.o menu.o input.o gp2x_menutile.o gp2x_highlightbar.o \
	gp2x_menu_header.o unzip.o ioapi.o squidgehack.o zip.o asm_util.o pollux_set.o

OBJS += disk_img.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 = -lpthread -lz $(LIBS)

all: vfast 
clean: tidy all

first: 
	mkdir -p $(MNAME)_$(VNAME)_obj

$(OBJS): first

pocketsnesd.gpe: $(OBJS) 
	$(GCC) $(COPT) $(addprefix $(MNAME)_$(VNAME)_obj/,$(OBJS)) $(PRELIBS) -o pocketsnesd_$(MNAME)_$(VNAME).gpe -lstdc++ -lm

pocketsnes.gpe: pocketsnesd.gpe
	$(STRIP) pocketsnesd_$(MNAME)_$(VNAME).gpe -o pocketsnes_$(MNAME)_$(VNAME).gpe
	
tidy:
	rm $(OBJDIR)/*.o

# -- Fast version
vfast: VNAME = fast
vfast: COPT += -DASMCPU
vfast: OBJDIR = $(MNAME)_$(VNAME)_obj 
vfast: pocketsnes.gpe

# -- Normal version 
vnormal: VNAME = normal
vnormal: COPT += -DUSE_SA1 
vnormal: ODIR = $(MNAME)_$(VNAME)_obj 
vnormal: pocketsnes.gpe

# -- Compilation rules
%.o: %.cpp 
	$(GCC) $(COPT) -c $< -o $(MNAME)_$(VNAME)_obj/$@

%.o: %.c
	$(GCC) $(COPT) -c $< -o $(MNAME)_$(VNAME)_obj/$@

%.o: %.s
	$(GCC) $(COPT) -c $< -o $(MNAME)_$(VNAME)_obj/$@

%.o: %.S
	$(GCC) $(COPT) -c $< -o $(MNAME)_$(VNAME)_obj/$@