rake_embedded 0.1.2 → 0.1.3

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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/rake_embedded/version.rb +1 -1
  4. data/rem_core.rb +41 -6
  5. data/scripts/build_functions/package_build_functions.rb +2 -1
  6. data/scripts/dependency_functions/dependency_tasks.rb +11 -0
  7. data/scripts/download_tasks/DefaultTasks.rb +8 -3
  8. data/scripts/global_config/global_config.rb +18 -12
  9. data/scripts/prepare_tasks/DefaultTasks.rb +8 -0
  10. data/tests/docker/dockerfile_debian_8.dockertest +1 -1
  11. data/tests/docker/dockerfile_debian_9.dockertest +18 -0
  12. data/tests/docker/dockerfile_ubuntu_14_04.dockertest +2 -2
  13. data/tests/docker/dockerfile_ubuntu_16_04.dockertest +20 -0
  14. data/tests/tests/TEST_append_features.sh +2 -0
  15. data/tests/tests/TEST_build_test_project.sh +2 -0
  16. data/tests/tests/TEST_check_deps_test_project.sh +2 -0
  17. data/tests/tests/TEST_global_deps.sh +21 -0
  18. data/tests/tests/TEST_remove_unused_functions.sh +2 -0
  19. metadata +6 -24
  20. data/machine_conf/8051/8051.rb +0 -23
  21. data/machine_conf/8051/C8051FXXX.rb +0 -22
  22. data/machine_conf/8051/nrf24le1_24.rb +0 -25
  23. data/machine_conf/8051/nrf24le1_32.rb +0 -24
  24. data/machine_conf/8051/nrf24le1_48.rb +0 -24
  25. data/machine_conf/arm/arm.rb +0 -24
  26. data/machine_conf/arm/stm32f1.rb +0 -24
  27. data/machine_conf/arm/stm32f3.rb +0 -28
  28. data/machine_conf/arm/stm32f4.rb +0 -28
  29. data/machine_conf/avr/atmega168.rb +0 -24
  30. data/machine_conf/avr/avr.rb +0 -25
  31. data/machine_conf/mips/PIC32.rb +0 -24
  32. data/machine_conf/mips/pic32mx2.rb +0 -24
  33. data/machine_conf/mips/pic32mz2048.rb +0 -24
  34. data/machine_conf/native/linux.rb +0 -24
  35. data/machine_conf/native/native.rb +0 -24
  36. data/scripts/compile_tasks/common/gcc_LinkPrepare.rb +0 -35
  37. data/scripts/compile_tasks/common/sdcc_LinkPrepare.rb +0 -30
  38. data/scripts/compile_tasks/gcc_tasks/DefaultTasks.rb +0 -77
  39. data/scripts/compile_tasks/make_tasks/MakeTasks.rb +0 -86
  40. data/scripts/compile_tasks/sdcc_tasks/DefaultTasks.rb +0 -80
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a2b69a274782f765ff794dc376f4caa218331b2
4
- data.tar.gz: '087e86b19f81aa91b7b5cb579dce9c952b5649ea'
3
+ metadata.gz: 8c01e1bbd57bc7dd48bb3ed81ee47b2083fd80df
4
+ data.tar.gz: 123dd3de34d4d3a34e1070b58a4d52be1c6bdc79
5
5
  SHA512:
6
- metadata.gz: 60d13bb6970c4fc3cc451699cac93c22b26b0a4f751f2556eda70882d9b4d7d3201f92f19f76e8cfb89c1a06d4203b8b6e28cf7dd4ee23d17dca807820e3aa15
7
- data.tar.gz: d4106d5fad7fbeca17f622a124db6f6aed85f642e870a305fc88bb0e866b47ff024bf814009b928285d90bf5d6e1bf7b13f120ac31f2a11ad416fc4df34ca016
6
+ metadata.gz: c56c6fe874ae25dcc4f2e32e6cdcdffcf6aecb81fc13e51b4d8d4d1c2c92bead2040d1376b79f1fa8fefff64fd37d07470b0af349105d65ffa88529699309953
7
+ data.tar.gz: 8ad5d352f0aa89370742eb11dc383240e67177c45f047bc96dc654f08c72de63bcd68c2e1c719a6069a7831344f7922d2ccfffc980f9c5ac7ed81559a302daf2
data/.travis.yml CHANGED
@@ -8,7 +8,9 @@ services:
8
8
  env:
9
9
  matrix:
10
10
  - OS_TYPE=debian OS_VERSION=8
11
+ - OS_TYPE=debian OS_VERSION=9
11
12
  - OS_TYPE=ubuntu OS_VERSION=14_04
