aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 581dc1a..cdb8c93 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,7 @@ BIN := $(BUILD_DIR)/$(TARGET)
17CC := cc 17CC := cc
18CFLAGS := -Wall -Wextra -pedantic -DBIN_NAME=\"$(TARGET)\" 18CFLAGS := -Wall -Wextra -pedantic -DBIN_NAME=\"$(TARGET)\"
19CFLAGS += $(INC_FLAGS) 19CFLAGS += $(INC_FLAGS)
20NASM_FLAGS ?= -felf64
20LDFLAGS := 21LDFLAGS :=
21LDLIBS := 22LDLIBS :=
22RELEASE_CFLAGS := -DNDEBUG -O2 -static 23RELEASE_CFLAGS := -DNDEBUG -O2 -static
@@ -30,8 +31,10 @@ DEBUG_CFLAGS := -DDEBUG -O0 -g
30DEBUG ?= 0 31DEBUG ?= 0
31ifeq ($(DEBUG), 1) 32ifeq ($(DEBUG), 1)
32 CFLAGS += $(DEBUG_CFLAGS) 33 CFLAGS += $(DEBUG_CFLAGS)
34 NASM_FLAGS += -g -F dwarf
33else ifeq ($(DEBUG), 2) 35else ifeq ($(DEBUG), 2)
34 CFLAGS += $(DEBUG_CFLAGS) -fsanitize=address 36 CFLAGS += $(DEBUG_CFLAGS) -fsanitize=address
37 NASM_FLAGS += -g -F dwarf
35else 38else
36 CFLAGS += $(RELEASE_CFLAGS) 39 CFLAGS += $(RELEASE_CFLAGS)
37endif 40endif
@@ -54,7 +57,7 @@ tests: $(BIN)
54 57
55run: $(BIN) 58run: $(BIN)
56 $(BIN) example.bdl > build/example.asm 59 $(BIN) example.bdl > build/example.asm
57 nasm -felf64 build/example.asm -o build/example.o 60 nasm $(NASM_FLAGS) build/example.asm -o build/example.o
58 ld build/example.o -o build/example 61 ld build/example.o -o build/example
59 @./build/example 62 @./build/example
60 63