switch to older compiler, it generates better code
[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 \
788343bb 13 warm.o sys_cacheflush.o upscale_aspect.o
2823a4c8 14BIN = gpsp.gpe
15
16# Platform specific definitions
17
18VPATH += ..
19CFLAGS += -DARM_ARCH -DGP2X_BUILD
4742480d 20ifeq ($(WIZ),1)
21CFLAGS += -DWIZ_BUILD
22endif
2823a4c8 23# NOTE: -funroll-loops will slow down compiling considerably
24CFLAGS += -O3 -std=c99 -msoft-float -funsigned-char -fno-common \
25 -fno-builtin \
26
5da9148d 27INCLUDES = `$(PREFIX)/bin/sdl-config --cflags` -I$(PREFIX)/include
28LIBS = `$(PREFIX)/bin/sdl-config --libs` \
4742480d 29 -lm -ldl -lpthread -lz
30ifneq ($(WIZ),1)
4742480d 31LIBS += -static
32endif
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 56all: $(OBJS)
57 $(CC) $(OBJS) $(LIBS) -o $(BIN)
cd4e2bda 58 $(STRIP) $(BIN)
2823a4c8 59
60clean:
61 rm -f *.o *.u *.z $(BIN)
62