2823a4c8 |
1 | # gpSP makefile |
2 | # Gilead Kutnick - Exophase |
3 | # GP2X port(ion) - Z |
4 | |
5 | # Global definitions |
6 | |
108c704a |
7 | CC = $(CROSS_COMPILE)gcc |
2823a4c8 |
8 | |
9 | OBJS = main.o cpu.o memory.u video.o input.o sound.o gp2x.o gui.o \ |
4742480d |
10 | cheats.o zip.o cpu_threaded.z arm_stub.o video_blend.o \ |
c872443f |
11 | warm.o upscale_aspect.o |
12 | ifeq ($(WIZ),1) |
108c704a |
13 | POLLUX = 1 |
e8f5db5d |
14 | OBJS += pollux_dpc_set.o |
c872443f |
15 | BIN = gpsp_wiz |
108c704a |
16 | endif |
17 | ifeq ($(CAANOO),1) |
18 | POLLUX = 1 |
19 | OBJS += pollux_dpc_set.o |
20 | BIN = gpsp_caanoo |
21 | endif |
22 | ifeq ($(BIN),) |
c872443f |
23 | BIN = gpsp_gp2x |
24 | endif |
2823a4c8 |
25 | |
8b6232a6 |
26 | -include Makefile.local |
27 | |
2823a4c8 |
28 | # Platform specific definitions |
29 | |
d5e0983c |
30 | VPATH += .. ../arm |
2823a4c8 |
31 | CFLAGS += -DARM_ARCH -DGP2X_BUILD |
4742480d |
32 | ifeq ($(WIZ),1) |
33 | CFLAGS += -DWIZ_BUILD |
34 | endif |
108c704a |
35 | ifeq ($(POLLUX),1) |
36 | CFLAGS += -DPOLLUX_BUILD |
37 | endif |
38 | CFLAGS += -std=c99 -msoft-float -funsigned-char -Wall -ggdb |
39 | ifndef DEBUG |
40 | CFLAGS += -O2 |
41 | endif |
2823a4c8 |
42 | |
108c704a |
43 | INCLUDES = `sdl-config --cflags` |
44 | LIBS = `sdl-config --libs` \ |
4742480d |
45 | -lm -ldl -lpthread -lz |
108c704a |
46 | ifeq ($(WIZ)$(CAANOO),) |
4742480d |
47 | LIBS += -static |
48 | endif |
49 | |
2823a4c8 |
50 | # Compilation: |
51 | |
52 | .SUFFIXES: .c |
53 | |
bbba3209 |
54 | all: $(BIN) |
55 | |
56 | cpu.o cpu_threaded.z: CFLAGS += -Wno-unused-variable -Wno-unused-label |
57 | |
2823a4c8 |
58 | %.z: %.c |
59 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
60 | |
61 | %.u: %.c |
62 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
63 | |
64 | %.o: %.c |
65 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
66 | |
67 | %.o: %.S |
68 | $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $< |
69 | |
788343bb |
70 | %.o: %.s |
71 | $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $< |
72 | |
bbba3209 |
73 | $(BIN): $(OBJS) |
c872443f |
74 | $(CC) $(OBJS) $(LIBS) -o $(BIN) |
2823a4c8 |
75 | |
76 | clean: |
77 | rm -f *.o *.u *.z $(BIN) |
78 | |
6a298de4 |
79 | rel: gpsp_caanoo gpsp_caanoo.ini gpsp_caanoo.gpe warm_2.6.24.ko \ |
80 | ../COPYING.DOC ../readme.txt readme_gp2x.txt ../game_config.txt |
81 | rm -rf out |
82 | mkdir -p out/gpsp_caanoo |
83 | cp $^ out/gpsp_caanoo/ |
84 | mv out/gpsp_caanoo/gpsp_caanoo.ini out/ |
85 | mv out/gpsp_caanoo/readme_gp2x.txt out/gpsp_caanoo/readme_caanoo.txt |
86 | echo -n '/mnt/sd' > out/gpsp_caanoo/romdir.txt |
87 | cd out && zip -9 -r ../gpsp_caanoo.zip * |