2823a4c8 |
1 | # gpSP makefile |
2 | # Gilead Kutnick - Exophase |
3 | # GP2X port(ion) - Z |
4 | |
5 | # Global definitions |
6 | |
7 | PREFIX = /opt/open2x/gcc-4.1.1-glibc-2.3.6 |
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) |
15 | BIN = gpsp_wiz |
16 | else |
17 | BIN = gpsp_gp2x |
18 | endif |
2823a4c8 |
19 | |
20 | # Platform specific definitions |
21 | |
22 | VPATH += .. |
23 | CFLAGS += -DARM_ARCH -DGP2X_BUILD |
4742480d |
24 | ifeq ($(WIZ),1) |
25 | CFLAGS += -DWIZ_BUILD |
26 | endif |
2823a4c8 |
27 | # NOTE: -funroll-loops will slow down compiling considerably |
28 | CFLAGS += -O3 -std=c99 -msoft-float -funsigned-char -fno-common \ |
29 | -fno-builtin \ |
30 | |
5da9148d |
31 | INCLUDES = `$(PREFIX)/bin/sdl-config --cflags` -I$(PREFIX)/include |
32 | LIBS = `$(PREFIX)/bin/sdl-config --libs` \ |
4742480d |
33 | -lm -ldl -lpthread -lz |
34 | ifneq ($(WIZ),1) |
4742480d |
35 | LIBS += -static |
36 | endif |
37 | |
2823a4c8 |
38 | # Compilation: |
39 | |
40 | .SUFFIXES: .c |
41 | |
42 | %.z: %.c |
43 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
44 | |
45 | %.u: %.c |
46 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
47 | |
48 | %.o: %.c |
49 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
50 | |
51 | %.o: %.S |
52 | $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $< |
53 | |
788343bb |
54 | %.o: %.s |
55 | $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $< |
56 | |
2823a4c8 |
57 | all: $(OBJS) |
c872443f |
58 | $(CC) $(OBJS) $(LIBS) -o $(BIN) |
cd4e2bda |
59 | $(STRIP) $(BIN) |
2823a4c8 |
60 | |
61 | clean: |
62 | rm -f *.o *.u *.z $(BIN) |
63 | |