summaryrefslogtreecommitdiff
path: root/CC
diff options
context:
space:
mode:
Diffstat (limited to 'CC')
-rw-r--r--CC/RULES55
1 files changed, 55 insertions, 0 deletions
diff --git a/CC/RULES b/CC/RULES
index 0f1b0ff..eddf0b7 100644
--- a/CC/RULES
+++ b/CC/RULES
@@ -14,10 +14,12 @@
, "CXXFLAGS"
, "LDFLAGS"
, "ARFLAGS"
+ , "DEBUGFLAGS"
, "ADD_COMPILE_FLAGS"
, "ADD_CFLAGS"
, "ADD_CXXFLAGS"
, "ADD_LDFLAGS"
+ , "ADD_DEBUGFLAGS"
, "AR"
, "PATH"
, "SYSTEM_TOOLS"
@@ -63,6 +65,11 @@
, "object files. If the \"ARFLAGS\" specified in the defaults target are"
, "empty, the rules will use [\"cqs\"]."
]
+ , "DEBUGFLAGS":
+ [ "Flags to be used for the debug-stage for both C and C++, instead of"
+ , "the resulting CFLAGS and CXXFLAGS, respectively."
+ , "Specifying this field overwrites values from \"base\"."
+ ]
, "ADD_COMPILE_FLAGS":
[ "Additional compilation flags for C and C++. Specifying this field"
, "extends values from \"base\" for both, \"CFLAGS\" and \"CXXFLAGS\"."
@@ -79,6 +86,11 @@
[ "Additional linker flags for linking the final CC library. Specifying"
, "this field extends values from \"base\"."
]
+ , "ADD_DEBUGFLAGS":
+ [ "Additional compilation flags for the debug-stage. Specifying this"
+ , "field extends values from \"base\" for both, \"CFLAGS\" and"
+ , "\"CXXFLAGS\"."
+ ]
, "PATH":
[ "Path for looking up the compilers. Individual paths are joined"
, "with \":\". Specifying this field extends values from \"base\"."
@@ -119,6 +131,7 @@
, ["CXXFLAGS", {"type": "FIELD", "name": "CXXFLAGS"}]
, ["LDFLAGS", {"type": "FIELD", "name": "LDFLAGS"}]
, ["ARFLAGS", {"type": "FIELD", "name": "ARFLAGS"}]
+ , ["DEBUGFLAGS", {"type": "FIELD", "name": "DEBUGFLAGS"}]
, ["AR", {"type": "FIELD", "name": "AR"}]
, ["PATH", {"type": "FIELD", "name": "PATH"}]
, ["provider", "CC"]
@@ -169,6 +182,14 @@
, "else": {"type": "CALL_EXPRESSION", "name": "base-provides-++"}
}
]
+ , ["provider", "DEBUGFLAGS"]
+ , [ "DEBUGFLAGS"
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "DEBUGFLAGS"}
+ , "then": {"type": "var", "name": "DEBUGFLAGS"}
+ , "else": {"type": "CALL_EXPRESSION", "name": "base-provides-++"}
+ }
+ ]
, ["provider", "AR"]
, [ "AR"
, { "type": "if"
@@ -308,6 +329,40 @@
]
}
]
+ , [ "CFLAGS"
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "DEBUG"}
+ , "then":
+ { "type": "++"
+ , "$1":
+ [ { "type": "if"
+ , "cond": {"type": "var", "name": "DEBUGFLAGS"}
+ , "then": {"type": "var", "name": "DEBUGFLAGS"}
+ , "else": {"type": "var", "name": "CFLAGS"}
+ }
+ , {"type": "FIELD", "name": "ADD_DEBUGFLAGS"}
+ ]
+ }
+ , "else": {"type": "var", "name": "CFLAGS"}
+ }
+ ]
+ , [ "CXXFLAGS"
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "DEBUG"}
+ , "then":
+ { "type": "++"
+ , "$1":
+ [ { "type": "if"
+ , "cond": {"type": "var", "name": "DEBUGFLAGS"}
+ , "then": {"type": "var", "name": "DEBUGFLAGS"}
+ , "else": {"type": "var", "name": "CXXFLAGS"}
+ }
+ , {"type": "FIELD", "name": "ADD_DEBUGFLAGS"}
+ ]
+ }
+ , "else": {"type": "var", "name": "CXXFLAGS"}
+ }
+ ]
, ["deps-fieldnames", ["base", "deps"]]
, ["compile-deps", {"type": "CALL_EXPRESSION", "name": "compile-deps"}]
, [ "compile-args"