initial Caanoo port
[gpsp.git] / gp2x / Makefile
CommitLineData
2823a4c8 1# gpSP makefile
2# Gilead Kutnick - Exophase
3# GP2X port(ion) - Z
4
5# Global definitions
6
108c704a 7CC = $(CROSS_COMPILE)gcc
2823a4c8 8
9OBJS = main.o cpu.o memory.u video.o input.o sound.o gp2x.o gui.o \
4742480d 10 cheats.o zip.o cpu_threaded.z arm_stub.o video_blend.o \
c872443f 11 warm.o upscale_aspect.o
12ifeq ($(WIZ),1)
108c704a 13POLLUX = 1
e8f5db5d 14OBJS += pollux_dpc_set.o
c872443f 15BIN = gpsp_wiz
108c704a 16endif
17ifeq ($(CAANOO),1)
18POLLUX = 1
19OBJS += pollux_dpc_set.o
20BIN = gpsp_caanoo
21endif
22ifeq ($(BIN),)
c872443f 23BIN = gpsp_gp2x
24endif
2823a4c8 25
8b6232a6 26-include Makefile.local
27
2823a4c8 28# Platform specific definitions
29
d5e0983c 30VPATH += .. ../arm
2823a4c8 31CFLAGS += -DARM_ARCH -DGP2X_BUILD
4742480d 32ifeq ($(WIZ),1)
33CFLAGS += -DWIZ_BUILD
34endif
108c704a 35ifeq ($(POLLUX),1)
36CFLAGS += -DPOLLUX_BUILD
37endif
38CFLAGS += -std=c99 -msoft-float -funsigned-char -Wall -ggdb
39ifndef DEBUG
40CFLAGS += -O2
41endif
2823a4c8 42
108c704a 43INCLUDES = `sdl-config --cflags`
44LIBS = `sdl-config --libs` \
4742480d 45 -lm -ldl -lpthread -lz
108c704a 46ifeq ($(WIZ)$(CAANOO),)
4742480d 47LIBS += -static
48endif
49
2823a4c8 50# Compilation:
51
52.SUFFIXES: .c
53
bbba3209 54all: $(BIN)
55
56cpu.o cpu_threaded.z: CFLAGS += -Wno-unused-variable -Wno-unused-label
57
2823a4c8 58%.z: %.c
59 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
60
61%.u: %.c
62 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
63
64%.o: %.c
65 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
66
67%.o: %.S
68 $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $<
69
788343bb 70%.o: %.s
71 $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $<
72
bbba3209 73$(BIN): $(OBJS)
c872443f 74 $(CC) $(OBJS) $(LIBS) -o $(BIN)
2823a4c8 75
76clean:
77 rm -f *.o *.u *.z $(BIN)
78