Browse Source

Allow to use compiler's sanitizer. This fixes #53.

release/v0.1
Rafal Kupiec 1 year ago
parent
commit
a1f1d50d25
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      Makefile

+ 6
- 0
Makefile View File

@ -10,6 +10,9 @@ RCFLAGS = -O3 -s
# Flags to pass to the linker
LDFLAGS =
# Flags to enable sanitize checker
SFLAGS = -fsanitize=address -fsanitize=leak -fsanitize=undefined
# Destination directory
DESTDIR ?= $(realpath .)/binary
@ -123,6 +126,9 @@ debug: export CFLAGS := $(CFLAGS) $(DCFLAGS)
debug: engine sapi modules
release: export CFLAGS := $(CFLAGS) $(RCFLAGS)
release: engine sapi modules
sanitize: export CFLAGS := $(CFLAGS) $(DCFLAGS) $(SFLAGS)
sanitize: $(eval LDFLAGS := $(LDFLAGS) $(SFLAGS))
sanitize: engine sapi modules
engine: $(ENGINE_OBJS)
$(CC) -o $(BUILD_DIR)/lib$(BINARY)$(LIBSUFFIX) $(LDFLAGS) $(LIBS) -shared $(ENGINE_OBJS)


Loading…
Cancel
Save