cxxproject 0.5.66 → 0.5.67

Sign up to get free protection for your applications and to get access to all the features.
@@ -141,11 +141,14 @@ module Cxxproject
141
141
  cmd << linker[:SCRIPT] if @linker_script # -T
142
142
  cmd << @linker_script if @linker_script # xy/xy.dld
143
143
  cmd << linker[:MAP_FILE_FLAG] if @mapfile # -Wl,-m6
144
+ if not linker[:MAP_FILE_PIPE]
145
+ cmd[cmd.length-1] << @mapfile
146
+ end
144
147
  cmd += Cxxproject::Utils::flagSplit(linker[:LIB_PREFIX_FLAGS]) # "-Wl,--whole-archive "
145
148
  cmd += linker_lib_string
146
149
  cmd += Cxxproject::Utils::flagSplit(linker[:LIB_POSTFIX_FLAGS]) # "-Wl,--no-whole-archive "
147
150
 
148
- mapfileStr = @mapfile ? " >#{@mapfile}" : ""
151
+ mapfileStr = (@mapfile and linker[:MAP_FILE_PIPE]) ? " >#{@mapfile}" : ""
149
152
  if Cxxproject::Utils.old_ruby?
150
153
  cmd.map! {|c| ((c.include?(" ")) ? ("\""+c+"\"") : c )}
151
154
 
@@ -170,7 +173,7 @@ module Cxxproject
170
173
  cmdLinePrint = cmd
171
174
  printCmd(cmdLinePrint, "Linking #{get_executable_name}", false)
172
175
  cmd << {
173
- :out=> @mapfile ? "#{@mapfile}" : wr, # > xy.map
176
+ :out=> (@mapfile and linker[:MAP_FILE_PIPE]) ? "#{@mapfile}" : wr, # > xy.map
174
177
  :err=>wr
175
178
  }
176
179
 
@@ -178,7 +181,7 @@ module Cxxproject
178
181
  cmd.pop
179
182
 
180
183
  # for console print
181
- cmd << " >#{@mapfile}" if @mapfile
184
+ cmd << " >#{@mapfile}" if (@mapfile and linker[:MAP_FILE_PIPE])
182
185
  end
183
186
 
184
187
  process_result(cmdLinePrint, consoleOutput, linker[:ERROR_PARSER], nil, success)
@@ -110,7 +110,7 @@ module Cxxproject
110
110
  end
111
111
 
112
112
  def get_dep_file(object)
113
- object[0..-3] + ".o.d"
113
+ object[0..-3] + ".d"
114
114
  end
115
115
 
116
116
  def get_source_type(source)
@@ -260,17 +260,19 @@ module Cxxproject
260
260
  cmd += compiler[:COMPILE_FLAGS].split(" ")
261
261
  if dep_file
262
262
  cmd += depStr.split(" ")
263
- if the_tcs[:COMPILER][type][:DEP_FLAGS_SPACE]
264
- cmd << dep_file
265
- else
266
- cmd[cmd.length-1] << dep_file
263
+ if the_tcs[:COMPILER][type][:DEP_FLAGS_FILENAME]
264
+ if the_tcs[:COMPILER][type][:DEP_FLAGS_SPACE]
265
+ cmd << dep_file
266
+ else
267
+ cmd[cmd.length-1] << dep_file
268
+ end
267
269
  end
268
270
  end
271
+ cmd += compiler[:PREPRO_FLAGS].split(" ") if Rake::application.preproFlags
269
272
  cmd += Cxxproject::Utils::flagSplit(compiler[:FLAGS])
270
273
  cmd += i_array
271
274
  cmd += d_array
272
275
  cmd += (compiler[:OBJECT_FILE_FLAG] + objectRel).split(" ")
273
- cmd += compiler[:PREPRO_FLAGS].split(" ") if Rake::application.preproFlags
274
276
  cmd << sourceRel
275
277
 
276
278
  if Cxxproject::Utils.old_ruby?
@@ -79,9 +79,9 @@ module Cxxproject
79
79
  end
80
80
 
81
81
  cmd = [archiver[:COMMAND]] # ar
82
- cmd += archiver[:ARCHIVE_FLAGS].split(" ")
83
82
  cmd += Cxxproject::Utils::flagSplit(archiver[:FLAGS]) # --all_load
