aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2024-06-14 17:55:51 +0200
committerBad Diode <bd@badd10de.dev>2024-06-14 17:55:51 +0200
commit3aae2f36047e9adc6a59b886492254eb4370777d (patch)
tree7d8f8fc069393dd38e9688d8d7cf77117ba5235f /Makefile
parentdeaf192df939c9ec9a62ef4febaf76ade0dcbb01 (diff)
downloadbdl-3aae2f36047e9adc6a59b886492254eb4370777d.tar.gz
bdl-3aae2f36047e9adc6a59b886492254eb4370777d.zip
Starting fresh with the `badlang`
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 6 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 6a12cc3..45c1389 100644
--- a/Makefile
+++ b/Makefile
@@ -15,13 +15,12 @@ BIN := $(BUILD_DIR)/$(TARGET)
15 15
16# Compiler and linker configuration. 16# Compiler and linker configuration.
17CC := cc 17CC := cc
18CFLAGS := -Wall -Wextra -pedantic -DBIN_NAME=\"$(TARGET)\" -Wno-missing-braces 18CFLAGS := -Wall -Wextra -pedantic -std=c11 -DBIN_NAME=\"$(TARGET)\"
19CFLAGS += $(INC_FLAGS) 19CFLAGS += $(INC_FLAGS)
20NASM_FLAGS ?= -felf64
21LDFLAGS := 20LDFLAGS :=
22LDLIBS := 21LDLIBS :=
23RELEASE_CFLAGS := -DNDEBUG -O2 22RELEASE_CFLAGS := -DNDEBUG -O2
24DEBUG_CFLAGS := -DDEBUG -O0 -g 23DEBUG_CFLAGS := -DDEBUG -g -fsanitize=address,undefined
25 24
26.PHONY: build tests clean 25.PHONY: build tests clean
27 26
@@ -31,10 +30,6 @@ DEBUG_CFLAGS := -DDEBUG -O0 -g
31DEBUG ?= 0 30DEBUG ?= 0
32ifeq ($(DEBUG), 1) 31ifeq ($(DEBUG), 1)
33 CFLAGS += $(DEBUG_CFLAGS) 32 CFLAGS += $(DEBUG_CFLAGS)
34 NASM_FLAGS += -g -F dwarf
35else ifeq ($(DEBUG), 2)
36 CFLAGS += $(DEBUG_CFLAGS) -fsanitize=address
37 NASM_FLAGS += -g -F dwarf
38else 33else
39 CFLAGS += $(RELEASE_CFLAGS) 34 CFLAGS += $(RELEASE_CFLAGS)
40endif 35endif
@@ -52,19 +47,19 @@ tests: $(BIN)
52 ./$(BIN) tests/constants/numbers.bdl 47 ./$(BIN) tests/constants/numbers.bdl
53 48
54run: $(BIN) 49run: $(BIN)
55 $(BIN) example.bdl 50 $(BIN) tests/literals.bad
56 51
57viz_lex: $(BIN) 52viz_lex: $(BIN)
58 $(BIN) -pl example.bdl 53 $(BIN) -pl example.bdl
59 54
60viz_par: $(BIN) 55viz_par: $(BIN)
61 $(BIN) -pp example.bdl | dot -Nfontname="Iosevka Term" -Tpng > viz.png 56 $(BIN) -pp example.bdl | idot
62 57
63viz_sem: $(BIN) 58viz_sem: $(BIN)
64 $(BIN) -ps example.bdl | dot -Nfontname="Iosevka Term" -Tpng > viz.png 59 $(BIN) -ps example.bdl | idot
65 60
66viz_sym: $(BIN) 61viz_sym: $(BIN)
67 $(BIN) -pt example.bdl | dot -Nfontname="Iosevka Term" -Tpng > viz.png 62 $(BIN) -pt example.bdl | idot
68 63
69# Remove build directory. 64# Remove build directory.
70clean: 65clean: