c17af14b7e2f6cacb9a345694f9f83704c160cb3
[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 cpuctrl_mmsp2.o                     \
13             arm_stub.o video_blend.o flush_cache.o
14 BIN       = gpsp.gpe 
15
16 # Platform specific definitions 
17
18 VPATH      += ..
19 CFLAGS     += -DARM_ARCH -DGP2X_BUILD
20 # NOTE: -funroll-loops will slow down compiling considerably
21 CFLAGS     += -O3 -std=c99 -msoft-float -funsigned-char -fno-common           \
22               -fno-builtin                                                    \
23
24 INCLUDES   = `$(PREFIX)/bin/sdl-config --cflags` -I$(PREFIX)/include
25 LIBS       = `$(PREFIX)/bin/sdl-config --libs`               \
26               -lm -ldl -lpthread -lz -static
27
28 # Compilation:
29
30 .SUFFIXES: .c
31
32 %.z: %.c
33         $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
34
35 %.u: %.c
36         $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
37
38 %.o: %.c
39         $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
40
41 %.o: %.S
42         $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $<
43
44 all:    $(OBJS)
45         $(CC) $(OBJS) $(LIBS) -o $(BIN)  
46         $(STRIP) $(BIN)
47
48 clean:
49         rm -f *.o *.u *.z $(BIN) 
50