From 28d5ebdc8a9a5d94bfa585b0a396d58ff3b42c43 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 17 May 2019 20:22:32 -0400 Subject: [PATCH] Make apps folder into a namespace To straighten out includes and to pave the way into zasm being part of the same "include CFS" as parts, we make zasm includes namespaced. --- apps/zasm/main.asm | 16 ++++++++-------- apps/zasm/{parse_z.asm => parse.asm} | 0 apps/zasm/{util_z.asm => util.asm} | 0 tools/emul/Makefile | 4 ++-- tools/emul/zasm/user.asm | 2 +- tools/tests/unit/runtests.sh | 4 ++-- tools/tests/unit/test_expr.asm | 8 ++++---- tools/tests/unit/test_parse_z.asm | 4 ++-- tools/tests/unit/test_symbol.asm | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-) rename apps/zasm/{parse_z.asm => parse.asm} (100%) rename apps/zasm/{util_z.asm => util.asm} (100%) diff --git a/apps/zasm/main.asm b/apps/zasm/main.asm index 5feaed7..7bd3566 100644 --- a/apps/zasm/main.asm +++ b/apps/zasm/main.asm @@ -54,17 +54,17 @@ ; *** Code *** jp zasmMain -#include "util_z.asm" +#include "zasm/util.asm" .equ IO_RAMSTART ZASM_RAMEND -#include "io.asm" -#include "tok.asm" -#include "parse_z.asm" -#include "expr.asm" -#include "instr.asm" +#include "zasm/io.asm" +#include "zasm/tok.asm" +#include "zasm/parse.asm" +#include "zasm/expr.asm" +#include "zasm/instr.asm" .equ DIREC_RAMSTART IO_RAMEND -#include "directive.asm" +#include "zasm/directive.asm" .equ SYM_RAMSTART DIREC_RAMEND -#include "symbol.asm" +#include "zasm/symbol.asm" ; Read file through blockdev ID in H and outputs its upcodes through blockdev ; ID in L. diff --git a/apps/zasm/parse_z.asm b/apps/zasm/parse.asm similarity index 100% rename from apps/zasm/parse_z.asm rename to apps/zasm/parse.asm diff --git a/apps/zasm/util_z.asm b/apps/zasm/util.asm similarity index 100% rename from apps/zasm/util_z.asm rename to apps/zasm/util.asm diff --git a/tools/emul/Makefile b/tools/emul/Makefile index 8001abb..d936fbe 100644 --- a/tools/emul/Makefile +++ b/tools/emul/Makefile @@ -12,11 +12,11 @@ $(KERNEL_HEADERS): scas -o - -I ../../parts/z80 $< | ./bin2c.sh KERNEL | tee $@ > /dev/null zasm/user.h: zasm/user.asm - scas -o - -I ../../apps/zasm $< | ./bin2c.sh USERSPACE | tee $@ > /dev/null + scas -o - -I ../../apps $< | ./bin2c.sh USERSPACE | tee $@ > /dev/null zasm/includes.cfs: ../../parts/z80 $(CFSPACK) cp -rf $< zasm/includes - rm zasm/includes/README.md + find zasm/includes -name *.md -delete find zasm/includes -type f -exec sed -i -e 's/;.*//g' {} \; $(CFSPACK) zasm/includes > $@ rm -rf zasm/includes diff --git a/tools/emul/zasm/user.asm b/tools/emul/zasm/user.asm index 864a311..aa24063 100644 --- a/tools/emul/zasm/user.asm +++ b/tools/emul/zasm/user.asm @@ -25,7 +25,7 @@ fsTell .equ 0x2d ;call dumpSymTable ret -#include "main.asm" +#include "zasm/main.asm" ; *** Debug *** debugPrint: diff --git a/tools/tests/unit/runtests.sh b/tools/tests/unit/runtests.sh index 5895a80..cabf70a 100755 --- a/tools/tests/unit/runtests.sh +++ b/tools/tests/unit/runtests.sh @@ -5,12 +5,12 @@ set -o pipefail SCAS=scas PARTS=../../../parts/z80 -ZASMDIR=../../../apps/zasm +APPS=../../../apps RUNBIN=../../emul/runbin/runbin for fn in *.asm; do echo "Running test ${fn}" - if ! ${SCAS} -I ${PARTS} -I ${ZASMDIR} -o - ${fn} | ${RUNBIN}; then + if ! ${SCAS} -I ${PARTS} -I ${APPS} -o - ${fn} | ${RUNBIN}; then echo "failed with code ${PIPESTATUS[1]}" exit 1 fi diff --git a/tools/tests/unit/test_expr.asm b/tools/tests/unit/test_expr.asm index 6e4938c..7dfa933 100644 --- a/tools/tests/unit/test_expr.asm +++ b/tools/tests/unit/test_expr.asm @@ -3,11 +3,11 @@ jp test #include "core.asm" #include "parse.asm" -#include "util_z.asm" -#include "parse_z.asm" +#include "zasm/util.asm" +#include "zasm/parse.asm" .equ SYM_RAMSTART RAMSTART -#include "symbol.asm" -#include "expr.asm" +#include "zasm/symbol.asm" +#include "zasm/expr.asm" ; Pretend that we aren't in first pass zasmIsFirstPass: diff --git a/tools/tests/unit/test_parse_z.asm b/tools/tests/unit/test_parse_z.asm index 17e2541..2649a18 100644 --- a/tools/tests/unit/test_parse_z.asm +++ b/tools/tests/unit/test_parse_z.asm @@ -2,8 +2,8 @@ jp test #include "core.asm" #include "parse.asm" -#include "util_z.asm" -#include "parse_z.asm" +#include "zasm/util.asm" +#include "zasm/parse.asm" ; mocks. aren't used in tests zasmIsFirstPass: diff --git a/tools/tests/unit/test_symbol.asm b/tools/tests/unit/test_symbol.asm index 809b869..9cf5604 100644 --- a/tools/tests/unit/test_symbol.asm +++ b/tools/tests/unit/test_symbol.asm @@ -2,9 +2,9 @@ jp test #include "core.asm" -#include "util_z.asm" +#include "zasm/util.asm" .equ SYM_RAMSTART RAMSTART -#include "symbol.asm" +#include "zasm/symbol.asm" testNum: .db 1