Added python

Also updated Makefile for ease of use.
This commit is contained in:
stickynotememo
2025-12-19 18:13:45 +11:00
parent 806ff9ce43
commit 3f478d3b96
5 changed files with 60 additions and 35 deletions
+11 -7
View File
@@ -1,14 +1,18 @@
3_rust: 2_c
rustc -Clink-arg=target/1_assembly.o -Clink-arg=target/2_c.o src/3_rust.rs -o target/3_rust --verbose
# rustc src/3_rust.rs -o target/3_rust --verbose
# -L target -l 2_c
target/4_python.py: target/3_rust src/4_python.py
cp src/4_python.py target/4_python.py
2_c: 1_assembly
target/3_rust: target/2_c.o src/3_rust.rs
rustc -Clink-arg=target/1_assembly.o -Clink-arg=target/2_c.o src/3_rust.rs -o target/3_rust
target/2_c.o: target/1_assembly.o src/2_c.c
gcc -Wall -Wpedantic -Werror src/2_c.c -c -fPIC -o target/2_c.o
# ar rcs target/lib2_c.a target/2_c.o
1_assembly:
target/1_assembly.o: src/1_assembly.S
nasm -f elf64 src/1_assembly.S -o target/1_assembly.o
.PHONY: clean run
clean:
rm target/*
run: src/4_python.py
python target/4_python.py