diff options
author | Bad Diode <bd@badd10de.dev> | 2021-11-15 22:32:02 +0100 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-11-15 22:32:02 +0100 |
commit | 26f1b9c35d337c0814158077fdc8f56b817e0b14 (patch) | |
tree | e0b20f3e6e843a3df45400f713eae1242ce8db65 /Makefile | |
parent | df4d884edb9b3a29d498d6852d0e8e077d9350df (diff) | |
download | bdl-26f1b9c35d337c0814158077fdc8f56b817e0b14.tar.gz bdl-26f1b9c35d337c0814158077fdc8f56b817e0b14.zip |
Fix stack on procedure call return
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -17,6 +17,7 @@ BIN := $(BUILD_DIR)/$(TARGET) | |||
17 | CC := cc | 17 | CC := cc |
18 | CFLAGS := -Wall -Wextra -pedantic -DBIN_NAME=\"$(TARGET)\" | 18 | CFLAGS := -Wall -Wextra -pedantic -DBIN_NAME=\"$(TARGET)\" |
19 | CFLAGS += $(INC_FLAGS) | 19 | CFLAGS += $(INC_FLAGS) |
20 | NASM_FLAGS ?= -felf64 | ||
20 | LDFLAGS := | 21 | LDFLAGS := |
21 | LDLIBS := | 22 | LDLIBS := |
22 | RELEASE_CFLAGS := -DNDEBUG -O2 -static | 23 | RELEASE_CFLAGS := -DNDEBUG -O2 -static |
@@ -30,8 +31,10 @@ DEBUG_CFLAGS := -DDEBUG -O0 -g | |||
30 | DEBUG ?= 0 | 31 | DEBUG ?= 0 |
31 | ifeq ($(DEBUG), 1) | 32 | ifeq ($(DEBUG), 1) |
32 | CFLAGS += $(DEBUG_CFLAGS) | 33 | CFLAGS += $(DEBUG_CFLAGS) |
34 | NASM_FLAGS += -g -F dwarf | ||
33 | else ifeq ($(DEBUG), 2) | 35 | else ifeq ($(DEBUG), 2) |
34 | CFLAGS += $(DEBUG_CFLAGS) -fsanitize=address | 36 | CFLAGS += $(DEBUG_CFLAGS) -fsanitize=address |
37 | NASM_FLAGS += -g -F dwarf | ||
35 | else | 38 | else |
36 | CFLAGS += $(RELEASE_CFLAGS) | 39 | CFLAGS += $(RELEASE_CFLAGS) |
37 | endif | 40 | endif |
@@ -54,7 +57,7 @@ tests: $(BIN) | |||
54 | 57 | ||
55 | run: $(BIN) | 58 | run: $(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 | ||