ref: 59d155d65f977fbc68e5fd4a0a20877e906ca68f
parent: b46a70f8d01728eb3a542d95c38f259cdb8f1b55
author: cancel <cancel@cancel.fm>
date: Thu Nov 29 06:04:46 EST 2018
Update Makefile
--- a/Makefile
+++ b/Makefile
@@ -2,15 +2,16 @@
debug_flags := -DDEBUG -ggdb
sanitize_flags := -fsanitize=address -fsanitize=undefined
# note: -fsanitize=leak not available on at least Mac 10.12
-release_flags := -DNDEBUG -O2 -g0 -fpie -Wl,-pie
-# safety flags if you want a build that guards against stack problems
-safety_flags := -D_FORTIFY_SOURCE=2 -fstack-protector-strong
+release_flags := -DNDEBUG -O2 -g0
+# safety flags if you want a build that guards. pie doesn't work with clang
+# 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 :=
ifeq ($(shell uname -s), Darwin)
# no -Og on Mac clang, use O1 instead
debug_flags := $(debug_flags) -O1
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
debug_flags := $(debug_flags) -Og -feliminate-unused-debug-symbols
# GCC on Linux is way faster and moderately smaller with -flto, and smaller with -s
@@ -31,11 +32,11 @@
.PHONY: debug_cli
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
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
debug: debug_cli
@@ -42,11 +43,11 @@
.PHONY: release_cli
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
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
release: release_cli