bake-toolkit 2.23.12 → 2.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,78 +1,78 @@
1
- require 'common/version'
2
-
3
- module Bake
4
-
5
- class Usage
6
-
7
- def self.version
8
- Bake::Version.printBakeVersion
9
- ExitHelper.exit(0)
10
- end
11
-
12
-
13
- def self.show
14
- Bake::Version.printBakeVersion
15
- puts "\nUsage: bake [options]"
16
- puts " [-b] <name> Config name of main project"
17
- puts " -m <dir> Directory of main project (default is current directory)."
18
- puts " -p <dir> Project to build/clean (default is main project)"
19
- puts " -f <name> Build/Clean this file only."
20
- puts " -c Clean the file/project."
21
- puts " -a <scheme> Use ansi color sequences (console must-- support it). Possible values are 'white' and 'black'."
22
- puts " -v<level> Verbose level from 0 to 3, whereas -v0 is less, -v1 is normal (default) and -v2 and -v3 are more verbose."
23
- puts " -r Stop on first error."
24
- puts " -w <root> Add a workspace root (can be used multiple times)."
25
- puts " If no root is specified, the parent directory of the main project is added automatically."
26
- puts " --list Lists all configs with a DefaultToolchain."
27
- puts " --rebuild Clean before build."
28
- puts " --clobber Clean the file/project (same as option -c) AND the bake cache files."
29
- puts " --prepro Stop after preprocessor."
30
- puts " --link-only Only link executables - doesn't update objects and archives or start PreSteps and PostSteps."
31
- puts " Forces executables to be relinked."
32
- puts " --compile-only Only the compile steps are executed, equivalent to -f '.'"
33
- puts " --generate-doc Builds docu instead of compiling sources."
34
- puts " --lint Performs Lint checks instead of compiling sources."
35
- puts " --lint-min <num> If number of files in a project is too large for lint to handle, it is possible"
36
- puts " to specify only a part of the file list to lint (default -1)."
37
- puts " --lint-max <num> See above (default -1)."
38
- puts " --ignore-cache Rereads the original meta files - usefull if workspace structure has been changed."
39
- puts " -j <num> Set NUMBER of parallel compiled files (default is 8)."
40
- puts " --socket <num> Set SOCKET for sending errors, receiving commands, etc. - used by e.g. Eclipse."
41
- puts " --toolchain-info <name> Prints default values of a toolchain."
42
- puts " --toolchain-names Prints available toolchains."
43
- puts " --dot <filename> Creates a .dot file of the config dependencies."
44
- puts " --do <name> Includes steps with this filter name (can be used multiple times)."
45
- puts " 'PRE', 'POST', 'STARTUP' or 'EXIT' includes all according steps."
46
- puts " --omit <name> Excludes steps with this filter name (can be used multiple times)."
47
- puts " 'PRE', 'POST', 'STARTUP' or 'EXIT' excludes all according steps."
48
- puts " --abs-paths Compiler prints absolute filename paths instead of relative paths."
49
- puts " --Wparse The error parser result is also taken into account, not only the return value of compiler, archiver and linker."
50
- puts " --no-autodir Disable auto completion of paths like in IncludeDir"
51
- puts " --set <key>=<value> Sets a variable. Overwrites variables defined in Project.metas (can be used multiple times)."
52
- puts " --adapt <name> Specifies an adapt project to manipulate the configs (can be used multiple times)"
53
- puts " --incs-and-defs=json Prints includes and defines of all projects in json format"
54
- puts " --incs-and-defs=bake Used by IDEs plugins"
55
- puts " --conversion-info Prints infos for an external tool which converts bake configs for other build systems"
56
- # puts " --bundle <dir> Bundles the output (experimental, description will follow)"
57
- puts " --prebuild Does not build configs which are marked as 'prebuild', this feature is used for distributions."
58
- puts " --compilation-db [<fn>] Writes compilation information into filename fn in json format, default for fn is compilation-db.json"
59
- puts " --create exe|lib|custom Creates a project with exe, lib or custom template"
60
- puts " --link-2-17 DEPRECATED: Using link order of libraries which was used until bake 2.17"
61
- puts " --build_ DEPRECATED: build directories will be build_<name> instead of build/<name>"
62
- puts " --version Print version."
63
- puts " --time Print elapsed time at the end."
64
- puts " --doc Open documentation in browser"
65
- puts " -h, --help Print this help."
66
- puts " --license Print the license."
67
- puts " --debug Print out backtraces in some cases - used only for debugging bake."
68
- ExitHelper.exit(0)
69
- end
70
-
71
- def self.bundle
72
- puts "\nOption --bundle not supported anymore, please contact the author via github if still needed."
73
- ExitHelper.exit(1)
74
- end
75
-
76
- end
77
-
1
+ require 'common/version'
2
+
3
+ module Bake
4
+
5
+ class Usage
6
+
7
+ def self.version
8
+ Bake::Version.printBakeVersion
9
+ ExitHelper.exit(0)
10
+ end
11
+
12
+
13
+ def self.show
14
+ Bake::Version.printBakeVersion
15
+ puts "\nUsage: bake [options]"
16
+ puts " [-b] <name> Config name of main project"
17
+ puts " -m <dir> Directory of main project (default is current directory)."
18
+ puts " -p <dir> Project to build/clean (default is main project)"
19
+ puts " -f <name> Build/Clean this file only."
20
+ puts " -c Clean the file/project."
21
+ puts " -a <scheme> Use ansi color sequences (console must-- support it). Possible values are 'white' and 'black'."
22
+ puts " -v<level> Verbose level from 0 to 3, whereas -v0 is less, -v1 is normal (default) and -v2 and -v3 are more verbose."
23
+ puts " -r Stop on first error."
24
+ puts " -w <root> Add a workspace root (can be used multiple times)."
25
+ puts " If no root is specified, the parent directory of the main project is added automatically."
26
+ puts " --list Lists all configs with a DefaultToolchain."
27
+ puts " --rebuild Clean before build."
28
+ puts " --clobber Clean the file/project (same as option -c) AND the bake cache files."
29
+ puts " --prepro Stop after preprocessor."
30
+ puts " --link-only Only link executables - doesn't update objects and archives or start PreSteps and PostSteps."
31
+ puts " Forces executables to be relinked."
32
+ puts " --compile-only Only the compile steps are executed, equivalent to -f '.'"
33
+ puts " --generate-doc Builds docu instead of compiling sources."
34
+ puts " --lint Performs Lint checks instead of compiling sources."
35
+ puts " --lint-min <num> If number of files in a project is too large for lint to handle, it is possible"
36
+ puts " to specify only a part of the file list to lint (default -1)."
37
+ puts " --lint-max <num> See above (default -1)."
38
+ puts " --ignore-cache Rereads the original meta files - usefull if workspace structure has been changed."
39
+ puts " -j <num> Set NUMBER of parallel compiled files (default is 8)."
40
+ puts " --socket <num> Set SOCKET for sending errors, receiving commands, etc. - used by e.g. Eclipse."
41
+ puts " --toolchain-info <name> Prints default values of a toolchain."
42
+ puts " --toolchain-names Prints available toolchains."
43
+ puts " --dot <filename> Creates a .dot file of the config dependencies."
44
+ puts " --do <name> Includes steps with this filter name (can be used multiple times)."
45
+ puts " 'PRE', 'POST', 'STARTUP' or 'EXIT' includes all according steps."
46
+ puts " --omit <name> Excludes steps with this filter name (can be used multiple times)."
47
+ puts " 'PRE', 'POST', 'STARTUP' or 'EXIT' excludes all according steps."
48
+ puts " --abs-paths Compiler prints absolute filename paths instead of relative paths."
49
+ puts " --Wparse The error parser result is also taken into account, not only the return value of compiler, archiver and linker."
50
+ puts " --no-autodir Disable auto completion of paths like in IncludeDir"
51
+ puts " --set <key>=<value> Sets a variable. Overwrites variables defined in Project.metas (can be used multiple times)."
52
+ puts " --adapt <name> Specifies an adapt project to manipulate the configs (can be used multiple times)"
53
+ puts " --incs-and-defs=json Prints includes and defines of all projects in json format"
54
+ puts " --incs-and-defs=bake Used by IDEs plugins"
55
+ puts " --conversion-info Prints infos for an external tool which converts bake configs for other build systems"
56
+ # puts " --bundle <dir> Bundles the output (experimental, description will follow)"
57
+ puts " --prebuild Does not build configs which are marked as 'prebuild', this feature is used for distributions."
58
+ puts " --compilation-db [<fn>] Writes compilation information into filename fn in json format, default for fn is compilation-db.json"
59
+ puts " --create exe|lib|custom Creates a project with exe, lib or custom template"
60
+ puts " --link-2-17 DEPRECATED: Using link order of libraries which was used until bake 2.17"
61
+ puts " --build_ DEPRECATED: build directories will be build_<name> instead of build/<name>"
62
+ puts " --version Print version."
63
+ puts " --time Print elapsed time at the end."
64
+ puts " --doc Open documentation in browser"
65
+ puts " -h, --help Print this help."
66
+ puts " --license Print the license."
67
+ puts " --debug Print out backtraces in some cases - used only for debugging bake."
68
+ ExitHelper.exit(0)
69
+ end
70
+
71
+ def self.bundle
72
+ puts "\nOption --bundle not supported anymore, please contact the author via github if still needed."
73
+ ExitHelper.exit(1)
74
+ end
75
+
76
+ end
77
+
78
78
  end
