-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.toml
71 lines (61 loc) · 2.88 KB
/
Makefile.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Makefile for cargo-make
#
# In general, cargo-make has reasonable default tasks for this project. The tasks
# defined in this makefile are generally a catalogue of tasks that are known to work
# plus some tweaks where necessary. The absence of a target here doesn't necessarily
# mean it won't work and be appropriate.
[env]
TARGET = "arm-unknown-linux-gnueabihf" # First generation Raspberry Pi.
# These default tasks all build for the host platform (not the Raspberry Pi) so are
# great for working on the overall structure and documentation etc, but can't be used
# for building applications to run on the Raspberry Pi.
#
# Note that the default "build" task enables all features so will use the "mockspi"
# feature. This is probably what you want unless you're actually compiling natively on
# Raspberry Pi hardware. If that's what you really want, uncomment the args override.
[tasks.build]
# args = ["build"]
[tasks.test]
# Ensure we generate docs for testing by including the "mockspi" feature.
[tasks.docs]
args = ["doc", "--no-deps", "--features", "mockspi"]
[tasks.build-flow]
# The following tasks are specifically for targetting the Raspberry Pi itself and all
# use cross to cross compile and test the code.
# There is a potential problem with the RaspberryPi targets not being consistent because
# of an interaction between build scripts (build.rs) and the cross-compilation
# environment. Currently (as of cross v0.2.4) the cross compilation environment is
# a rather old Ubuntu 16.04 container. If a local build (on the PC host) is run before
# making one of these RaspberryPi targets, the cross build will find an existing
# build script in the target directory left over from the local build. In theory that's
# probably OK because the build script isn't expected to run on the target machine just
# in the cross-compilation container, which is still an x86 Linux. However, the build
# script may depend on a glibc version too far ahead of the version in the container to
# be compatible and therefore fail to run.
#
# Two workarounds have some merit:
#
# 1) Build the RaspberryPi targets before the local host targets because the build
# script compiled in the cross-compilation container will work with the more
# recent glibc on the host machine.
#
# 2) Force a clean before running the RaspberryPi targets to remove the incompatible
# build script.
#
# This looks like being a short-term problem because the next version of cross should
# bump the base version of Ubuntu to 20.04.
[tasks.rpi]
command = "cross"
args = ["build", "--target", "${TARGET}"]
[tasks.build-rpi]
command = "cross"
args = ["build", "--release", "--target", "${TARGET}"]
[tasks.test-rpi]
command = "cross"
args = ["test", "--target", "${TARGET}"]
# Generate the changelog
[tasks.changelog]
command = "git"
args = ["cliff",
"--tag", "v${CARGO_MAKE_CRATE_VERSION}",
"--output", "CHANGELOG.md"]