| 1 | # gpSP makefile |
| 2 | # Gilead Kutnick - Exophase |
| 3 | # GP2X port(ion) - Z |
| 4 | |
| 5 | # Global definitions |
| 6 | |
| 7 | CC = $(CROSS_COMPILE)gcc |
| 8 | |
| 9 | OBJS = main.o cpu.o memory.u video.o input.o sound.o gp2x.o gui.o \ |
| 10 | cheats.o zip.o cpu_threaded.z arm_stub.o video_blend.o \ |
| 11 | warm.o upscale_aspect.o |
| 12 | ifeq ($(WIZ),1) |
| 13 | POLLUX = 1 |
| 14 | OBJS += pollux_dpc_set.o |
| 15 | BIN = gpsp_wiz |
| 16 | endif |
| 17 | ifeq ($(CAANOO),1) |
| 18 | POLLUX = 1 |
| 19 | OBJS += pollux_dpc_set.o |
| 20 | BIN = gpsp_caanoo |
| 21 | endif |
| 22 | ifeq ($(BIN),) |
| 23 | BIN = gpsp_gp2x |
| 24 | endif |
| 25 | |
| 26 | -include Makefile.local |
| 27 | |
| 28 | # Platform specific definitions |
| 29 | |
| 30 | VPATH += .. ../arm |
| 31 | CFLAGS += -DARM_ARCH -DGP2X_BUILD |
| 32 | ifeq ($(WIZ),1) |
| 33 | CFLAGS += -DWIZ_BUILD |
| 34 | endif |
| 35 | ifeq ($(POLLUX),1) |
| 36 | CFLAGS += -DPOLLUX_BUILD |
| 37 | endif |
| 38 | CFLAGS += -std=c99 -msoft-float -funsigned-char -Wall -ggdb |
| 39 | ifndef DEBUG |
| 40 | CFLAGS += -O2 |
| 41 | endif |
| 42 | |
| 43 | INCLUDES = `sdl-config --cflags` |
| 44 | LIBS = `sdl-config --libs` \ |
| 45 | -lm -ldl -lpthread -lz |
| 46 | ifeq ($(WIZ)$(CAANOO),) |
| 47 | LIBS += -static |
| 48 | endif |
| 49 | |
| 50 | # Compilation: |
| 51 | |
| 52 | .SUFFIXES: .c |
| 53 | |
| 54 | all: $(BIN) |
| 55 | |
| 56 | cpu.o cpu_threaded.z: CFLAGS += -Wno-unused-variable -Wno-unused-label |
| 57 | |
| 58 | %.z: %.c |
| 59 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
| 60 | |
| 61 | %.u: %.c |
| 62 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
| 63 | |
| 64 | %.o: %.c |
| 65 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
| 66 | |
| 67 | %.o: %.S |
| 68 | $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $< |
| 69 | |
| 70 | %.o: %.s |
| 71 | $(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $< |
| 72 | |
| 73 | $(BIN): $(OBJS) |
| 74 | $(CC) $(OBJS) $(LIBS) -o $(BIN) |
| 75 | |
| 76 | clean: |
| 77 | rm -f *.o *.u *.z $(BIN) |
| 78 | |