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