-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnakefile.nim
More file actions
30 lines (24 loc) · 1.12 KB
/
nakefile.nim
File metadata and controls
30 lines (24 loc) · 1.12 KB
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
import nake
const
sourceName = "main.nim"
ArmName = "AkaPi_arm"
x86Name = "AkaPi_x86"
task "debug-build", "Build with debug flags in source":
if shell(nimExe, "c", "-d:ssl", "-d:debug", "-o:" & x86Name, sourceName):
echo "Success!"
task "x86-build", "Release for x86":
if shell(nimExe, "c", "-d:ssl", "-d:release", "-o:" & x86Name, sourceName):
echo "Success!"
task "arm-build", "Release for ARM":
if shell(nimExe, "c", "-d:ssl", "-d:release", "--cpu:arm", "--os:linux", "-o:" & ArmName, sourceName):
echo "Success!"
task "arm-deploy", "Deploy to RaspberryPi":
if shell(nimExe, "c", "-d:ssl", "-d:release", "--cpu:arm", "--os:linux", "-o:" & ArmName, sourceName):
if shell("ssh", "pi@AkaPi", "sudo service AkaPiSign stop"):
if shell("scp", ArmName, "pi@AkaPi:akamai-sign/"):
if shell("ssh", "pi@AkaPi", "sudo service AkaPiSign start"):
echo "Success!"
task "clean", "Remove all binaries":
shell("rm", ArmName, x86Name, "nakefile")
shell("find", "-name", "'*.ppm'", "!", "-name", "'AkaPi_logo.ppm'", "-type", "f", "-exec", "rm", "-f", "{}", "+")
shell("rm", "-r", "nimcache")