data/lib/bake/subst.rb CHANGED
@@ -59,7 +59,7 @@ module Bake
59
59
  @@artifactName = config.artifactName.name
60
60
  else
61
61
  if Metamodel::ExecutableConfig === config
62
- @@artifactName = projName+toolchain[:LINKER][:OUTPUT_ENDING]
62
+ @@artifactName = projName+Bake::Toolchain.outputEnding(toolchain)
63
63
  elsif Metamodel::LibraryConfig === config
64
64
  @@artifactName = "lib#{projName}.a"
65
65
  end
@@ -193,10 +193,11 @@ module Bake
193
193
  out_dir = @@configTcMap[config][:OUTPUT_DIR]
194
194
  end
195
195
  if not out_dir
196
+ qacPart = Bake.options.qac ? (".qac" + Bake.options.buildDirDelimiter) : ""
196
197
  if out_proj_name == Bake.options.main_project_name and out_conf_name == Bake.options.build_config
197
- out_dir = "build" + Bake.options.buildDirDelimiter + Bake.options.build_config
198
+ out_dir = "build" + Bake.options.buildDirDelimiter + qacPart + Bake.options.build_config
198
199
  else
199
- out_dir = "build" + Bake.options.buildDirDelimiter + out_conf_name + "_" + Bake.options.main_project_name + "_" + Bake.options.build_config
200
+ out_dir = "build" + Bake.options.buildDirDelimiter + qacPart + out_conf_name + "_" + Bake.options.main_project_name + "_" + Bake.options.build_config
200
201
  end