84
- cmd << aname # -o debug/x.exe
83
+ cmd += archiver[:ARCHIVE_FLAGS].split(" ")
84
+ cmd << aname
85
85
  cmd += objs
86
86
 
87
87
  if Cxxproject::Utils.old_ruby?
@@ -3,24 +3,37 @@ require 'cxxproject/errorparser/error_parser'
3
3
  module Cxxproject
4
4
  class GreenHillsLinkerErrorParser < ErrorParser
5
5
 
6
+ # detect this:
7
+
8
+ # C++ prelinker: recompiling "x/y.z"
9
+ # "blah.h", line 1: warning #123-D: expression has no effect
10
+ # uiuiui
11
+ # ^
12
+ # detected during:
13
+ # instantiation of ...
14
+
15
+ # dblink: WARNING: 10 problems were encountered while processing debug information, see "Debug/xy.dle" for details.
16
+
6
17
  def initialize()
7
- # todo: is every line an error?
18
+ @error_expression = /ld: (.+)/
8
19
  end
9
20
 
10
21
  def scan_lines(consoleOutput, proj_dir)
11
22
  res = []
23
+ error_severity = 255
12
24
  consoleOutput.each_line do |l|
13
25
  l.rstrip!
14
26
  d = ErrorDesc.new
15
- d.file_name = proj_dir
16
- d.line_number = 0
17
- d.message = l
18
- if l.length == 0
19
- d.severity = SEVERITY_OK
20
- elsif l.include?" Warning:"
21
- d.severity = SEVERITY_WARNING
22
- else
27
+ scan_res = l.scan(@error_expression)
28
+ if scan_res.length == 0 # msg will end with the beginning of the next message
29
+ d.severity = error_severity
30
+ d.message = l
31
+ elsif scan_res.length > 0
32
+ d.file_name = proj_dir
33
+ d.line_number = 0
34
+ d.message = scan_res[0][0]
23
35
  d.severity = SEVERITY_ERROR
36
+ error_severity = d.severity
24
37
  end
25
38
  res << d
26
39
  end
@@ -9,36 +9,35 @@ module Cxxproject
9
9
  GreenHillsChain = Provider.add("GreenHills")
10
10
 
11
11
  GreenHillsChain[:COMPILER][:C].update({
12
- :COMMAND => "ccppc",
12
+ :COMMAND => "cxppc",
13
13
  :FLAGS => "",
14
14
  :DEFINE_FLAG => "-D",
15
15
  :OBJECT_FILE_FLAG => "-o ",
16
16
  :INCLUDE_PATH_FLAG => "-I",
17
17
  :COMPILE_FLAGS => "-c",
18
- :DEP_FLAGS => "-Xmake-dependency=6 -Xmake-dependency-savefile=", # -MMD ok, -MF missing?
19
- :DEP_FLAGS_SPACE => false,
20
- :PREPRO_FLAGS => "-P" # -E (stdout, oder -o ...)? wahrscheinlich aber -P
18
+ :DEP_FLAGS => "-MMD",
19
+ :DEP_FLAGS_FILENAME => false,
20
+ :PREPRO_FLAGS => "-P"
21
21
  })
22
22
 
23
23
  GreenHillsChain[:COMPILER][:CPP] = Utils.deep_copy(GreenHillsChain[:COMPILER][:C])
24
24
  GreenHillsChain[:COMPILER][:CPP][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:CPP][:SOURCE_FILE_ENDINGS]
25
25
 
26
26
  GreenHillsChain[:COMPILER][:ASM] = Utils.deep_copy(GreenHillsChain[:COMPILER][:C])
27
- GreenHillsChain[:COMPILER][:ASM][:COMMAND] = "asppc" # ??
28
- GreenHillsChain[:COMPILER][:ASM][:COMPILE_FLAGS] = ""
29
27
  GreenHillsChain[:COMPILER][:ASM][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:ASM][:SOURCE_FILE_ENDINGS]
30
28
  GreenHillsChain[:COMPILER][:ASM][:PREPRO_FLAGS] = ""
31
29
 
