added upscaler
[gpsp.git] / gp2x / Makefile
CommitLineData
2823a4c8 1# gpSP makefile
2# Gilead Kutnick - Exophase
3# GP2X port(ion) - Z
4
5# Global definitions
6
4742480d 7ifeq ($(WIZ),1)
8PREFIX = /opt/arm-openwiz-linux-gnu
9CC = $(PREFIX)/bin/arm-openwiz-linux-gnu-gcc
10STRIP = $(PREFIX)/bin/arm-openwiz-linux-gnu-strip
11else
2823a4c8 12PREFIX = /opt/open2x/gcc-4.1.1-glibc-2.3.6
13CC = $(PREFIX)/bin/arm-open2x-linux-gcc
14STRIP = $(PREFIX)/bin/arm-open2x-linux-strip
4742480d 15endif
2823a4c8 16
17OBJS = main.o cpu.o memory.u video.o input.o sound.o gp2x.o gui.o \
4742480d 18 cheats.o zip.o cpu_threaded.z arm_stub.o video_blend.o \
788343bb 19 warm.o sys_cacheflush.o upscale_aspect.o
2823a4c8 20BIN = gpsp.gpe
21
22# Platform specific definitions
23
24VPATH += ..
25CFLAGS += -DARM_ARCH -DGP2X_BUILD
4742480d 26ifeq ($(WIZ),1)
27CFLAGS += -DWIZ_BUILD
28endif
2823a4c8 29# NOTE: -funroll-loops will slow down compiling considerably
30CFLAGS += -O3 -std=c99 -msoft-float -funsigned-char -fno-common \
31 -fno-builtin \
32
5da9148d 33INCLUDES = `$(PREFIX)/bin/sdl-config --cflags` -I$(PREFIX)/include
34LIBS = `$(PREFIX)/bin/sdl-config --libs` \
4742480d 35 -lm -ldl -lpthread -lz
36ifneq ($(WIZ),1)
37OBJS += cpuctrl_mmsp2.o
38LIBS += -static
39endif
40
41CFLAGS += -ggdb
42LIBS += -ggdb
2823a4c8 43
44# Compilation:
45
46.SUFFIXES: .c
47
48%.z: %.c
49 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
50
51%.u: %.c
52 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
53
54%.o: %.c
55 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
56
57%.o: %.S
58 $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $<
59
788343bb 60%.o: %.s
61 $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $<
62
2823a4c8 63all: $(OBJS)
64 $(CC) $(OBJS) $(LIBS) -o $(BIN)
4742480d 65# $(STRIP) $(BIN)
2823a4c8 66
67clean:
68 rm -f *.o *.u *.z $(BIN)
69