201
202
  end
202
203
  out_dir = substString(out_dir, elem)
@@ -1,147 +1,154 @@
1
- module Bake
2
- module Toolchain
3
-
4
- class Provider
5
- @@settings = {}
6
- @@default = {
7
- :COMPILER =>
8
- {
9
- :CPP => {
10
- :COMMAND => "",
11
- :DEFINE_FLAG => "",
12
- :OBJECT_FILE_FLAG => "",
13
- :OBJECT_FILE_ENDING => ".o",
14
- :OBJ_FLAG_SPACE => false,
15
- :INCLUDE_PATH_FLAG => "",
16
- :COMPILE_FLAGS => "",
17
- :DEFINES => [],
18
- :FLAGS => "",
19
- :SOURCE_FILE_ENDINGS => [".cxx", ".cpp", ".c++", ".cc", ".C"],
20
- :DEP_FLAGS => "",
21
- :DEP_FLAGS_SPACE => false,
22
- :DEP_FLAGS_FILENAME => true,
23
- :ERROR_PARSER => nil,
24
- :PREPRO_FLAGS => "",
25
- :PREPRO_FILE_FLAG => nil
26
- },
27
- :C => {
28
- :COMMAND => "",
29
- :DEFINE_FLAG => "",
30
- :OBJECT_FILE_FLAG => "",
31
- :OBJECT_FILE_ENDING => ".o",
32
- :OBJ_FLAG_SPACE => false,
33
- :INCLUDE_PATH_FLAG => "",
34
- :COMPILE_FLAGS => "",
35
- :DEFINES => [],
36
- :FLAGS => "",
37
- :SOURCE_FILE_ENDINGS => [".c"],
38
- :DEP_FLAGS => "",
39
- :DEP_FLAGS_SPACE => false,
40
- :DEP_FLAGS_FILENAME => true,
41
- :ERROR_PARSER => nil,
42
- :PREPRO_FLAGS => "",
43
- :PREPRO_FILE_FLAG => nil
44
- },
45
- :ASM => {
46
- :COMMAND => "",
47
- :DEFINE_FLAG => "",
48
- :OBJECT_FILE_FLAG => "",
49
- :OBJECT_FILE_ENDING => ".o",
50
- :OBJ_FLAG_SPACE => false,
51
- :INCLUDE_PATH_FLAG => "",
52
- :COMPILE_FLAGS => "",
53
- :DEFINES => [],
54
- :FLAGS => "",
55
- :SOURCE_FILE_ENDINGS => [".asm", ".s", ".S"],
56
- :DEP_FLAGS => "",
57
- :DEP_FLAGS_SPACE => false,
58
- :DEP_FLAGS_FILENAME => true,
59
- :ERROR_PARSER => nil,
60
- :PREPRO_FLAGS => "",
61
- :PREPRO_FILE_FLAG => nil
62
- }
63
- },
64
-
65
- :ARCHIVER =>
66
- {
67
- :COMMAND => "",
68
- :ARCHIVE_FLAGS => "",
69
- :ARCHIVE_FLAGS_SPACE => true,
70
- :FLAGS => "",
71
- :ERROR_PARSER => nil
72
- },
73
-
74
- :LINKER =>
75
- {
76
- :COMMAND => "",
77
- :MUST_FLAGS => "",
78
- :SCRIPT => "",
79
- :USER_LIB_FLAG => "",
80
- :EXE_FLAG => "",
81
- :EXE_FLAG_SPACE => true,
82
- :LIB_FLAG => "",
83
- :LIB_PATH_FLAG => "",
84
- :LIB_PREFIX_FLAGS => "", # "-Wl,--whole-archive",
85
- :LIB_POSTFIX_FLAGS => "", # "-Wl,--no-whole-archive",
86
- :FLAGS => "",
87
- :MAP_FILE_FLAG => "",
88
- :MAP_FILE_PIPE => true,
89
- :OUTPUT_ENDING => ".exe", # or .elf
90
- :ERROR_PARSER => nil,
91
- :LIST_MODE => false
92
- },
93
-
94
- :MAKE =>
95
- {
96
- :COMMAND => "make",
97
- :FLAGS => "-j",
98
- :FILE_FLAG => "-f",
99
- :DIR_FLAG => "-C",
100
- :CLEAN => "clean"
101
- },
102
-
103
- :LINT_POLICY => [],
104
- :DEP_FILE_SINGLE_LINE => false,
105
- :DOCU => ""
106
- }
107
-
108
- def self.add(name, basedOn = nil)
109
- chain = Marshal.load(Marshal.dump(basedOn.nil? ? @@default : @@settings[basedOn]))
110
- @@settings[name] = chain
111
- chain
112
- end
113
-
114
- def self.default
115
- @@default
116
- end
117
-
118
- def self.modify_cpp_compiler(based_on, h)
119
- chain = Marshal.load(Marshal.dump(@@settings[based_on]))
120
- chain[:COMPILER][:CPP].update(h)
121
- chain
122
- end
123
-
124
- def self.[](name)
125
- return @@settings[name] if @@settings.include? name
126
- nil
127
- end
128
-
129
- def self.list
130
- return @@settings.delete_if {|x| x.include?"Lint" }
131
- end
132
-
133
- end
134
-
135
- end
136
- end
137
-
138
- require 'bake/toolchain/diab'
139
- require 'bake/toolchain/gcc'
140
- require 'bake/toolchain/lint'
141
- require 'bake/toolchain/clang'
142
- require 'bake/toolchain/clang_analyze'
143
- require 'bake/toolchain/ti'
144
- require 'bake/toolchain/greenhills'
145
- require 'bake/toolchain/keil'
146
- require 'bake/toolchain/msvc'
147
- require 'bake/toolchain/gcc_env'
1
+ module Bake
2
+ module Toolchain
3
+
4
+ def self.outputEnding(tcs = nil)
5
+ if tcs && tcs[:LINKER][:OUTPUT_ENDING] != ""
6
+ return tcs[:LINKER][:OUTPUT_ENDING]
7
+ end
8
+ Bake::Utils::OS.windows? ? ".exe" : ""
9
+ end
10
+
11
+ class Provider
12
+ @@settings = {}
13
+ @@default = {
14
+ :COMPILER =>
15
+ {
16
+ :CPP => {
17
+ :COMMAND => "",
18
+ :DEFINE_FLAG => "",
19
+ :OBJECT_FILE_FLAG => "",
20
+ :OBJECT_FILE_ENDING => ".o",
21
+ :OBJ_FLAG_SPACE => false,
22
+ :INCLUDE_PATH_FLAG => "",
23
+ :COMPILE_FLAGS => "",
24
+ :DEFINES => [],
25
+ :FLAGS => "",
26
+ :SOURCE_FILE_ENDINGS => [".cxx", ".cpp", ".c++", ".cc", ".C"],
27
+ :DEP_FLAGS => "",
28
+ :DEP_FLAGS_SPACE => false,
29
+ :DEP_FLAGS_FILENAME => true,
30
+ :ERROR_PARSER => nil,
31
+ :PREPRO_FLAGS => "",
32
+ :PREPRO_FILE_FLAG => nil
33
+ },
34
+ :C => {
35
+ :COMMAND => "",
36
+ :DEFINE_FLAG => "",
37
+ :OBJECT_FILE_FLAG => "",
38
+ :OBJECT_FILE_ENDING => ".o",
39
+ :OBJ_FLAG_SPACE => false,
40
+ :INCLUDE_PATH_FLAG => "",
41
+ :COMPILE_FLAGS => "",
42
+ :DEFINES => [],
43
+ :FLAGS => "",
44
+ :SOURCE_FILE_ENDINGS => [".c"],
45
+ :DEP_FLAGS => "",
46
+ :DEP_FLAGS_SPACE => false,
47
+ :DEP_FLAGS_FILENAME => true,
48
+ :ERROR_PARSER => nil,
49
+ :PREPRO_FLAGS => "",
50
+ :PREPRO_FILE_FLAG => nil
51
+ },
52
+ :ASM => {
53
+ :COMMAND => "",
54
+ :DEFINE_FLAG => "",
55
+ :OBJECT_FILE_FLAG => "",
56
+ :OBJECT_FILE_ENDING => ".o",
57
+ :OBJ_FLAG_SPACE => false,
58
+ :INCLUDE_PATH_FLAG => "",
59
+ :COMPILE_FLAGS => "",
60
+ :DEFINES => [],
61
+ :FLAGS => "",
62
+ :SOURCE_FILE_ENDINGS => [".asm", ".s", ".S"],
63
+ :DEP_FLAGS => "",
64
+ :DEP_FLAGS_SPACE => false,
65
+ :DEP_FLAGS_FILENAME => true,
66
+ :ERROR_PARSER => nil,
67
+ :PREPRO_FLAGS => "",
68
+ :PREPRO_FILE_FLAG => nil
69
+ }
70
+ },
71
+
72
+ :ARCHIVER =>
73
+ {
74
+ :COMMAND => "",
75
+ :ARCHIVE_FLAGS => "",
76
+ :ARCHIVE_FLAGS_SPACE => true,
77
+ :FLAGS => "",
78
+ :ERROR_PARSER => nil
79
+ },
80
+
81
+ :LINKER =>
82
+ {
83
+ :COMMAND => "",
84
+ :MUST_FLAGS => "",
85
+ :SCRIPT => "",
86
+ :USER_LIB_FLAG => "",
87
+ :EXE_FLAG => "",
88
+ :EXE_FLAG_SPACE => true,
89
+ :LIB_FLAG => "",
90
+ :LIB_PATH_FLAG => "",
91
+ :LIB_PREFIX_FLAGS => "", # "-Wl,--whole-archive",
92
+ :LIB_POSTFIX_FLAGS => "", # "-Wl,--no-whole-archive",
93
+ :FLAGS => "",
94
+ :MAP_FILE_FLAG => "",
95
+ :MAP_FILE_PIPE => true,
96
+ :OUTPUT_ENDING => "", # if empty, .exe is used on Windows, otherwise no ending
97
+ :ERROR_PARSER => nil,
98
+ :LIST_MODE => false
99
+ },
100
+
101
+ :MAKE =>
102
+ {
103
+ :COMMAND => "make",
104
+ :FLAGS => "-j",
105
+ :FILE_FLAG => "-f",
106
+ :DIR_FLAG => "-C",
107
+ :CLEAN => "clean"
108
+ },
109
+
110
+ :LINT_POLICY => [],
111
+ :DEP_FILE_SINGLE_LINE => false,
112
+ :DOCU => ""
113
+ }
114
+
115
+ def self.add(name, basedOn = nil)
116
+ chain = Marshal.load(Marshal.dump(basedOn.nil? ? @@default : @@settings[basedOn]))
117
+ @@settings[name] = chain
118
+ chain
119
+ end
120
+
121
+ def self.default
122
+ @@default
123
+ end
124
+
125
+ def self.modify_cpp_compiler(based_on, h)
126
+ chain = Marshal.load(Marshal.dump(@@settings[based_on]))
127
+ chain[:COMPILER][:CPP].update(h)
128
+ chain
129
+ end
130
+
131
+ def self.[](name)
132
+ return @@settings[name] if @@settings.include? name
133
+ nil
134
+ end
135
+
136
+ def self.list
137
+ return @@settings.delete_if {|x| x.include?"Lint" }
138
+ end
139
+
140
+ end
141
+
142
+ end
143
+ end
144
+
145
+ require 'bake/toolchain/diab'
146
+ require 'bake/toolchain/gcc'
147
+ require 'bake/toolchain/lint'
148
+ require 'bake/toolchain/clang'
149
+ require 'bake/toolchain/clang_analyze'
150
+ require 'bake/toolchain/ti'
151
+ require 'bake/toolchain/greenhills'
152
+ require 'bake/toolchain/keil'
153
+ require 'bake/toolchain/msvc'
154
+ require 'bake/toolchain/gcc_env'