Added time to debug build

This commit is contained in:
Devine Lu Linvega 2024-04-08 15:47:58 -07:00
parent d6a3f2af7b
commit 57207920c8
4 changed files with 17 additions and 17 deletions

View File

@ -1,5 +1,5 @@
<> (?x dup) (?x ?x) <> (greeting) (Melcome to)
<> (?x ?y swap) (?y ?x) <> (name) (Modal --)
<> ( ?x pop) () <> (?: ?: -- print) ()
(1 2 3) (4 5 6) swap pop dup greeting name print

View File

@ -12,8 +12,6 @@
<> (?x dup) (?x ?x) <> (?x dup) (?x ?x)
<> (?x ?y swap) (?y ?x) <> (?x ?y swap) (?y ?x)
<> (?x pop) () <> (?x pop) ()
<> (print ?:) ()
(implode reverse (explode hello)) (read) (explode hello) empty-register (eq abc abc) (eq abc def) (1 2 3) (4 5 6) swap pop dup (hey 1234 pop) (implode reverse (explode hello)) (read) (explode hello) empty-register (eq abc abc) (eq abc def) (1 2 3) (4 5 6) swap pop dup (hey 1234 pop) (print Done.)

View File

@ -3,16 +3,16 @@ DEBUG_flags=-std=c89 -D_POSIX_C_SOURCE=199309L -DDEBUG -Wall -Wno-unknown-pragma
.PHONY: all debug dest run test install uninstall format clean archive .PHONY: all debug dest run test install uninstall format clean archive
all: dest bin/modal all: dest
dest: dest:
@ mkdir -p bin @ mkdir -p bin
run: all run: bin/modal
@ bin/modal examples/test.modal "(arg1) (arg2 (arg3))" @ bin/modal examples/hello.modal 2> /dev/null
test: all test: bin/modal-debug
@ bin/modal -v @ bin/modal -v
@ bin/modal examples/test.modal 2> /dev/null @ time bin/modal examples/test.modal "(arg1) (arg2 (arg3))"
install: all install: bin/modal
cp bin/modal ~/bin/ cp bin/modal ~/bin/
uninstall: uninstall:
rm -f ~/bin/modal rm -f ~/bin/modal
@ -23,6 +23,8 @@ clean:
archive: all archive: all
cp src/modal.c ../oscean/etc/modal.c.txt cp src/modal.c ../oscean/etc/modal.c.txt
bin/modal-debug: src/modal.c
@ cc ${DEBUG_flags} src/modal.c -o bin/modal-debug
bin/modal: src/modal.c bin/modal: src/modal.c
@ cc ${DEBUG_flags} ${CFLAGS} src/modal.c -o bin/modal @ cc ${RELEASE_flags} src/modal.c -o bin/modal-debug

View File

@ -194,7 +194,7 @@ main(int argc, char **argv)
if(argc < 2) if(argc < 2)
return !printf("usage: modal [-v] source.modal\n"); return !printf("usage: modal [-v] source.modal\n");
if(argc < 3 && argv[1][0] == '-' && argv[1][1] == 'v') if(argc < 3 && argv[1][0] == '-' && argv[1][1] == 'v')
return !printf("Modal - Modal Interpreter, 8 Apr 2024.\n"); return !printf("Modal Interpreter, 8 Apr 2024.\n");
if(!(f = fopen(argv[1], "r"))) if(!(f = fopen(argv[1], "r")))
return !printf("Invalid Modal file: %s.\n", argv[1]); return !printf("Invalid Modal file: %s.\n", argv[1]);
while(fread(&c, 1, 1, f)) { while(fread(&c, 1, 1, f)) {