summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTwinaphex2014-12-09 13:28:17 +0100
committerTwinaphex2014-12-09 13:28:17 +0100
commit988c2e2655c7c1f724ba727f008d84e3faa6cd24 (patch)
treeda7bf131f33b9ae16d2a93a0a7615a3c0b9c7535 /Makefile
parent7bb77f4fc090cadc23c3e05998ccebac7156e3cf (diff)
parente2d6ea9082a5ff977f834eda0bbb2362397422df (diff)
downloadpicogpsp-988c2e2655c7c1f724ba727f008d84e3faa6cd24.tar.gz
picogpsp-988c2e2655c7c1f724ba727f008d84e3faa6cd24.tar.bz2
picogpsp-988c2e2655c7c1f724ba727f008d84e3faa6cd24.zip
Merge pull request #2 from aliaspider/master
initial port of gpsp to libretro.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile73
1 files changed, 73 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c70231c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,73 @@
+TARGET := gpsp_libretro
+
+CC = gcc
+AR = psp-ar
+STATIC_LINKING = 0
+
+CFLAGS += -Werror-implicit-function-declaration
+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
+
+OBJS += x86/x86_stub.o
+OBJS += cheats.o
+OBJS += zip.o
+
+OBJS += libretro.o
+OBJS += libco/libco.o
+
+ifeq ($(STATIC_LINKING), 1)
+TARGET := $(TARGET).a
+else
+TARGET := $(TARGET).so
+endif
+
+ASFLAGS = $(CFLAGS)
+INCDIRS := -I.
+LDFLAGS += -shared -m32 -Wl,--no-undefined -Wl,--version-script=link.T
+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)
+
+cpu_threaded.o: cpu_threaded.c
+ $(CC) -c -o $@ $< $(CFLAGS) -Wno-unused-variable -Wno-unused-label $(OPTIMIZE_SAFE) $(INCDIRS)
+
+%.o: %.S
+ $(CC) -c -o $@ $< $(ASFLAGS) $(OPTIMIZE)
+
+clean:
+# rm -f main.o memory.o input.o sound.o x86_stub.o cheats.o zip.o libretro.o
+ rm -f $(OBJS)
+ rm -f $(TARGET)
+
+.PHONY: $(TARGET) clean