aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 20 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 987ecd8..35447d3 100644
--- a/Makefile
+++ b/Makefile
@@ -5,10 +5,17 @@
5SRC_DIR := src 5SRC_DIR := src
6BUILD_DIR := build 6BUILD_DIR := build
7SRC_MAIN := $(SRC_DIR)/main.c 7SRC_MAIN := $(SRC_DIR)/main.c
8SRC_BAD := tests/expressions.bad
8WATCH_SRC := $(shell find $(SRC_DIR) -name "*.c" -or -name "*.s" -or -name "*.h") 9WATCH_SRC := $(shell find $(SRC_DIR) -name "*.c" -or -name "*.s" -or -name "*.h")
9INC_DIRS := $(shell find $(SRC_DIR) -type d) 10INC_DIRS := $(shell find $(SRC_DIR) -type d)
10INC_FLAGS := $(addprefix -I,$(INC_DIRS)) 11INC_FLAGS := $(addprefix -I,$(INC_DIRS))
11 12
13# Graphviz viz command.
14DOT := dot -Gmargin=0.7 -Gcolor=white -Gfontcolor=white \
15 -Ncolor=white -Nfontcolor=white -Ecolor=white \
16 -Nfontname="Iosevka Nerd Font" -Nfontsize=15 \
17 -T png | kitty +kitten icat
18
12# Output executable. 19# Output executable.
13TARGET := bdl 20TARGET := bdl
14BIN := $(BUILD_DIR)/$(TARGET) 21BIN := $(BUILD_DIR)/$(TARGET)
@@ -44,19 +51,23 @@ $(BUILD_DIR):
44 mkdir -p $(BUILD_DIR) 51 mkdir -p $(BUILD_DIR)
45 52
46run: $(BIN) 53run: $(BIN)
47 $(BIN) tests/expressions.bad 54 $(BIN) $(SRC_BAD)
48 55
49viz_lex: $(BIN) 56graph-tokens: $(BIN)
50 $(BIN) -pl example.bdl 57 # TODO: ...
58 $(BIN) -pl $(SRC_BAD)
51 59
52viz_par: $(BIN) 60graph-parse: $(BIN)
53 $(BIN) -pp example.bdl | idot 61 @echo "parsing tree for: '$(SRC_BAD)'"
62 @$(BIN) -pp $(SRC_BAD) | $(DOT)
54 63
55viz_sem: $(BIN) 64graph-semantic: $(BIN)
56 $(BIN) -ps example.bdl | idot 65 @echo "semantic tree for: '$(SRC_BAD)'"
66 @$(BIN) -ps $(SRC_BAD) | $(DOT)
57 67
58viz_sym: $(BIN) 68graph-symbols: $(BIN)
59 $(BIN) -pt example.bdl | idot 69 @echo "symbol table for: '$(SRC_BAD)'"
70 @$(BIN) -pt $(SRC_BAD) | $(DOT)
60 71
61# Remove build directory. 72# Remove build directory.
62clean: 73clean: