summaryrefslogtreecommitdiff
path: root/libpsx/Makefile
diff options
context:
space:
mode:
authorXavi Del Campo <xavi.dcr@tutanota.com>2020-01-31 10:32:23 +0100
committerXavi Del Campo <xavi.dcr@tutanota.com>2020-01-31 10:32:23 +0100
commit7c24e9a9b02b04dcaf9507acb94091ea70a2c02d (patch)
treec28d0748652ad4b4222309e46e6cfc82c0906220 /libpsx/Makefile
parenta2b7b6bb1cc2f4a3258b7b2dbc92399d151f864d (diff)
downloadpsxsdk-7c24e9a9b02b04dcaf9507acb94091ea70a2c02d.tar.gz
Imported pristine psxsdk-20190410 from official repo
Diffstat (limited to 'libpsx/Makefile')
-rw-r--r--libpsx/Makefile49
1 files changed, 49 insertions, 0 deletions
diff --git a/libpsx/Makefile b/libpsx/Makefile
new file mode 100644
index 0000000..d905cb8
--- /dev/null
+++ b/libpsx/Makefile
@@ -0,0 +1,49 @@
+# Makefile for PSX SDK library
+
+include ../Makefile.cfg
+
+CFLAGS += -O0
+
+# Never remove the line below!
+CFLAGS += -D__IN_LIBPSX
+
+OBJS = $(patsubst src/%.c, out/%.o, $(wildcard src/*.c)) \
+ $(patsubst src/libc/%.c, out/libc/%.o, $(wildcard src/libc/*.c)) \
+ $(patsubst src/runexe/%.c, out/runexe/%.o, $(wildcard src/runexe/*.c)) \
+ $(patsubst src/%.s, out/%.o, $(wildcard src/*.s)) \
+ $(patsubst src/runexe/%.s, out/runexe/%.o, $(wildcard src/runexe/*.s))
+
+all: libpsx.a start.o
+
+libpsx.a: $(OBJS)
+ $(AR) r libpsx.a $(OBJS)
+
+out/%.o: src/%.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+out/libc/%.o: src/libc/%.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+out/runexe/%.o: src/runexe/%.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+out/%.o: src/%.s
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+out/runexe/%.o: src/runexe/%.s
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+start.o: src/start/start.s
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+install: libpsx.a start.o
+ cp libpsx.a $(TOOLCHAIN_PREFIX)/lib
+ cp start.o $(TOOLCHAIN_PREFIX)/lib
+ cp -r include/* $(TOOLCHAIN_PREFIX)/include
+
+clean:
+ rm -f $(OBJS)
+ rm -f libpsx.a
+ rm -f start.o
+
+distclean: clean