diff options
| author | Shivesh Mandalia <mail@shivesh.org> | 2022-04-17 16:34:47 +0100 |
|---|---|---|
| committer | Shivesh Mandalia <mail@shivesh.org> | 2022-04-17 16:34:47 +0100 |
| commit | 31a66b832990c63308aa1236bd68af242866d3d7 (patch) | |
| tree | f63a57b338f003445f3660bd4190cca11add4210 | |
| parent | e226b6a74e115f2dea82800f5492a976423a74ca (diff) | |
| download | basic_makefile-master.tar.gz basic_makefile-master.zip | |
| -rw-r--r-- | Makefile | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -6,11 +6,15 @@ BIN_NAME := SRC_DIRS := +# enable debug build +DEBUG = 1 + # general program flags -# Debug -MY_CFLAGS = -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -g -fsanitize=address,undefined -# Release -# MY_CFLAGS = -O3 +ifdef DEBUG + MY_CFLAGS = -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -g -fsanitize=address,undefined +else + MY_CFLAGS = -O3 +endif MY_LIBS = WARNINGS = -fstack-protector-strong -fpie -pedantic -Wall -Wextra @@ -81,7 +85,7 @@ print-%: ; @echo $*=$($*) ## Build everything ##----------------------------------------------------------------------------- -all: format check $(BIN_NAME) +all: $(if $(DEBUG), format check) $(BIN_NAME) ## Static analysis ##----------------------------------------------------------------------------- |
