Skip to content

Commit

Permalink
new debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Jan 21, 2018
1 parent a608ca5 commit 3fa8bf3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"tasks": [{
"label": "build make",
"type": "shell",
"command": "make all cflags=-g -Wall",
"command": "make all cflags=-g -Wall debug=1",
"group": {
"kind": "build",
"isDefault": true
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ cflags := -Wall
clibs := -lviriatum
install := install
prefix := /usr/local
debug := 0
dflags := -D HAVE_DEBUG

base: mingus mingusa

Expand All @@ -16,10 +18,18 @@ clean:
$(rm) -f mingus mingusa examples/*.mic

mingus: src/mingus/mingus.c
ifeq ($(debug),1)
$(cc) $(cflags) $(dflags) src/mingus/mingus.c -o mingus $(clibs)
else
$(cc) $(cflags) src/mingus/mingus.c -o mingus $(clibs)
endif

mingusa: src/mingus_assembler/mingus_assembler.c
ifeq ($(debug),1)
$(cc) $(cflags) $(dflags) src/mingus_assembler/mingus_assembler.c -o mingusa $(clibs)
else
$(cc) $(cflags) src/mingus_assembler/mingus_assembler.c -o mingusa $(clibs)
endif

examples.build: examples/loop.mic examples/calc.mic examples/call.mic

Expand Down
3 changes: 3 additions & 0 deletions src/mingus/mingus.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

#include "mingus.h"

/* starts the memory structures */
START_MEMORY;

const char operands[3][32] = { "##", "==", "!=" };

unsigned int mingus_fetch(struct state_t *state) {
Expand Down
3 changes: 3 additions & 0 deletions src/mingus_assembler/mingus_assembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
*/
#define _UNDEFINED -127

/* starts the memory structures */
START_MEMORY;

/**
* Enumeration defining all the possible
* states for the mingus assembler parser.
Expand Down

0 comments on commit 3fa8bf3

Please sign in to comment.