diff options
author | Bad Diode <bd@badd10de.dev> | 2024-06-14 17:55:51 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2024-06-14 17:55:51 +0200 |
commit | 3aae2f36047e9adc6a59b886492254eb4370777d (patch) | |
tree | 7d8f8fc069393dd38e9688d8d7cf77117ba5235f /Makefile | |
parent | deaf192df939c9ec9a62ef4febaf76ade0dcbb01 (diff) | |
download | bdl-3aae2f36047e9adc6a59b886492254eb4370777d.tar.gz bdl-3aae2f36047e9adc6a59b886492254eb4370777d.zip |
Starting fresh with the `badlang`
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -15,13 +15,12 @@ BIN := $(BUILD_DIR)/$(TARGET) | |||
15 | 15 | ||
16 | # Compiler and linker configuration. | 16 | # Compiler and linker configuration. |
17 | CC := cc | 17 | CC := cc |
18 | CFLAGS := -Wall -Wextra -pedantic -DBIN_NAME=\"$(TARGET)\" -Wno-missing-braces | 18 | CFLAGS := -Wall -Wextra -pedantic -std=c11 -DBIN_NAME=\"$(TARGET)\" |
19 | CFLAGS += $(INC_FLAGS) | 19 | CFLAGS += $(INC_FLAGS) |
20 | NASM_FLAGS ?= -felf64 | ||
21 | LDFLAGS := | 20 | LDFLAGS := |
22 | LDLIBS := | 21 | LDLIBS := |
23 | RELEASE_CFLAGS := -DNDEBUG -O2 | 22 | RELEASE_CFLAGS := -DNDEBUG -O2 |
24 | DEBUG_CFLAGS := -DDEBUG -O0 -g | 23 | DEBUG_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 | |||
31 | DEBUG ?= 0 | 30 | DEBUG ?= 0 |
32 | ifeq ($(DEBUG), 1) | 31 | ifeq ($(DEBUG), 1) |
33 | CFLAGS += $(DEBUG_CFLAGS) | 32 | CFLAGS += $(DEBUG_CFLAGS) |
34 | NASM_FLAGS += -g -F dwarf | ||
35 | else ifeq ($(DEBUG), 2) | ||
36 | CFLAGS += $(DEBUG_CFLAGS) -fsanitize=address | ||
37 | NASM_FLAGS += -g -F dwarf | ||
38 | else | 33 | else |
39 | CFLAGS += $(RELEASE_CFLAGS) | 34 | CFLAGS += $(RELEASE_CFLAGS) |
40 | endif | 35 | endif |
@@ -52,19 +47,19 @@ tests: $(BIN) | |||
52 | ./$(BIN) tests/constants/numbers.bdl | 47 | ./$(BIN) tests/constants/numbers.bdl |
53 | 48 | ||
54 | run: $(BIN) | 49 | run: $(BIN) |
55 | $(BIN) example.bdl | 50 | $(BIN) tests/literals.bad |
56 | 51 | ||
57 | viz_lex: $(BIN) | 52 | viz_lex: $(BIN) |
58 | $(BIN) -pl example.bdl | 53 | $(BIN) -pl example.bdl |
59 | 54 | ||
60 | viz_par: $(BIN) | 55 | viz_par: $(BIN) |
61 | $(BIN) -pp example.bdl | dot -Nfontname="Iosevka Term" -Tpng > viz.png | 56 | $(BIN) -pp example.bdl | idot |
62 | 57 | ||
63 | viz_sem: $(BIN) | 58 | viz_sem: $(BIN) |
64 | $(BIN) -ps example.bdl | dot -Nfontname="Iosevka Term" -Tpng > viz.png | 59 | $(BIN) -ps example.bdl | idot |
65 | 60 | ||
66 | viz_sym: $(BIN) | 61 | viz_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. |
70 | clean: | 65 | clean: |