updated to warm r2
[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 \
4742480d 12 cheats.o zip.o cpu_threaded.z arm_stub.o video_blend.o \
c872443f 13 warm.o upscale_aspect.o
14ifeq ($(WIZ),1)
15BIN = gpsp_wiz
16else
17BIN = gpsp_gp2x
18endif
2823a4c8 19
20# Platform specific definitions
21
22VPATH += ..
23CFLAGS += -DARM_ARCH -DGP2X_BUILD
4742480d 24ifeq ($(WIZ),1)
25CFLAGS += -DWIZ_BUILD
26endif
2823a4c8 27# NOTE: -funroll-loops will slow down compiling considerably
28CFLAGS += -O3 -std=c99 -msoft-float -funsigned-char -fno-common \
29 -fno-builtin \
30
5da9148d 31INCLUDES = `$(PREFIX)/bin/sdl-config --cflags` -I$(PREFIX)/include
32LIBS = `$(PREFIX)/bin/sdl-config --libs` \
4742480d 33 -lm -ldl -lpthread -lz
34ifneq ($(WIZ),1)
4742480d 35LIBS += -static
36endif
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 57all: $(OBJS)
c872443f 58 $(CC) $(OBJS) $(LIBS) -o $(BIN)
cd4e2bda 59 $(STRIP) $(BIN)
2823a4c8 60
61clean:
62 rm -f *.o *.u *.z $(BIN)
63