rake_embedded 0.1.1
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 +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +14 -0
- data/Gemfile +5 -0
- data/LICENSE +621 -0
- data/README.md +150 -0
- data/Rakefile +2 -0
- data/machine_conf/8051/8051.rb +23 -0
- data/machine_conf/8051/C8051FXXX.rb +22 -0
- data/machine_conf/8051/nrf24le1_24.rb +25 -0
- data/machine_conf/8051/nrf24le1_32.rb +24 -0
- data/machine_conf/8051/nrf24le1_48.rb +24 -0
- data/machine_conf/arm/arm.rb +24 -0
- data/machine_conf/arm/stm32f1.rb +24 -0
- data/machine_conf/arm/stm32f3.rb +28 -0
- data/machine_conf/arm/stm32f4.rb +28 -0
- data/machine_conf/avr/atmega168.rb +24 -0
- data/machine_conf/avr/avr.rb +25 -0
- data/machine_conf/mips/PIC32.rb +24 -0
- data/machine_conf/mips/pic32mx2.rb +24 -0
- data/machine_conf/mips/pic32mz2048.rb +24 -0
- data/machine_conf/native/linux.rb +24 -0
- data/machine_conf/native/native.rb +24 -0
- data/rake_embedded/version.rb +3 -0
- data/rake_embedded.gemspec +28 -0
- data/rem +34 -0
- data/rem.png +0 -0
- data/rem_core.rb +446 -0
- data/rem_path.rb +23 -0
- data/scripts/build_functions/package_build_functions.rb +121 -0
- data/scripts/compile_tasks/common/gcc_LinkPrepare.rb +35 -0
- data/scripts/compile_tasks/common/sdcc_LinkPrepare.rb +30 -0
- data/scripts/compile_tasks/gcc_tasks/DefaultTasks.rb +77 -0
- data/scripts/compile_tasks/make_tasks/MakeTasks.rb +86 -0
- data/scripts/compile_tasks/sdcc_tasks/DefaultTasks.rb +80 -0
- data/scripts/dependency_functions/dependency_graph.rb +68 -0
- data/scripts/dependency_functions/dependency_tasks.rb +67 -0
- data/scripts/download_tasks/DefaultTasks.rb +44 -0
- data/scripts/global_config/config_helper/check_env.rb +57 -0
- data/scripts/global_config/config_helper/config.rb +27 -0
- data/scripts/global_config/global_config.rb +230 -0
- data/scripts/misc/helper.rb +122 -0
- data/scripts/misc/helper_string_parse.rb +40 -0
- data/scripts/misc/print_functions.rb +53 -0
- data/scripts/package.rb +343 -0
- data/scripts/patch_tasks/DefaultTasks.rb +33 -0
- data/scripts/prepare_tasks/DefaultTasks.rb +74 -0
- data/scripts/recipe_handling/recipes.rb +151 -0
- data/scripts/remfile_functions/remfile_gen.rb +39 -0
- data/shell_scripts/check_deps.sh +214 -0
- data/shell_scripts/comment_unused_functions_cppcheck.sh +44 -0
- data/shell_scripts/find_func_and_comment.sh +61 -0
- data/tests/docker/dockerfile_debian_8.dockertest +18 -0
- data/tests/docker/dockerfile_ubuntu_14_04.dockertest +20 -0
- data/tests/run_all_rem_tests.sh +26 -0
- data/tests/run_docker_test.sh +5 -0
- data/tests/run_docker_tests.sh +26 -0
- data/tests/tests/TEST_append_features.sh +15 -0
- data/tests/tests/TEST_build_test_project.sh +28 -0
- data/tests/tests/TEST_check_deps_test_project.sh +16 -0
- data/tests/tests/TEST_remove_unused_functions.sh +17 -0
- metadata +149 -0
data/README.md
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+

