From ab4e773dacc5411b7ede04950b07209dc606ad2f Mon Sep 17 00:00:00 2001 From: Alejandro Sior Date: Sat, 30 Jul 2022 22:53:58 +0200 Subject: cook: add basic makefile generation --- test/.build | 5 +++++ test/main.c | 8 ++++++++ test/test.asm | 6 ++++++ 3 files changed, 19 insertions(+) create mode 100644 test/.build create mode 100644 test/main.c create mode 100644 test/test.asm (limited to 'test') diff --git a/test/.build b/test/.build new file mode 100644 index 0000000..8fdda48 --- /dev/null +++ b/test/.build @@ -0,0 +1,5 @@ +linker_sc = CWD / "linker.sc" + +as_obj = asm("test.asm") +obj = cc("main.c", extra_args="-T" + str(linker_sc)) +aout = ld("a.out", obj, as_obj) \ No newline at end of file diff --git a/test/main.c b/test/main.c new file mode 100644 index 0000000..ce0991a --- /dev/null +++ b/test/main.c @@ -0,0 +1,8 @@ +#include + +int test(); + +int main() { + printf("test returned: %d\n", test()); + return 0; +} \ No newline at end of file diff --git a/test/test.asm b/test/test.asm new file mode 100644 index 0000000..bcd7d20 --- /dev/null +++ b/test/test.asm @@ -0,0 +1,6 @@ +[bits 64] + +global test +test: + mov eax, 69 + ret \ No newline at end of file -- cgit v1.2.3