Document cross-compiling
This commit is contained in:
parent
d9f2166259
commit
61d1fee98a
1 changed files with 9 additions and 1 deletions
10
README.md
10
README.md
|
@ -99,13 +99,21 @@ Wring schema of the old vending machine.
|
|||
Central controller software. Has a simple HTTP API for controlling output and
|
||||
checking the current fill status of each slot.
|
||||
|
||||
Written in Go, must be compiled before use:
|
||||
The controller is written in Go, must be compiled before use:
|
||||
|
||||
```shell
|
||||
cd uncanny/
|
||||
go build ./cmd/uncanny
|
||||
```
|
||||
|
||||
Note that CGO is required because the source code makes use of the global
|
||||
`messages.h` C header file. If you need to cross-compile, use the following
|
||||
command:
|
||||
|
||||
```shell
|
||||
GOARCH=arm GOOS=linux CGO_ENABLED=1 CC=arm-linux-gnueabi-gcc go build -o uncanny-linux-arm ./cmd/uncanny
|
||||
```
|
||||
|
||||
The resulting `uncanny` executable should be running on the controlling
|
||||
Raspberry Pi. An example SystemD unit is provided in `server/uncanny.service`.
|
||||
Copy `uncanny` to `/usr/bin`, install the service file to
|
||||
|
|
Loading…
Reference in a new issue