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