13
+ - OS_TYPE=ubuntu OS_VERSION=16_04
12
14
 
13
15
  script:
14
16
  - bash ./tests/run_docker_test.sh ${OS_TYPE} ${OS_VERSION}
@@ -1,3 +1,3 @@
1
1
  module RakeEmbedded
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/rem_core.rb CHANGED
@@ -18,6 +18,10 @@
18
18
  along with REM. If not, see <http://www.gnu.org/licenses/>.
19
19
  =end
20
20
 
21
+ # Helper function
22
+ require_relative "scripts/misc/helper"
23
+ require_relative "scripts/misc/print_functions"
24
+
21
25
  # Global Config
22
26
  require_relative "scripts/global_config/global_config"
23
27
 
@@ -27,10 +31,21 @@ if(SIMPLECOV == "1")
27
31
  SimpleCov.start
28
32
  end
29
33
 
30
- # Machine and compiler specific
31
- require_relative "machine_conf/#{global_config.arch}/#{global_config.mach}"
32
- require_relative "scripts/compile_tasks/#{global_config.compiler}_tasks/DefaultTasks"
33
- require_relative "scripts/compile_tasks/make_tasks/MakeTasks"
34
+ # Try to find machine specific folders
35
+ machine_conf_file = nil
36
+ project_folders = global_config.get_project_folder.split(",")
37
+ project_folders.each do |folder|
38
+ if File.file?("./#{folder}/machine_conf/machine/#{global_config.arch}/#{global_config.mach}.rb")
39
+ machine_conf_file = "./#{folder}/machine_conf/machine/#{global_config.arch}/#{global_config.mach}.rb"
40
+ break
41
+ end
42
+ end
43
+
44
+ if(machine_conf_file != nil)
45
+ load "#{machine_conf_file}"
46
+ else
47
+ print_abort("No valid machine conf found!")
48
+ end
34
49
 
35
50
  # Prepare and Patch tasks:
36
51
  require_relative "scripts/download_tasks/DefaultTasks"
@@ -38,8 +53,6 @@ require_relative "scripts/prepare_tasks/DefaultTasks"
38
53
  require_relative "scripts/patch_tasks/DefaultTasks"
39
54
 
40
55
  # Generic
41
- require_relative "scripts/misc/helper"
42
- require_relative "scripts/misc/print_functions"
43
56
  require_relative "scripts/package"
44
57
  require_relative "scripts/dependency_functions/dependency_tasks"
45
58
  require_relative "scripts/dependency_functions/dependency_graph"
@@ -93,10 +106,32 @@ namespace :package do
93
106
 
94
107
  global_package_list = temp_pkgs
95
108
 
109
+ # We get a list of all dependencies of the global dependencies
110
+ # so that we eclude these from adding the global one
111
+ # otherwise we would get a lot of circular dependencies
112
+ glob_dep_list_to_exclude = []
113
+ global_config.get_global_deps.each do |glob_dep|
114
+ package_get_dependency_list(global_package_list, pkg_get_ref_by_name(global_package_list, glob_dep, glob_dep), glob_dep_list_to_exclude)
115
+ print_any_green("global_deps for #{glob_dep} #{glob_dep_list_to_exclude}")
116
+ end
117
+
96
118
  global_package_list.each do |pkg|
97
119
 
98
120
  namespace :"#{pkg.name}" do
99
121
 
122
+ # Check if the current package is not the one we are adding
123
+ # also we need to check if the current one is included in the 'excluded' list
124
+ # we also need to ensure, that we do not set the global dependency to
125
+ # another package which is also a global dependency, otherwise we would get
126
+ # a circular dependency if we would set 2 global dependencies
127
+ global_config.get_global_deps.each do |glob_dep|
128
+ if((glob_dep != pkg.name) &&
129
+ (!glob_dep_list_to_exclude.include?(pkg.name)) &&
130
+ (!global_config.get_global_deps.include?(pkg.name)) )
131
+ pkg.set_dep(glob_dep)
132
+ end
133
+ end
134
+
100
135
  task :get_dep_chain => package_add_non_file_task_dep(global_package_list, pkg.deps, "get_dep_chain", pkg.name) do
101
136
  global_dep_chain.push("#{pkg.name}")
102
137
  end
@@ -90,7 +90,8 @@ module PackageBuildFunctions
90
90
  def clean_download
91
91
  print_debug "cleaning download package #{name}"
92
92
  do_download_clean()
