2014-12-09 05:16:09 +01:00
|
|
|
TARGET := gpsp_libretro
|
2014-12-08 22:56:33 +01:00
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
AR = psp-ar
|
|
|
|
STATIC_LINKING = 0
|
|
|
|
|
2014-12-09 05:16:09 +01:00
|
|
|
CFLAGS += -Werror-implicit-function-declaration
|
2014-12-08 22:56:33 +01:00
|
|
|
CFLAGS += -DPC_BUILD -Wall -m32
|
|
|
|
CFLAGS += -D__LIBRETRO__
|
|
|
|
|
|
|
|
|
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
OPTIMIZE := -O0 -g
|
|
|
|
OPTIMIZE_SAFE := -O0 -g
|
|
|
|
else
|
|
|
|
OPTIMIZE := -O3
|
|
|
|
OPTIMIZE_SAFE := -O2
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
OBJS := main.o
|
|
|
|
OBJS += cpu.o
|
|
|
|
OBJS += memory.o
|
|
|
|
OBJS += video.o
|
|
|
|
OBJS += input.o
|
|
|
|
OBJS += sound.o
|
|
|
|
OBJS += cpu_threaded.o
|
|
|
|
|
2014-12-09 00:17:28 +01:00
|
|
|
OBJS += x86/x86_stub.o
|
2014-12-08 22:56:33 +01:00
|
|
|
OBJS += cheats.o
|
|
|
|
|
|
|
|
OBJS += libretro.o
|
2014-12-09 01:59:02 +01:00
|
|
|
OBJS += libco/libco.o
|
2014-12-08 22:56:33 +01:00
|
|
|
|
2014-12-09 05:16:09 +01:00
|
|
|
ifeq ($(STATIC_LINKING), 1)
|
|
|
|
TARGET := $(TARGET).a
|
|
|
|
else
|
|
|
|
TARGET := $(TARGET).so
|
|
|
|
endif
|
2014-12-08 22:56:33 +01:00
|
|
|
|
|
|
|
ASFLAGS = $(CFLAGS)
|
|
|
|
INCDIRS := -I.
|
2014-12-09 10:13:44 +01:00
|
|
|
LDFLAGS += -shared -m32 -Wl,--no-undefined -Wl,--version-script=link.T
|
2014-12-08 22:56:33 +01:00
|
|
|
LDLIBS += -lz
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
|
|
|
ifeq ($(STATIC_LINKING), 1)
|
|
|
|
$(AR) rcs $@ $(OBJS)
|
|
|
|
else
|
|
|
|
$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) $(LDLIBS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) -c -o $@ $< $(CFLAGS) $(OPTIMIZE) $(INCDIRS)
|
|
|
|
|
|
|
|
cpu.o: cpu.c
|
|
|
|
$(CC) -c -o $@ $< $(CFLAGS) -Wno-unused-variable -Wno-unused-label $(OPTIMIZE_SAFE) $(INCDIRS)
|
|
|
|
|
2014-12-09 02:11:22 +01:00
|
|
|
cpu_threaded.o: cpu_threaded.c
|
|
|
|
$(CC) -c -o $@ $< $(CFLAGS) -Wno-unused-variable -Wno-unused-label $(OPTIMIZE_SAFE) $(INCDIRS)
|
|
|
|
|
2014-12-08 22:56:33 +01:00
|
|
|
%.o: %.S
|
|
|
|
$(CC) -c -o $@ $< $(ASFLAGS) $(OPTIMIZE)
|
|
|
|
|
|
|
|
clean:
|
2014-12-09 15:33:14 +01:00
|
|
|
# rm -f main.o memory.o input.o sound.o x86_stub.o cheats.o libretro.o
|
2014-12-08 22:56:33 +01:00
|
|
|
rm -f $(OBJS)
|
|
|
|
rm -f $(TARGET)
|
|
|
|
|
|
|
|
.PHONY: $(TARGET) clean
|