summaryrefslogtreecommitdiffstatshomepage
path: root/makefile
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-03-26 15:45:59 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2015-03-26 15:45:59 +0100
commitb4d9920e1033241bc324c841a93c93fd59b61da0 (patch)
tree52c345791e31fb5a90396fefe3fa73bf4b434bab /makefile
parent6abf77a17261fabe5a1858945c917f4f4827d271 (diff)
More parameter handling (nw)
Diffstat (limited to 'makefile')
-rw-r--r--makefile70
1 files changed, 70 insertions, 0 deletions
diff --git a/makefile b/makefile
index 1df11c28069..f67822d2d9d 100644
--- a/makefile
+++ b/makefile
@@ -191,6 +191,76 @@ endif
PARAMS+= --distro=$(DISTRO)
+#-------------------------------------------------
+# sanity check the configuration
+#-------------------------------------------------
+
+# enable symbols as it is useless without them
+ifdef SANITIZE
+SYMBOLS = 1
+endif
+
+# profiler defaults to on for DEBUG builds
+ifdef DEBUG
+ifndef PROFILER
+PROFILER = 1
+endif
+endif
+
+# allow gprof profiling as well, which overrides the internal PROFILER
+# also enable symbols as it is useless without them
+ifdef PROFILE
+PROFILER =
+SYMBOLS = 1
+ifndef SYMLEVEL
+SYMLEVEL = 1
+endif
+endif
+
+# specify a default optimization level if none explicitly stated
+ifndef OPTIMIZE
+ifndef SYMBOLS
+OPTIMIZE = 3
+else
+OPTIMIZE = 0
+endif
+endif
+
+# set the symbols level
+ifdef SYMBOLS
+ifndef SYMLEVEL
+SYMLEVEL = 2
+endif
+endif
+
+ifdef SYMBOLS
+PARAMS+= --SYMBOLS=$(SYMBOLS)
+endif
+
+ifdef SYMLEVEL
+PARAMS+= --SYMLEVEL=$(SYMLEVEL)
+endif
+
+ifdef PROFILER
+PARAMS+= --PROFILER=$(PROFILER)
+endif
+
+ifdef PROFILE
+PARAMS+= --PROFILE=$(PROFILE)
+endif
+
+ifdef OPTIMIZE
+PARAMS+= --OPTIMIZE=$(OPTIMIZE)
+endif
+
+ifdef ARCHOPTS
+PARAMS+= --ARCHOPTS=$(ARCHOPTS)
+endif
+
+ifdef MAP
+PARAMS+= --MAP=$(MAP)
+endif
+
# extension for executables
EXE =