|
@ -2,15 +2,16 @@ basic_flags := -std=c99 -pipe -Wall -Wpedantic -Wextra -Wconversion -Werror=impl |
|
|
debug_flags := -DDEBUG -ggdb |
|
|
debug_flags := -DDEBUG -ggdb |
|
|
sanitize_flags := -fsanitize=address -fsanitize=undefined |
|
|
sanitize_flags := -fsanitize=address -fsanitize=undefined |
|
|
# note: -fsanitize=leak not available on at least Mac 10.12
|
|
|
# note: -fsanitize=leak not available on at least Mac 10.12
|
|
|
release_flags := -DNDEBUG -O2 -g0 -fpie -Wl,-pie |
|
|
release_flags := -DNDEBUG -O2 -g0 |
|
|
# safety flags if you want a build that guards against stack problems
|
|
|
# safety flags if you want a build that guards. pie doesn't work with clang
|
|
|
safety_flags := -D_FORTIFY_SOURCE=2 -fstack-protector-strong |
|
|
# with the other combinations of options in release we're using on linux.
|
|
|
|
|
|
safety_flags := -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fpie -Wl,-pie |
|
|
cli_library_flags := |
|
|
cli_library_flags := |
|
|
ifeq ($(shell uname -s), Darwin) |
|
|
ifeq ($(shell uname -s), Darwin) |
|
|
# no -Og on Mac clang, use O1 instead
|
|
|
# no -Og on Mac clang, use O1 instead
|
|
|
debug_flags := $(debug_flags) -O1 |
|
|
debug_flags := $(debug_flags) -O1 |
|
|
tui_library_flags := -lncurses |
|
|
tui_library_flags := -lncurses |
|
|
# clang on Mac (maybe on Linux?) is slower with -flto, and -s is deprecated
|
|
|
# clang on Mac 10.12 is slower with -flto, and -s is deprecated
|
|
|
else |
|
|
else |
|
|
debug_flags := $(debug_flags) -Og -feliminate-unused-debug-symbols |
|
|
debug_flags := $(debug_flags) -Og -feliminate-unused-debug-symbols |
|
|
# GCC on Linux is way faster and moderately smaller with -flto, and smaller with -s
|
|
|
# GCC on Linux is way faster and moderately smaller with -flto, and smaller with -s
|
|
@ -31,22 +32,22 @@ build/debug build/release: | build |
|
|
|
|
|
|
|
|
.PHONY: debug_cli |
|
|
.PHONY: debug_cli |
|
|
debug_cli: | build/debug |
|
|
debug_cli: | build/debug |
|
|
@cc $(basic_flags) $(debug_flags) $(sanitize_flags) $(cli_source_files) -o build/debug/orca $(cli_library_flags) |
|
|
@$(CC) $(basic_flags) $(debug_flags) $(sanitize_flags) $(cli_source_files) -o build/debug/orca $(cli_library_flags) |
|
|
|
|
|
|
|
|
.PHONY: debug_tui |
|
|
.PHONY: debug_tui |
|
|
debug_tui: | build/debug |
|
|
debug_tui: | build/debug |
|
|
@cc $(basic_flags) $(debug_flags) $(sanitize_flags) $(tui_source_files) -o build/debug/orca_tui $(tui_library_flags) |
|
|
@$(CC) $(basic_flags) $(debug_flags) $(sanitize_flags) $(tui_source_files) -o build/debug/orca_tui $(tui_library_flags) |
|
|
|
|
|
|
|
|
.PHONY: debug |
|
|
.PHONY: debug |
|
|
debug: debug_cli |
|
|
debug: debug_cli |
|
|
|
|
|
|
|
|
.PHONY: release_cli |
|
|
.PHONY: release_cli |
|
|
release_cli: | build/release |
|
|
release_cli: | build/release |
|
|
@cc $(basic_flags) $(release_flags) $(cli_source_files) -o build/release/orca $(cli_library_flags) |
|
|
@$(CC) $(basic_flags) $(release_flags) $(cli_source_files) -o build/release/orca $(cli_library_flags) |
|
|
|
|
|
|
|
|
.PHONY: release_tui |
|
|
.PHONY: release_tui |
|
|
release_tui: | build/release |
|
|
release_tui: | build/release |
|
|
@cc $(basic_flags) $(release_flags) $(tui_source_files) -o build/release/orca_tui $(tui_library_flags) |
|
|
@$(CC) $(basic_flags) $(release_flags) $(tui_source_files) -o build/release/orca_tui $(tui_library_flags) |
|
|
|
|
|
|
|
|
.PHONY: release |
|
|
.PHONY: release |
|
|
release: release_cli |
|
|
release: release_cli |
|
|