diff --git a/makefile b/makefile index e89319f..c27696b 100644 --- a/makefile +++ b/makefile @@ -1,17 +1,29 @@ -tests: tests.o constants.o core.o console.o string.o file.o - ld tests.o constants.o core.o console.o string.o file.o -o tests -no-pie -z noexecstack -tests.o: tests.asm - nasm tests.asm -f elf64 -l tests.lst -g -F dwarf -constants.o: constants.asm - nasm constants.asm -f elf64 -l constants.lst -g -F dwarf -core.o: core.asm - nasm core.asm -f elf64 -l core.lst -g -F dwarf -console.o: console.asm - nasm console.asm -f elf64 -l console.lst -g -F dwarf -string.o: string.asm - nasm string.asm -f elf64 -l string.lst -g -F dwarf -file.o: file.asm - nasm file.asm -f elf64 -l file.lst -g -F dwarf +tests: build/tests.o build/constants.o build/core.o build/console.o build/string.o build/file.o + ld build/tests.o build/constants.o build/core.o build/console.o build/string.o build/file.o -o build/bin/tests -no-pie -z noexecstack -Ox +build/tests.o: src/tests.asm + nasm src/tests.asm -f elf64 -o build/tests.o +build/constants.o: src/constants.asm + nasm src/constants.asm -f elf64 -o build/constants.o +build/core.o: src/core.asm + nasm src/core.asm -f elf64 -o build/core.o +build/console.o: src/console.asm + nasm src/console.asm -f elf64 -o build/console.o +build/string.o: src/string.asm + nasm src/string.asm -f elf64 -o build/string.o +build/file.o: src/file.asm + nasm src/file.asm -f elf64 -o build/file.o clean: - rm -f tests *.lst *.o testFile1.txt + rm -rf build +all: + make clean + mkdir -p build/bin + make tests +debug: + nasm src/tests.asm -f elf64 -o build/tests.o -l build/tests.lst -g -F dwarf + nasm src/constants.asm -f elf64 -o build/constants.o -l build/constants.lst -g -F dwarf + nasm src/core.asm -f elf64 -o build/core.o -l build/core.lst -g -F dwarf + nasm src/console.asm -f elf64 -o build/console.o -l build/console.lst -g -F dwarf + nasm src/string.asm -f elf64 -o build/string.o -l build/string.lst -g -F dwarf + nasm src/file.asm -f elf64 -o build/file.o -l build/file.lst -g -F dwarf + ld build/tests.o build/constants.o build/core.o build/console.o build/string.o build/file.o -o build/bin/tests -no-pie -z noexecstack -O0 diff --git a/console.asm b/src/console.asm similarity index 100% rename from console.asm rename to src/console.asm diff --git a/constants.asm b/src/constants.asm similarity index 100% rename from constants.asm rename to src/constants.asm diff --git a/core.asm b/src/core.asm similarity index 100% rename from core.asm rename to src/core.asm diff --git a/file.asm b/src/file.asm similarity index 100% rename from file.asm rename to src/file.asm diff --git a/string.asm b/src/string.asm similarity index 100% rename from string.asm rename to src/string.asm diff --git a/tests.asm b/src/tests.asm similarity index 100% rename from tests.asm rename to src/tests.asm