summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..fcb1c3a
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,41 @@
+SDL = -L/usr/lib -lSDL2
+
+MAIN_COMPONENTS = cpu.a video.a apple.a
+
+TARGET_CPU = cpu/6502.o cpu/addressing.o cpu/instructions.o cpu/table.o
+TARGET_VIDEO = video/ncurses.o
+
+
+# Executable Targets
+
+default: $(MAIN_COMPONENTS)
+ gcc -o ../build/apple-c main.c $^
+
+interpreter: cpu.a apple.a
+ gcc -o ../build/interpreter interpreter.c $^
+
+
+
+# Internal Libraries
+
+cpu.a: $(TARGET_CPU)
+ ar cr $@ $^
+
+video.a: $(TARGET_VIDEO)
+ ar cr $@ $^
+
+apple.a:
+ ar cr $@ $^
+
+*.o: *.c
+ gcc -c $^
+
+
+
+# Clean
+
+clean:
+ rm *.a
+ rm *.o
+ rm cpu/*.o
+ rm video/*.o \ No newline at end of file