|
2
|
+
|
3
|
+
[](https://travis-ci.org/franzflasch/REM)
|
4
|
+
|
5
|
+
# REM
|
6
|
+
REM is a Yocto like buildsystem primarily intended for microcontrollers. It is based on ruby rake and therefore offers a highly flexible way of setting up projects for microcontrollers. If you know Yocto it should be easy to also learn the REM buildsystem. It consists of some features of Yocto, like recipe appending, inbuild patching and downloading software packages. Projects can be setup by only defining recipes, which describe how a specific component should be built. You can even setup your project with sources completely hosted by github! Not necessary to copy-paste software packages and libraries!
|
7
|
+
|
8
|
+
## Prerequisites
|
9
|
+
* Appropriate Microcontroller toolchain (arm-none-eabi, avr, sdcc ...)
|
10
|
+
* ruby (a recent version: >= version 2.2.1)
|
11
|
+
* rake (a recent version: >= version 10.4.2)
|
12
|
+
* unzip
|
13
|
+
* git
|
14
|
+
* subversion
|
15
|
+
* simplecov (optional)
|
16
|
+
|
17
|
+
# Getting started Debian/Ubuntu
|
18
|
+
* Minimal requirements
|
19
|
+
- Debian (at least 8 "jessie")
|
20
|
+
- Ubuntu (at least 14.04 "Trusty Tahr")
|
21
|
+
|
22
|
+
## 1. Install dependencies
|
23
|
+
```Shell
|
24
|
+
sudo apt-get install rake gcc-arm-none-eabi gcc-avr avr-libc git subversion unzip wget make python sdcc sdcc-libraries cppcheck
|
25
|
+
```
|
26
|
+
|
27
|
+
## 2. Fetch REM buildsystem
|
28
|
+
```Shell
|
29
|
+
mkdir rem_build
|
30
|
+
cd rem_build
|
31
|
+
git clone https://github.com/franzflasch/REM.git
|
32
|
+
```
|
33
|
+
|
34
|
+
## 3. Prepare test project
|
35
|
+
```Shell
|
36
|
+
git clone https://github.com/franzflasch/rem_packages.git
|
37
|
+
git clone https://github.com/franzflasch/rem_test_project.git
|
38
|
+
```
|
39
|
+
|
40
|
+
## 4. Prepare PATH
|
41
|
+
```Shell
|
42
|
+
cd REM
|
43
|
+
export PATH=`pwd`:$PATH
|
44
|
+
cd ..
|
45
|
+
```
|
46
|
+
|
47
|
+
## 5. Start build
|
48
|
+
|
49
|
+
### Atmel Atmega168
|
50
|
+
```Shell
|
51
|
+
rem ARCH=avr MACH=atmega168 PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 package:test_project:image[hex]
|
52
|
+
```
|
53
|
+
|
54
|
+
### STMicroelectronics STM32F3
|
55
|
+
```Shell
|
56
|
+
rem ARCH=arm MACH=stm32f3 PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 package:test_project:image[bin]
|
57
|
+
```
|
58
|
+
|
59
|
+
### NORDIC Semiconductor nrf24le1_32
|
60
|
+
```Shell
|
61
|
+
rem ARCH=8051 MACH=nrf24le1_32 PROJECT_FOLDER=rem_packages,rem_test_project -m -j4 package:test_project:image[hex]
|
62
|
+
```
|
63
|
+
|
64
|
+
### Microchip PIC32MX2
|
65
|
+
```Shell
|
66
|
+
rem ARCH=mips MACH=pic32mx2 PROJECT_FOLDER=rem_test_project,rem_libopenpic32,rem_packages package:test_project:image[srec]
|
67
|
+
```
|
68
|
+
|
69
|
+
### Microchip PIC32MZ2048
|
70
|
+
```Shell
|
71
|
+
rem ARCH=mips MACH=pic32mz2048 PROJECT_FOLDER=rem_test_project,rem_libopenpic32,rem_packages package:test_project:image[srec]
|
72
|
+
```
|
73
|
+
|
74
|
+
The image will end up in rem_workdir/#{arch}_#{machine}/deploy
|
75
|
+
It will be either a binary or hex image, depending on what you've chosen to build.
|
76
|
+
|
77
|
+
The arguments "-m -j4" mean to build with max 4 threads simultaneously.
|
78
|
+
|
79
|
+
After the successful build you can flash the image with the right tool for your microcontroller.
|
80
|
+
|
81
|
+
|
82
|
+
# Further Build examples:
|
83
|
+
|
84
|
+
## Verbose output:
|
85
|
+
```Shell
|
86
|
+
rem ARCH=arm MACH=stm32f3 PROJECT_FOLDER=package,test_project -m -j4 package:test_project:image[bin] VERBOSE=1
|
87
|
+
```
|
88
|
+
|
89
|
+
## Load the hex file into an atmega168 microcontroller.
|
90
|
+
```Shell
|
91
|
+
avrdude -F -cstk500v2 -P/dev/ttyUSB0 -patmega168p -Uflash:w:workdir/avr_atmega168/deploy/test_project/test_project.hex
|
92
|
+
```
|
93
|
+
|
94
|
+
## List all available packages for this architecture:
|
95
|
+
```Shell
|
96
|
+
rem ARCH="avr" MACH="atmega168" PROJECT_FOLDER=package package:list_packages
|
97
|
+
```
|
98
|
+
|
99
|
+
## Get a list of dependencies for a particular package:
|
100
|
+
```Shell
|
101
|
+
rem ARCH="avr" MACH="atmega168" PROJECT_FOLDER=package package:msglib_test:depends_chain_print
|
102
|
+
```
|
103
|
+
|
104
|
+
## Generating a "remfile"
|
105
|
+
It is also possible to generate a package specific "remfile", in which all infos about the package and its dependencies are stored. This should increase the speed of the whole build process, as it is not needed to reparse all recipes when starting a new build.
|
106
|
+
```Shell
|
107
|
+
rem ARCH="arm" MACH="stm32f3" VERBOSE=1 WORKDIR=../../../../Desktop/rem_workdir PROJECT_FOLDER=package,test_project package:test_project:remfile_generate
|
108
|
+
```
|
109
|
+
|
110
|
+
## Clean remfile
|
111
|
+
```Shell
|
112
|
+
rem ARCH="arm" MACH="stm32f3" VERBOSE=1 WORKDIR=../../../../Desktop/rem_workdir PROJECT_FOLDER=package,test_project package:remfile_clean
|
113
|
+
```
|
114
|
+
|
115
|
+
## simplecov code coverage - check the codecoverage of the rem buildsystem itself
|
116
|
+
```Shell
|
117
|
+
rem ARCH="arm" MACH="stm32f3" VERBOSE=1 WORKDIR=../../../../Desktop/rem_workdir PROJECT_FOLDER=package,test_project package:test_project:image[bin] SIMPLECOV=1
|
118
|
+
```
|
119
|
+
The output will be placed in a folder called 'coverage'
|
120
|
+
|
121
|
+
## Dependency Check
|
122
|
+
There is also a little script which helps checking if there are any superfluous dependencies set:
|
123
|
+
```Shell
|
124
|
+
WORKDIR=/home/user/Desktop/rem_workdir ARCH=arm MACH=stm32f3 PROJECT_FOLDER=test_project,rem_packages PACKAGE_NAME=test_project check_deps.sh
|
125
|
+
```
|
126
|
+
|
127
|
+
## Find unused functions and auto comment them to save space
|
128
|
+
This is especially for some compilers like sdcc, as they may do not have an option to auto remove them:
|
129
|
+
use it like this:
|
130
|
+
comment_unused_functions_cppcheck.sh folder_to_check "folders_to_exclude_from_check_separated_with_spaces"
|
131
|
+
```Shell
|
132
|
+
comment_unused_functions_cppcheck.sh . "nrf24le1_sdk_nohash/"
|
133
|
+
```
|
134
|
+
After the successful execution you should reinvoke the rem build command to rebuild the image. The file should be appreciably smaller if many functions were removed.
|
135
|
+
|
136
|
+
## Supported microcontrollers
|
137
|
+
* Atmel Atmega168
|
138
|
+
* STMicroelectronics:
|
139
|
+
- STM32F1
|
140
|
+
- STM32F3
|
141
|
+
- STM32F4
|
142
|
+
* SILABS
|
143
|
+
- C8051FXXX
|
144
|
+
* Nordic Semiconductor
|
145
|
+
- nrf24le1_24
|
146
|
+
- nrf24le1_32
|
147
|
+
- nrf24le1_48
|
148
|
+
* Microchip
|
149
|
+
- PIC32MX2
|
150
|
+
- PIC32MZ2048
|
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
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")
|
@@ -0,0 +1,22 @@
|
|
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
|
+
|
@@ -0,0 +1,25 @@
|
|
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
|
+
|
@@ -0,0 +1,24 @@
|
|
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")
|
@@ -0,0 +1,24 @@
|
|
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")
|
@@ -0,0 +1,24 @@
|
|
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")
|
@@ -0,0 +1,24 @@
|
|
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")
|
@@ -0,0 +1,28 @@
|
|
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 "
|
@@ -0,0 +1,28 @@
|
|
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 "
|
@@ -0,0 +1,24 @@
|
|
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")
|
@@ -0,0 +1,25 @@
|
|
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")
|
@@ -0,0 +1,24 @@
|
|
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")
|
@@ -0,0 +1,24 @@
|
|
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")
|
@@ -0,0 +1,24 @@
|
|
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")
|
@@ -0,0 +1,24 @@
|
|
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")
|
@@ -0,0 +1,24 @@
|
|
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")
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../.', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rake_embedded/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "rake_embedded"
|
8
|
+
spec.licenses = ['GPL-3.0']
|
9
|
+
spec.version = RakeEmbedded::VERSION
|
10
|
+
spec.authors = ["Franz Flasch"]
|
11
|
+
spec.email = ["franz.flasch@gmx.at"]
|
12
|
+
spec.summary = "Embedded C buildsystem for microcontrollers"
|
13
|
+
spec.description = "REM is a Yocto like buildsystem primarily intended for microcontrollers. It is based on ruby rake."
|
14
|
+
spec.homepage = "https://github.com/franzflasch/REM"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
+
f.match(%r{^(test|spec|features)/})
|
18
|
+
end
|
19
|
+
|
20
|
+
spec.bindir = "."
|
21
|
+
spec.executables = "rem"
|
22
|
+
spec.require_paths = ["."]
|
23
|
+
|
24
|
+
spec.add_runtime_dependency "rake", ">= 12.0"
|
25
|
+
|
26
|
+
spec.add_development_dependency "bundler", ">= 1.14"
|
27
|
+
spec.add_development_dependency "rake", ">= 12.0"
|
28
|
+
end
|
data/rem
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
=begin
|
4
|
+
|
5
|
+
Copyright (C) 2016 Franz Flasch <franz.flasch@gmx.at>
|
6
|
+
|
7
|
+
This file is part of REM - Rake for EMbedded Systems and Microcontrollers.
|
8
|
+
|
9
|
+
REM is free software: you can redistribute it and/or modify
|
10
|
+
it under the terms of the GNU General Public License as published by
|
11
|
+
the Free Software Foundation, either version 3 of the License, or
|
12
|
+
(at your option) any later version.
|
13
|
+
|
14
|
+
REM is distributed in the hope that it will be useful,
|
15
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
GNU General Public License for more details.
|
18
|
+
|
19
|
+
You should have received a copy of the GNU General Public License
|
20
|
+
along with REM. If not, see <http://www.gnu.org/licenses/>.
|
21
|
+
=end
|
22
|
+
|
23
|
+
begin
|
24
|
+
require 'rem_path'
|
25
|
+
rescue LoadError
|
26
|
+
puts "rem_path.rb was not found. REM is probably not installed as a gem package. Trying relative path."
|
27
|
+
require_relative 'rem_path'
|
28
|
+
end
|
29
|
+
|
30
|
+
args_string = ARGV.join(" ")
|
31
|
+
rem_path=get_rem_path()
|
32
|
+
rem_rake_file="#{rem_path}/rem_core.rb"
|
33
|
+
|
34
|
+
exec("rake -f #{rem_rake_file} #{args_string}")
|
data/rem.png
ADDED
Binary file
|