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