fix some warnings
[gpsp.git] / gp2x / Makefile
CommitLineData
2823a4c8 1# gpSP makefile
2# Gilead Kutnick - Exophase
3# GP2X port(ion) - Z
4
5# Global definitions
6
8b6232a6 7PREFIX ?= /opt/open2x/gcc-4.1.1-glibc-2.3.6
2823a4c8 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
8b6232a6 21-include Makefile.local
22
2823a4c8 23# Platform specific definitions
24
d5e0983c 25VPATH += .. ../arm
2823a4c8 26CFLAGS += -DARM_ARCH -DGP2X_BUILD
4742480d 27ifeq ($(WIZ),1)
28CFLAGS += -DWIZ_BUILD
29endif
2823a4c8 30# NOTE: -funroll-loops will slow down compiling considerably
31CFLAGS += -O3 -std=c99 -msoft-float -funsigned-char -fno-common \
32 -fno-builtin \
33
5da9148d 34INCLUDES = `$(PREFIX)/bin/sdl-config --cflags` -I$(PREFIX)/include
35LIBS = `$(PREFIX)/bin/sdl-config --libs` \
4742480d 36 -lm -ldl -lpthread -lz
37ifneq ($(WIZ),1)
4742480d 38LIBS += -static
39endif
40
2823a4c8 41# Compilation:
42
43.SUFFIXES: .c
44
45%.z: %.c
46 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
47
48%.u: %.c
49 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
50
51%.o: %.c
52 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
53
54%.o: %.S
55 $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $<
56
788343bb 57%.o: %.s
58 $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $<
59
2823a4c8 60all: $(OBJS)
c872443f 61 $(CC) $(OBJS) $(LIBS) -o $(BIN)
cd4e2bda 62 $(STRIP) $(BIN)
2823a4c8 63
64clean:
65 rm -f *.o *.u *.z $(BIN)
66