|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
15 |
| -""" |
16 |
| - Builder for Teensy boards |
17 |
| -""" |
18 |
| - |
19 | 15 | from os.path import isfile, join
|
20 | 16 |
|
21 | 17 | from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default,
|
|
211 | 207 | # Target: Build executable and linkable firmware
|
212 | 208 | #
|
213 | 209 |
|
214 |
| -target_elf = env.BuildProgram() |
215 |
| - |
216 |
| -# |
217 |
| -# Target: Build the firmware file |
218 |
| -# |
219 |
| - |
220 |
| -if "uploadlazy" in COMMAND_LINE_TARGETS: |
| 210 | +target_elf = None |
| 211 | +if "nobuild" in COMMAND_LINE_TARGETS: |
221 | 212 | target_firm = join("$BUILD_DIR", "firmware.hex")
|
222 | 213 | else:
|
| 214 | + target_elf = env.BuildProgram() |
223 | 215 | target_firm = env.ElfToHex(join("$BUILD_DIR", "firmware"), target_elf)
|
224 | 216 |
|
| 217 | +AlwaysBuild(env.Alias("nobuild", target_firm)) |
| 218 | +target_buildprog = env.Alias("buildprog", target_firm) |
| 219 | + |
225 | 220 | #
|
226 | 221 | # Target: Print binary size
|
227 | 222 | #
|
|
235 | 230 | # Target: Upload by default firmware file
|
236 | 231 | #
|
237 | 232 |
|
238 |
| -upload = env.Alias(["upload", "uploadlazy"], target_firm, |
239 |
| - [env.VerboseAction("$UPLOADHEXCMD", "Uploading $SOURCE")] + |
240 |
| - ([env.VerboseAction("$REBOOTER", "Rebooting...")] |
241 |
| - if "REBOOTER" in env else [])) |
242 |
| -AlwaysBuild(upload) |
| 233 | +target_upload = env.Alias( |
| 234 | + "upload", target_firm, |
| 235 | + [env.VerboseAction("$UPLOADHEXCMD", "Uploading $SOURCE")] + |
| 236 | + ([env.VerboseAction("$REBOOTER", "Rebooting...")] |
| 237 | + if "REBOOTER" in env else [])) |
| 238 | +AlwaysBuild(target_upload) |
243 | 239 |
|
244 | 240 | #
|
245 | 241 | # Default targets
|
246 | 242 | #
|
247 | 243 |
|
248 |
| -Default([target_firm, target_size]) |
| 244 | +Default([target_buildprog, target_size]) |
0 commit comments