32
- GreenHillsChain[:ARCHIVER][:COMMAND] = "ccppc" # ??
33
- GreenHillsChain[:ARCHIVER][:ARCHIVE_FLAGS] = "-rc" # -archive ??
30
+ GreenHillsChain[:ARCHIVER][:COMMAND] = "cxppc"
31
+ GreenHillsChain[:ARCHIVER][:ARCHIVE_FLAGS] = "-archive -o"
34
32
 
35
- GreenHillsChain[:LINKER][:COMMAND] = "ccppc" # ??
36
- GreenHillsChain[:LINKER][:SCRIPT] = "-Wm" # -T file.ld , evtl. -Wl,-T file.ld ???
37
- GreenHillsChain[:LINKER][:USER_LIB_FLAG] = "-l:" # ?? does that exist ?
33
+ GreenHillsChain[:LINKER][:COMMAND] = "cxppc" # ??
34
+ GreenHillsChain[:LINKER][:SCRIPT] = "-T" # -T file.ld
35
+ GreenHillsChain[:LINKER][:USER_LIB_FLAG] = "-l" # user lib not supported? same as lib...
38
36
  GreenHillsChain[:LINKER][:EXE_FLAG] = "-o"
39
37
  GreenHillsChain[:LINKER][:LIB_FLAG] = "-l"
40
38
  GreenHillsChain[:LINKER][:LIB_PATH_FLAG] = "-L"
41
- GreenHillsChain[:LINKER][:MAP_FILE_FLAG] = "-Wl,-m6" # -map=filename / -nomap (default)
39
+ GreenHillsChain[:LINKER][:MAP_FILE_FLAG] = "-map=" # -map=filename
40
+ GreenHillsChain[:LINKER][:MAP_FILE_PIPE] = false
42
41
  GreenHillsChain[:LINKER][:OUTPUT_ENDING] = ".elf"
43
42
 
44
43
  GreenHillsCompilerErrorParser = GreenHillsCompilerErrorParser.new
@@ -18,7 +18,8 @@ module Cxxproject
18
18
  :FLAGS => "",
19
19
  :SOURCE_FILE_ENDINGS => [".cxx", ".cpp", ".c++", ".cc", ".C"],
20
20
  :DEP_FLAGS => "",
21
- :DEP_FLAGS => true,
21
+ :DEP_FLAGS_SPACE => false,
22
+ :DEP_FLAGS_FILENAME => true,
22
23
  :ERROR_PARSER => nil,
23
24
  :PREPRO_FLAGS => ""
24
25
  },
@@ -32,6 +33,8 @@ module Cxxproject
32
33
  :FLAGS => "",
33
34
  :SOURCE_FILE_ENDINGS => [".c"],
34
35
  :DEP_FLAGS => "",
36
+ :DEP_FLAGS_SPACE => false,
37
+ :DEP_FLAGS_FILENAME => true,
35
38
  :ERROR_PARSER => nil,
36
39
  :PREPRO_FLAGS => ""
37
40
  },
@@ -45,6 +48,8 @@ module Cxxproject
45
48
  :FLAGS => "",
46
49
  :SOURCE_FILE_ENDINGS => [".asm", ".s", ".S"],
47
50
  :DEP_FLAGS => "",
51
+ :DEP_FLAGS_SPACE => false,
52
+ :DEP_FLAGS_FILENAME => true,
48
53
  :ERROR_PARSER => nil,
49
54
  :PREPRO_FLAGS => ""
50
55
  }
@@ -71,6 +76,7 @@ module Cxxproject
71
76
  :LIB_POSTFIX_FLAGS => "", # "-Wl,--no-whole-archive",
72
77
  :FLAGS => "",
73
78
  :MAP_FILE_FLAG => "",
79
+ :MAP_FILE_PIPE => true,
74
80
  :OUTPUT_ENDING => ".exe", # or .elf
75
81
  :ERROR_PARSER => nil
76
82
  },
@@ -1,7 +1,7 @@
1
1
  module Cxxproject
2
2
  class Version
3
3
  def self.cxxproject
4
- "0.5.66"
4
+ "0.5.67"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cxxproject
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.66
5
+ version: 0.5.67
6
6
  platform: ruby
7
7
  authors:
8
8
  - oliver mueller
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2013-05-29 00:00:00 Z
13
+ date: 2013-06-21 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: highline