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