93
- FileUtils.rm_rf("#{pkg_dl_state_dir}")
93
+ FileUtils.rm_rf("#{pkg_dl_dir}")
94
+ FileUtils.rm_rf("#{pkg_dl_state_file}")
94
95
  end
95
96
 
96
97
  def clean_prepare
@@ -65,3 +65,14 @@ def package_add_common_task_dep_list(package_list, task_list, file_task, pkg_nam
65
65
  end
66
66
  return dep_str_array
67
67
  end
68
+
69
+ def package_get_dependency_list(package_list, pkg, dep_list)
70
+ if(pkg.deps.any?)
71
+ dep_list.concat(pkg.deps)
72
+ end
73
+ pkg.deps.each do |dep|
74
+ dep_ref = pkg_get_ref_by_name(package_list, dep, pkg.name)
75
+ package_get_dependency_list(package_list, dep_ref, dep_list)
76
+ end
77
+ end
78
+
@@ -23,8 +23,10 @@ module DefaultDownload
23
23
 
24
24
  private
25
25
 
26
- def download_zip
27
- execute "wget -c #{uri[0].uri} -P #{pkg_dl_dir}"
26
+ def download_compressed_file
27
+ #execute "wget -c #{uri[0].uri} -P #{pkg_dl_dir}"
28
+ FileUtils.mkdir_p("#{pkg_dl_dir}")
29
+ execute "curl -o #{pkg_dl_dir}/#{get_filename_from_uri(uri[0].uri)} -LOk #{uri[0].uri}"
28
30
  end
29
31
 
30
32
  def do_download_clean
@@ -35,7 +37,10 @@ module DefaultDownload
35
37
  case uri[0].uri_type
36
38
  when "zip"
37
39
  print_debug "Zip package"
38
- download_zip()
40
+ download_compressed_file()
41
+ when "gz"
42
+ print_debug "GZ package"
43
+ download_compressed_file()
39
44
  else
40
45
  print_debug('No zip package, falling through...')
41
46
  end
@@ -40,6 +40,7 @@ class GlobalConfig
40
40
  attr_reader :remfile
41
41
 
42
42
  attr_reader :prefix
43
+ attr_reader :compiler_dir
43
44
  attr_reader :compiler
44
45
  attr_reader :obj_cp
45
46
  attr_reader :defines
@@ -48,7 +49,7 @@ class GlobalConfig
48
49
  attr_reader :compiler_obj_extension
49
50
  attr_reader :obj_copy_flags
50
51
 
51
- attr_reader :cc_prefix
52
+ attr_reader :deps
52
53
 
53
54
  def initialize()
54
55
  @rakefile_dir = ""
@@ -68,6 +69,7 @@ class GlobalConfig
68
69
  @remfile = "#{BUILD_DIR}/pkgs.rem_file"
69
70
 
70
71
  @prefix = ""
72
+ @compiler_dir = ""
71
73
  @compiler = ""
72
74
  @obj_cp = ""
73
75
  @defines = []
@@ -76,7 +78,7 @@ class GlobalConfig
76
78
  @compiler_obj_extension = "o"
77
79
  @obj_copy_flags = []
78
80
 
79
- @cc_prefix = ""
81
+ @deps = []
80
82
  end
81
83
 
82
84
  # The getter methods should be considered as 'public' and
@@ -127,19 +129,11 @@ class GlobalConfig
127
129
  end
128
130
 
129
131
  def get_compiler
130
- if prefix.nil? || prefix.empty?
131
- return "#{compiler}"
132
- else
133
- return "#{prefix}-#{compiler}"
134
- end
132
+ return "#{compiler_dir}#{prefix}#{compiler}"
135
133
  end
136
134
 
137
135
  def get_obj_cp
138
- if prefix.nil? || prefix.empty?
139
- return "#{obj_cp}"
140
- else
141
- return "#{prefix}-#{obj_cp}"
142
- end
136
+ return "#{prefix}#{obj_cp}"
143
137
  end
144
138
 
145
139
  def get_defines
@@ -181,6 +175,10 @@ class GlobalConfig
181
175
  return obj_copy_flags_combined
182
176
  end
183
177
 
178
+ def get_global_deps
179
+ return deps
180
+ end
181
+
184
182
 
185
183
 
186
184
  # These are the setter methods. They should be considered as 'private'
@@ -194,6 +192,10 @@ class GlobalConfig
194
192
  @prefix = prefix
195
193
  end
196
194
 
195
+ def set_compiler_dir(dir)
196
+ @compiler_dir = dir
197
+ end
198
+
197
199
  def set_compiler(compiler)
198
200
  @compiler = compiler
199
201
  end
@@ -221,6 +223,10 @@ class GlobalConfig
221
223
  def set_objcopy_flag(flags)
222
224
  @obj_copy_flags.push(flags)
223
225
  end
226
+
227
+ def set_global_dep(dep)
228
+ @deps.push(dep)
229
+ end
224
230
  end
225
231
 
226
232
  $global_config = GlobalConfig.new()
@@ -47,6 +47,11 @@ module DefaultPrepare
47
47
  execute "unzip -qq #{pkg_dl_dir}/#{get_filename_from_uri(uri[0].uri)} -d #{pkg_build_dir}"
48
48
  end
49
49
 
50
+ def prepare_gz
51
+ FileUtils.mkdir_p("#{pkg_build_dir}")
52
+ execute "tar -xvf #{pkg_dl_dir}/#{get_filename_from_uri(uri[0].uri)} -C #{pkg_build_dir}"
53
+ end
54
+
50
55
  def do_prepare_clean
51
56
  FileUtils.rm_rf(pkg_build_dir)
52
57
  end
@@ -58,6 +63,9 @@ module DefaultPrepare
58
63
  when "zip"
59
64
  print_debug "ZIP package"
60
65
  prepare_zip()
66
+ when "gz"
67
+ print_debug "GZ package"
68
+ prepare_gz();
61
69
  when "git"
62
70
  print_debug "GIT repo"
63
71
  prepare_clone_git()
@@ -6,7 +6,7 @@ FROM debian:jessie
6
6
  WORKDIR /home/rem_build
7
7
 
8
8
  RUN apt-get update -y
9
- RUN apt-get install -y rake gcc-arm-none-eabi gcc-avr avr-libc git subversion unzip wget make python sdcc sdcc-libraries cppcheck
9
+ RUN apt-get install -y rake gcc-arm-none-eabi gcc-avr avr-libc git subversion unzip wget curl make python sdcc sdcc-libraries cppcheck
10
10
 
11
11
  # Install mips toolchain manually, as there is no apt-get package available:
12
12
  RUN wget https://community.imgtec.com/?do-download=linux-x64-mti-bare-metal-2016-05-03 -O mips_toolchain.tar.gz
@@ -0,0 +1,18 @@
1
+ #
2
+ # Super simple example of a Dockerfile
3
+ #
4
+ FROM debian:stretch
5
+
6
+ WORKDIR /home/rem_build
7
+
8
+ RUN apt-get update -y
9
+ RUN apt-get install -y rake gcc-arm-none-eabi gcc-avr avr-libc git subversion unzip wget curl make python sdcc sdcc-libraries cppcheck
10
+
11
+ # Install mips toolchain manually, as there is no apt-get package available:
12
+ RUN wget https://community.imgtec.com/?do-download=linux-x64-mti-bare-metal-2016-05-03 -O mips_toolchain.tar.gz
13
+ RUN tar xvf mips_toolchain.tar.gz
14
+ ENV PATH /home/rem_build/mips-mti-elf/2016.05-03/bin/:$PATH
15
+
16
+ RUN git clone https://github.com/franzflasch/REM.git
17
+
18
+ RUN /bin/bash -c "/home/rem_build/REM/tests/run_all_rem_tests.sh /home/rem_build/REM"
@@ -1,14 +1,14 @@
1
1
  #
2
2
  # Super simple example of a Dockerfile
3
3
  #
4
- FROM ubuntu:trusty
4
+ FROM ubuntu:14.04
5
5
 
6
6
  WORKDIR /home/rem_build
7
7
 
8
8
  ENV DEBIAN_FRONTEND noninteractive
9
9
 
10
10
  RUN apt-get update -y
11
- RUN apt-get install -y rake gcc-arm-none-eabi gcc-avr avr-libc git subversion unzip wget make python sdcc sdcc-libraries cppcheck
11
+ RUN apt-get install -y rake gcc-arm-none-eabi gcc-avr avr-libc git subversion unzip wget curl make python sdcc sdcc-libraries cppcheck
12
12
 
13
13
  # Install mips toolchain manually, as there is no apt-get package available:
14
14
  RUN wget https://community.imgtec.com/?do-download=linux-x64-mti-bare-metal-2016-05-03 -O mips_toolchain.tar.gz
@@ -0,0 +1,20 @@
1
+ #
2
+ # Super simple example of a Dockerfile
3
+ #
4
+ FROM ubuntu:16.04
5
+
6
+ WORKDIR /home/rem_build
7
+
8
+ ENV DEBIAN_FRONTEND noninteractive
9
+
10
+ RUN apt-get update -y
11
+ RUN apt-get install -y rake gcc-arm-none-eabi gcc-avr avr-libc git subversion unzip wget curl make python sdcc sdcc-libraries cppcheck
12
+
13
+ # Install mips toolchain manually, as there is no apt-get package available:
14
+ RUN wget https://community.imgtec.com/?do-download=linux-x64-mti-bare-metal-2016-05-03 -O mips_toolchain.tar.gz
15
+ RUN tar xvf mips_toolchain.tar.gz
16
+ ENV PATH /home/rem_build/mips-mti-elf/2016.05-03/bin/:$PATH
17
+
18
+ RUN git clone https://github.com/franzflasch/REM.git
19
+
20
+ RUN /bin/bash -c "/home/rem_build/REM/tests/run_all_rem_tests.sh /home/rem_build/REM"
@@ -1,5 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
+ set -e
4
+
3
5
  REM_PATH=$1
4
6
 
5
7
  echo REMPATH $REM_PATH
@@ -1,5 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
+ set -e
4
+
3
5
  REM_PATH=$1
4
6
 
5
7
  echo REMPATH $REM_PATH
@@ -1,5 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
+ set -e
4
+
3
5
  REM_PATH=$1
4
6
 
5
7
  echo REMPATH $REM_PATH
@@ -0,0 +1,21 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ REM_PATH=$1
6
+
7
+ echo REMPATH $REM_PATH
8
+ export PATH=$REM_PATH:$PATH
9
+
10
+ git clone https://github.com/franzflasch/rem_packages.git
11
+ git clone https://github.com/franzflasch/rem_recipe_testing.git
12
+
13
+ OUTPUT=`rem ARCH=avr MACH=atmega168 PROJECT_FOLDER=rem_packages,rem_recipe_testing/avr_append_test,rem_recipe_testing/common,rem_recipe_testing/global_dependency -m -j4 package:test_project:depends_chain_print VERBOSE=1`
14
+
15
+ echo $OUTPUT | grep -q 'global_dep_test' && echo OK || exit 1
16
+ echo $OUTPUT | grep -q 'global_dep_test2 --> global_dep_test' && echo OK || exit 2
17
+ echo $OUTPUT | grep -q 'global_dep_test3 --> global_dep_test2' && echo OK || exit 3
18
+
19
+ rm -rf rem_workdir
20
+ rm -rf rem_packages
21
+ rm -rf rem_recipe_testing
@@ -1,5 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
+ set -e
4
+
3
5
  REM_PATH=$1
4
6
 
5
7
  echo REMPATH $REM_PATH
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franz Flasch
8
8
  autorequire:
9
9
  bindir: "."
10
10
  cert_chain: []
11
- date: 2017-07-02 00:00:00.000000000 Z
11
+ date: 2017-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -68,22 +68,6 @@ files:
68
68
  - LICENSE
69
69
  - README.md
70
70
  - Rakefile
71
- - machine_conf/8051/8051.rb
72
- - machine_conf/8051/C8051FXXX.rb
73
- - machine_conf/8051/nrf24le1_24.rb
74
- - machine_conf/8051/nrf24le1_32.rb
75
- - machine_conf/8051/nrf24le1_48.rb
76
- - machine_conf/arm/arm.rb
77
- - machine_conf/arm/stm32f1.rb
78
- - machine_conf/arm/stm32f3.rb
79
- - machine_conf/arm/stm32f4.rb
80
- - machine_conf/avr/atmega168.rb
81
- - machine_conf/avr/avr.rb
82
- - machine_conf/mips/PIC32.rb
83
- - machine_conf/mips/pic32mx2.rb
84
- - machine_conf/mips/pic32mz2048.rb
85
- - machine_conf/native/linux.rb
86
- - machine_conf/native/native.rb
87
71
  - rake_embedded.gemspec
88
72
  - rake_embedded/version.rb
89
73
  - rem
@@ -91,11 +75,6 @@ files:
91
75
  - rem_core.rb
92
76
  - rem_path.rb
93
77
  - scripts/build_functions/package_build_functions.rb
94
- - scripts/compile_tasks/common/gcc_LinkPrepare.rb
95
- - scripts/compile_tasks/common/sdcc_LinkPrepare.rb
96
- - scripts/compile_tasks/gcc_tasks/DefaultTasks.rb
97
- - scripts/compile_tasks/make_tasks/MakeTasks.rb
98
- - scripts/compile_tasks/sdcc_tasks/DefaultTasks.rb
99
78
  - scripts/dependency_functions/dependency_graph.rb
100
79
  - scripts/dependency_functions/dependency_tasks.rb
101
80
  - scripts/download_tasks/DefaultTasks.rb
@@ -114,13 +93,16 @@ files:
114
93
  - shell_scripts/comment_unused_functions_cppcheck.sh
115
94
  - shell_scripts/find_func_and_comment.sh
116
95
  - tests/docker/dockerfile_debian_8.dockertest
96
+ - tests/docker/dockerfile_debian_9.dockertest
117
97
  - tests/docker/dockerfile_ubuntu_14_04.dockertest
98
+ - tests/docker/dockerfile_ubuntu_16_04.dockertest
118
99
  - tests/run_all_rem_tests.sh
119
100
  - tests/run_docker_test.sh
120
101
  - tests/run_docker_tests.sh
121
102
  - tests/tests/TEST_append_features.sh
122
103
  - tests/tests/TEST_build_test_project.sh
123
104
  - tests/tests/TEST_check_deps_test_project.sh
105
+ - tests/tests/TEST_global_deps.sh
124
106
  - tests/tests/TEST_remove_unused_functions.sh
125
107
  homepage: https://github.com/franzflasch/REM
126
108
  licenses:
@@ -142,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
124
  version: '0'
143
125
  requirements: []
144
126
  rubyforge_project:
145
- rubygems_version: 2.5.2
127
+ rubygems_version: 2.5.2.1
146
128
  signing_key:
147
129
  specification_version: 4
148
130
  summary: Embedded C buildsystem for microcontrollers
@@ -1,23 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- global_config.set_compiler("sdcc")
22
- global_config.set_obj_extension("rel")
23
- global_config.set_compile_flag("--opt-code-size --stack-auto --Werror")
@@ -1,22 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative './8051'
22
-
@@ -1,25 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative './8051'
22
-
23
- global_config.set_compile_flag("--model-large --std-c99")
24
- global_config.set_link_flag("--model-large --std-c99")
25
-
@@ -1,24 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative './8051'
22
-
23
- global_config.set_compile_flag("--model-large --std-c99")
24
- global_config.set_link_flag("--model-large --std-c99 --iram-size 256 --xram-size 1024 --code-size 16384")
@@ -1,24 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative './8051'
22
-
23
- global_config.set_compile_flag("--model-large --std-c99")
24
- global_config.set_link_flag("--model-large --std-c99")
@@ -1,24 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- global_config.set_compiler_prefix("arm-none-eabi")
22
- global_config.set_compiler("gcc")
23
- global_config.set_obj_cp("objcopy")
24
- global_config.set_compile_flag("-Wall -Werror")
@@ -1,24 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative './arm'
22
-
23
- global_config.set_compile_flag("-Os -g -fno-common -ffunction-sections -fdata-sections -MD -mthumb -mcpu=cortex-m3")
24
- global_config.set_link_flag("--static -nostartfiles -Wl,--gc-sections -mthumb -mcpu=cortex-m3 -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group")
@@ -1,28 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative './arm'
22
-
23
- global_config.set_compile_flag("-Os -g -fno-common -ffunction-sections -fdata-sections -MD -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16")
24
- global_config.set_link_flag("--static -nostartfiles -Wl,--gc-sections -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group")
25
-
26
- #OMM_MACH_COMPILE_FLAGS = "-Os -g -fno-common -ffunction-sections -fdata-sections -MD -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16"
27
- #OMM_MACH_CPP_COMPILE_FLAGR = "-Os -g -fno-common -ffunction-sections -fdata-sections -MD -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16"
28
- #OMM_MACH_LINK_FLAGS = "--static -nostartfiles -Wl,--gc-sections -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group "
@@ -1,28 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative './arm'
22
-
23
- global_config.set_compile_flag("-Os -g -fno-common -ffunction-sections -fdata-sections -MD -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16")
24
- global_config.set_link_flag("--static -nostartfiles -Wl,--gc-sections -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group")
25
-
26
- #OMM_MACH_COMPILE_FLAGS = "-Os -g -fno-common -ffunction-sections -fdata-sections -MD -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16"
27
- #OMM_MACH_CPP_COMPILE_FLAGR = "-Os -g -fno-common -ffunction-sections -fdata-sections -MD -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16"
28
- #OMM_MACH_LINK_FLAGS = "--static -nostartfiles -Wl,--gc-sections -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group "
@@ -1,24 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative './avr'
22
-
23
- global_config.set_compile_flag("-g -Os -mmcu=atmega168p")
24
- global_config.set_link_flag("-g -mmcu=atmega168p")
@@ -1,25 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- global_config.set_compiler_prefix("avr")
22
- global_config.set_compiler("gcc")
23
- global_config.set_obj_cp("objcopy")
24
- global_config.set_compile_flag("-Wall -Werror")
25
- global_config.set_objcopy_flag("-R .eeprom -R .fuse -R .lock -R .signature")
@@ -1,24 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- global_config.set_compiler_prefix("mips-mti-elf")
22
- global_config.set_compiler("gcc")
23
- global_config.set_obj_cp("objcopy")
24
- global_config.set_compile_flag("-Wall -Werror")
@@ -1,24 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative './PIC32'
22
-
23
- global_config.set_compile_flag("-EL -march=m4k -msoft-float -g3 -fno-common -ffunction-sections -fdata-sections -Os")
24
- global_config.set_link_flag("-EL -march=m4k -msoft-float --static -nostartfiles -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group -Wl,--gc-sections")
@@ -1,24 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative './PIC32'
22
-
23
- global_config.set_compile_flag("-EL -march=m14k -msoft-float -g3 -fno-common -ffunction-sections -fdata-sections -Os")
24
- global_config.set_link_flag("-EL -march=m14k -msoft-float --static -nostartfiles -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group -Wl,--gc-sections")
@@ -1,24 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative './native'
22
-
23
- global_config.set_compile_flag("-Os -g -fno-common -ffunction-sections -fdata-sections")
24
- global_config.set_link_flag("--static -Wl,--gc-sections")
@@ -1,24 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- #global_config.set_compiler_prefix("arm-none-eabi")
22
- global_config.set_compiler("gcc")
23
- global_config.set_obj_cp("objcopy")
24
- global_config.set_compile_flag("-Wall -Werror")
@@ -1,35 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2016 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- module CommonLinkTasks
22
- def do_prepare_link_string
23
- tmp_str = ""
24
- global_linker_flags.each do |e|
25
- tmp_str.concat("#{e} ")
26
- end
27
-
28
- # Set linker script
29
- unless linker_script[0].to_s.strip.empty?
30
- tmp_str.concat("-T #{pkg_build_dir}/#{linker_script[0]} ")
31
- end
32
-
33
- return tmp_str
34
- end
35
- end
@@ -1,30 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2016 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- module CommonLinkTasks
22
- def do_prepare_link_string
23
- tmp_str = ""
24
- global_linker_flags.each do |e|
25
- tmp_str.concat("#{e} ")
26
- end
27
-
28
- return tmp_str
29
- end
30
- end
@@ -1,77 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative "../common/gcc_LinkPrepare"
22
-
23
- module Default
24
- module Compile
25
- private
26
- def do_compile_clean
27
- end
28
-
29
- def do_compile
30
- print_debug "hey I am the Default compile function"
31
-
32
- print_debug "IncDirsDependsPrepared: #{inc_dirs_depends_prepared}"
33
- print_debug "IncDirsPrepared: #{inc_dirs_prepared}"
34
- print_debug "SrcFilesPrepared: #{src_files_prepared}"
35
-
36
- inc_dirs_string = inc_dirs_depends_prepared.map { |element| "-I #{element} " }.join("")
37
- inc_dirs_string << inc_dirs_prepared.map { |element| "-I #{element} " }.join("")
38
-
39
- defines_string = defs.map { |element| "-D#{element} " }.join("")
40
- defines_string << "#{global_config.get_defines()}"
41
-
42
- src_files_prepared.each_with_index do |src, obj|
43
- execute "#{global_config.get_compiler} #{defines_string} #{global_config.get_compile_flags} #{inc_dirs_string} -c #{src} -o #{obj_files_prepared[obj]}"
44
- end
45
- end
46
- end
47
-
48
- module Link
49
- private
50
- def do_link_clean
51
- end
52
-
53
- include CommonLinkTasks
54
-
55
- def do_link(objs)
56
- print_debug "hey I am the Default link function"
57
- print_debug "Objects to link: #{objs}"
58
- objs_string = objs.join(" ")
59
- execute "#{global_config.get_compiler} #{objs_string} #{global_config.get_link_flags} -Wl,-Map=#{pkg_deploy_dir}/#{name}.map -o #{pkg_deploy_dir}/#{name}.elf"
60
- end
61
- end
62
-
63
- module Image
64
- private
65
- def do_make_bin
66
- execute "#{global_config.get_obj_cp} #{global_config.get_obj_copy_flags} -S -O binary #{pkg_deploy_dir}/#{name}.elf #{pkg_deploy_dir}/#{name}.bin"
67
- end
68
-
69
- def do_make_hex
70
- execute "#{global_config.get_obj_cp} #{global_config.get_obj_copy_flags} -S -O ihex #{pkg_deploy_dir}/#{name}.elf #{pkg_deploy_dir}/#{name}.hex"
71
- end
72
-
73
- def do_make_srec
74
- execute "#{global_config.get_obj_cp} #{global_config.get_obj_copy_flags} -S -O srec #{pkg_deploy_dir}/#{name}.elf #{pkg_deploy_dir}/#{name}.srec"
75
- end
76
- end
77
- end
@@ -1,86 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative "../common/#{global_config.compiler}_LinkPrepare"
22
-
23
- class MakeTasksDesc
24
-
25
- attr_reader :compile_clean_command
26
- attr_reader :compile_command
27
- attr_reader :link_command
28
- attr_reader :image_command
29
-
30
- def initialize()
31
- @compile_clean_command = ""
32
- @compile_command = ""
33
- @link_command = ""
34
- @image_command = ""
35
- end
36
-
37
- def set_compile_clean_command(command)
38
- @compile_clean_command = command
39
- end
40
- def set_compile_command(command)
41
- @compile_command = command
42
- end
43
- def set_link_command(command)
44
- @link_command = command
45
- end
46
- def set_image_command(command)
47
- @image_command = command
48
- end
49
- end
50
-
51
- module MakePkg
52
- module Compile
53
- private
54
- def do_compile_clean
55
- execute get_build_specific_data.compile_clean_command
56
- end
57
-
58
- def do_compile
59
- print_debug "hey I am the Make compile function"
60
- execute get_build_specific_data.compile_command
61
- end
62
- end
63
-
64
- module Link
65
- private
66
- def do_link_clean
67
- end
68
-
69
- include CommonLinkTasks
70
-
71
- def do_link(objs)
72
- print_debug "Not implemented"
73
- end
74
- end
75
-
76
- module Image
77
- private
78
- def do_make_bin
79
- print_debug "Not implemented"
80
- end
81
-
82
- def do_make_hex
83
- print_debug "Not implemented"
84
- end
85
- end
86
- end
@@ -1,80 +0,0 @@
1
- =begin
2
-
3
- Copyright (C) 2015 Franz Flasch <franz.flasch@gmx.at>
4
-
5
- This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
6
-
7
- REM is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- REM is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with REM. If not, see <http://www.gnu.org/licenses/>.
19
- =end
20
-
21
- require_relative "../common/sdcc_LinkPrepare"
22
-
23
- module Default
24
- module Compile
25
- private
26
- def do_compile_clean
27
- FileUtils.rm_rf("#{pkg_state_dir}/compile")
28
- end
29
-
30
- def do_compile
31
- print_debug "hey I am the SDCC compile function"
32
-
33
- print_debug "IncDirs: #{incdirs}"
34
- print_debug "IncDirsPrepared: #{inc_dirs_prepared}"
35
- print_debug "SrcFilesPrepared: #{src_files_prepared}"
36
-
37
- inc_dirs_string = inc_dirs_depends_prepared.map { |element| "-I #{element} " }.join("")
38
- inc_dirs_string << inc_dirs_prepared.map { |element| "-I #{element} " }.join("")
39
-
40
- defines_string = defs.map { |element| "-D#{element} " }.join("")
41
- defines_string << "#{global_config.get_defines()}"
42
-
43
- src_files_prepared.each_with_index do |src, obj|
44
- execute "#{global_config.get_compiler} #{defines_string} #{global_config.get_compile_flags()} #{inc_dirs_string} -c #{src} -o #{obj_files_prepared[obj]}"
45
- end
46
- end
47
- end
48
-
49
- module Link
50
- private
51
- def do_link_clean
52
- FileUtils.rm_rf("#{pkg_state_dir}/link")
53
- end
54
-
55
- def do_prepare_link_string
56
- return ""
57
- end
58
-
59
- def do_link(objs)
60
- print_debug "hey I am the Default link function"
61
- print_debug "Objects to link: #{objs}"
62
- objs_string = ""
63
- objs.each do |e|
64
- objs_string << "#{e} "
65
- end
66
-
67
- execute "#{global_config.get_compiler} #{global_config.get_link_flags()} #{objs_string} -o #{pkg_deploy_dir}/#{name}.ihx"
68
- #set_state_done("link")
69
- end
70
- end
71
-
72
- module Image
73
- private
74
- def do_make_bin
75
- end
76
-
77
- def do_make_hex
78
- end
79
- end
80
- end