enable -Wall and fix warnings reported by it
[gpsp.git] / gp2x / Makefile
... / ...
CommitLineData
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 \
12 cheats.o zip.o cpu_threaded.z arm_stub.o video_blend.o \
13 warm.o upscale_aspect.o
14ifeq ($(WIZ),1)
15OBJS += pollux_dpc_set.o
16BIN = gpsp_wiz
17else
18BIN = gpsp_gp2x
19endif
20
21-include Makefile.local
22
23# Platform specific definitions
24
25VPATH += .. ../arm
26CFLAGS += -DARM_ARCH -DGP2X_BUILD
27ifeq ($(WIZ),1)
28CFLAGS += -DWIZ_BUILD
29endif
30# NOTE: -funroll-loops will slow down compiling considerably
31CFLAGS += -O3 -std=c99 -msoft-float -funsigned-char -fno-common \
32 -fno-builtin -Wall \
33
34INCLUDES = `$(PREFIX)/bin/sdl-config --cflags` -I$(PREFIX)/include
35LIBS = `$(PREFIX)/bin/sdl-config --libs` \
36 -lm -ldl -lpthread -lz
37ifneq ($(WIZ),1)
38LIBS += -static
39endif
40
41# Compilation:
42
43.SUFFIXES: .c
44
45all: $(BIN)
46
47cpu.o cpu_threaded.z: CFLAGS += -Wno-unused-variable -Wno-unused-label
48
49%.z: %.c
50 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
51
52%.u: %.c
53 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
54
55%.o: %.c
56 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
57
58%.o: %.S
59 $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $<
60
61%.o: %.s
62 $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $<
63
64$(BIN): $(OBJS)
65 $(CC) $(OBJS) $(LIBS) -o $(BIN)
66 $(STRIP) $(BIN)
67
68clean:
69 rm -f *.o *.u *.z $(BIN)
70