cleanup: remove cpu ctrl files, move tests
[gpsp.git] / gp2x / Makefile
CommitLineData
2823a4c8 1# gpSP makefile
2# Gilead Kutnick - Exophase
3# GP2X port(ion) - Z
4
5# Global definitions
6
7PREFIX = /opt/open2x/gcc-4.1.1-glibc-2.3.6
8CC = $(PREFIX)/bin/arm-open2x-linux-gcc
9STRIP = $(PREFIX)/bin/arm-open2x-linux-strip
10
11OBJS = main.o cpu.o memory.u video.o input.o sound.o gp2x.o gui.o \
a6c41a38 12 cheats.o zip.o cpu_threaded.z cpuctrl_mmsp2.o \
01087863 13 arm_stub.o video_blend.o flush_cache.o
2823a4c8 14BIN = gpsp.gpe
15
16# Platform specific definitions
17
18VPATH += ..
19CFLAGS += -DARM_ARCH -DGP2X_BUILD
20# NOTE: -funroll-loops will slow down compiling considerably
21CFLAGS += -O3 -std=c99 -msoft-float -funsigned-char -fno-common \
22 -fno-builtin \
23
5da9148d 24INCLUDES = `$(PREFIX)/bin/sdl-config --cflags` -I$(PREFIX)/include
25LIBS = `$(PREFIX)/bin/sdl-config --libs` \
2823a4c8 26 -lm -ldl -lpthread -lz -static
27
28# Compilation:
29
30.SUFFIXES: .c
31
32%.z: %.c
33 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
34
35%.u: %.c
36 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
37
38%.o: %.c
39 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
40
41%.o: %.S
42 $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $<
43
44all: $(OBJS)
45 $(CC) $(OBJS) $(LIBS) -o $(BIN)
46 $(STRIP) $(BIN)
47
48clean:
49 rm -f *.o *.u *.z $(BIN)
50