2823a4c8 |
1 | # gpSP makefile |
2 | # Gilead Kutnick - Exophase |
3 | # GP2X port(ion) - Z |
4 | |
5 | # Global definitions |
6 | |
8b6232a6 |
7 | PREFIX ?= /opt/open2x/gcc-4.1.1-glibc-2.3.6 |
2823a4c8 |
8 | CC = $(PREFIX)/bin/arm-open2x-linux-gcc |
9 | STRIP = $(PREFIX)/bin/arm-open2x-linux-strip |
10 | |
11 | OBJS = main.o cpu.o memory.u video.o input.o sound.o gp2x.o gui.o \ |
4742480d |
12 | cheats.o zip.o cpu_threaded.z arm_stub.o video_blend.o \ |
c872443f |
13 | warm.o upscale_aspect.o |
14 | ifeq ($(WIZ),1) |
e8f5db5d |
15 | OBJS += pollux_dpc_set.o |
c872443f |
16 | BIN = gpsp_wiz |
17 | else |
18 | BIN = gpsp_gp2x |
19 | endif |
2823a4c8 |
20 | |
8b6232a6 |
21 | -include Makefile.local |
22 | |
2823a4c8 |
23 | # Platform specific definitions |
24 | |
d5e0983c |
25 | VPATH += .. ../arm |
2823a4c8 |
26 | CFLAGS += -DARM_ARCH -DGP2X_BUILD |
4742480d |
27 | ifeq ($(WIZ),1) |
28 | CFLAGS += -DWIZ_BUILD |
29 | endif |
2823a4c8 |
30 | # NOTE: -funroll-loops will slow down compiling considerably |
31 | CFLAGS += -O3 -std=c99 -msoft-float -funsigned-char -fno-common \ |
bbba3209 |
32 | -fno-builtin -Wall \ |
2823a4c8 |
33 | |
5da9148d |
34 | INCLUDES = `$(PREFIX)/bin/sdl-config --cflags` -I$(PREFIX)/include |
35 | LIBS = `$(PREFIX)/bin/sdl-config --libs` \ |
4742480d |
36 | -lm -ldl -lpthread -lz |
37 | ifneq ($(WIZ),1) |
4742480d |
38 | LIBS += -static |
39 | endif |
40 | |
2823a4c8 |
41 | # Compilation: |
42 | |
43 | .SUFFIXES: .c |
44 | |
bbba3209 |
45 | all: $(BIN) |
46 | |
47 | cpu.o cpu_threaded.z: CFLAGS += -Wno-unused-variable -Wno-unused-label |
48 | |
2823a4c8 |
49 | %.z: %.c |
50 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
51 | |
52 | %.u: %.c |
53 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
54 | |
55 | %.o: %.c |
56 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
57 | |
58 | %.o: %.S |
59 | $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $< |
60 | |
788343bb |
61 | %.o: %.s |
62 | $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $< |
63 | |
bbba3209 |
64 | $(BIN): $(OBJS) |
c872443f |
65 | $(CC) $(OBJS) $(LIBS) -o $(BIN) |
cd4e2bda |
66 | $(STRIP) $(BIN) |
2823a4c8 |
67 | |
68 | clean: |
69 | rm -f *.o *.u *.z $(BIN) |
70 | |