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