rakeoe 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2fbe6da29cfe5dab5316240a65e92968b05474db
4
- data.tar.gz: afaab703e8c86e60895de7ba6dc67029a1217755
3
+ metadata.gz: e5b4889f8d03d07ad15a14a56daace5e4ff4022e
4
+ data.tar.gz: 1b73e5c46b144fc90f2c2d8ba348cc0eabc4f49f
5
5
  SHA512:
6
- metadata.gz: e70fd91f6c122104d154ea3337a90235dd3a5c2f52d721fae846380d272e75a6b0b8b782330074e6cdb7e36c328558582e18cf47f3504379c21eaa63ac7bb0b4
7
- data.tar.gz: 541a1010dbed2d44915fbcada5c10f376f34372870410dfe20c1a772abd13fc8c99d3e16e6ec7755850ef6fac179c0adede5a24f2df4807167a3f89298af4a03
6
+ metadata.gz: 710af6324c7c75ecbf7f72165b6141e1a3613a4df8c2c62c3eac4f94d5e9819990ea3700cc246e643919ca55a75c1fe7b1b1b574c0832d00c15c3320af3c0b81
7
+ data.tar.gz: 9dfd5d613c237b0068a52aa349cf66cf1994b6c6fc9cf2ef937d22ba814ba8cb84577604913dd554f40a991e8de76abd4a43449094c234c337c0ac76728d1525
data/lib/rakeoe/app.rb CHANGED
@@ -52,7 +52,7 @@ module RakeOE
52
52
  # create build directory
53
53
  directory build_dir
54
54
 
55
- binary_targets = paths_of_local_libs() + @app_main_dep + @app_main_obj + [@settings['PRJ_FILE']]
55
+ binary_targets = paths_of_local_libs() + @app_main_dep + @app_main_obj
56
56
 
57
57
  # This is only necessary if we have more than a single app main file
58
58
  if @app_lib_objs.any?
@@ -67,7 +67,6 @@ module RakeOE
67
67
 
68
68
  @objs = @srcs.map {|file| source_to_obj(file, @src_dir, @build_dir)}
69
69
  @test_objs = @test_srcs.map {|file| source_to_obj(file, @src_dir, @build_dir)}
70
-
71
70
  @deps = @objs.map {|obj| obj.ext('.d')}
72
71
  @test_deps = @test_objs.map {|obj| obj.ext('.d')}
73
72
 
@@ -75,6 +74,11 @@ module RakeOE
75
74
  load_deps(@deps)
76
75
  load_deps(@test_deps)
77
76
 
77
+ # all objs are dependent on project file and platform file
78
+ (@objs+@test_objs).each do |obj|
79
+ file obj => [@settings['PRJ_FILE'], @tc.config.platform]
80
+ end
81
+
78
82
  if (@settings['TEST_FRAMEWORK'].nil? or @settings['TEST_FRAMEWORK'].empty?)
79
83
  @test_fw = @tc.default_test_framework
80
84
  else
@@ -365,14 +369,15 @@ module RakeOE
365
369
 
366
370
  incs = inc_dirs
367
371
  # find platform specific resource flags
368
- # XXX DS
369
372
  libs = search_libs(@settings)
370
373
  libs[:all].each do |name|
371
374
  platform_settings = tc.res_platform_settings(name)
372
- if platform_settings.values.any?
373
- @settings['ADD_CFLAGS'] += " #{platform_settings['CFLAGS']}" if platform_settings['CFLAGS']
374
- @settings['ADD_CXXFLAGS'] += " #{platform_settings['CXXFLAGS']}" if platform_settings['CXXFLAGS']
375
- @settings['ADD_LDFLAGS'] += " #{platform_settings['LDFLAGS']}" if platform_settings['LDFLAGS']
375
+ unless platform_settings.empty?
376
+ @settings['ADD_CFLAGS'] += " #{platform_settings[:CFLAGS]}" if platform_settings[:CFLAGS]
377
+ @settings['ADD_CXXFLAGS'] += " #{platform_settings[:CXXFLAGS]}" if platform_settings[:CXXFLAGS]
378
+ # platform_settings[:LDFLAGS] is set in Toolchain#linker_line_for
379
+ # XXX: remove all -lXX settings from platform_settings[:LDFLAGS] and add rest to @settings['ADD_LDFLAGS'],
380
+ # XXX: use all -lXX in Toolchain#linker_line_for
376
381
  end
377
382
  end
378
383
 
data/lib/rakeoe/lib.rb CHANGED
@@ -34,7 +34,7 @@ module RakeOE
34
34
 
35
35
  task name => [binary]
36
36
 
37
- file binary => paths_of_local_libs + deps + objs + [@settings['PRJ_FILE']] do
37
+ file binary => paths_of_local_libs + deps + objs do
38
38
  tc.lib(:objects => objs,
39
39
  :lib => binary,
40
40
  :settings => @settings)
@@ -294,7 +294,15 @@ class Toolchain
294
294
  # @return [String] Linker line
295
295
  #
296
296
  def linker_line_for(libs)
297
- libs.map { |lib| "-l#{lib}" }.join(' ').strip
297
+ libs.map do |lib|
298
+ settings = res_platform_settings(lib)
299
+ if settings[:LDFLAGS].nil?
300
+ # automatic linker line if no platform specific LDFLAGS exist
301
+ "-l#{lib}"
302
+ else
303
+ settings[:LDFLAGS]
304
+ end
305
+ end.join(' ').strip
298
306
  end
299
307
 
300
308
  # Touches a file
@@ -310,15 +318,16 @@ class Toolchain
310
318
  # @param resource_name [String] name of resource
311
319
  # @return [Hash] Hash of compilation/linkage flags or empty hash if no settings are defined
312
320
  # The returned hash has the following format:
313
- # { 'CFLAGS' => '...', 'CXXFLAGS' => '...', 'LDFLAGS' => '...'}
321
+ # { :CFLAGS => '...', :CXXFLAGS => '...', :LDFLAGS => '...'}
314
322
  #
315
323
  def res_platform_settings(resource_name)
316
324
  return {} if resource_name.empty?
317
325
 
318
326
  rv = Hash.new
319
- rv['CFLAGS'] = @settings["#{resource_name}_CFLAGS"]
320
- rv['CXXFLAGS'] = @settings["#{resource_name}_CXXFLAGS"]
321
- rv['LDFLAGS'] = @settings["#{resource_name}_LDFLAGS"]
327
+ rv[:CFLAGS] = @settings["#{resource_name}_CFLAGS"]
328
+ rv[:CXXFLAGS]= @settings["#{resource_name}_CXXFLAGS"]
329
+ rv[:LDFLAGS] = @settings["#{resource_name}_LDFLAGS"]
330
+ rv = {} if rv.values.empty?
322
331
  rv
323
332
  end
324
333
 
@@ -1,3 +1,3 @@
1
1
  module RakeOE
2
- VERSION = "0.0.3"
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rakeoe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schnell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-28 00:00:00.000000000 Z
11
+ date: 2014-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler