-
Notifications
You must be signed in to change notification settings - Fork 0
/
_Proj.jsmk
69 lines (63 loc) · 1.51 KB
/
_Proj.jsmk
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
/* global Project */
let usbStyle = "USB_MIDI_SERIAL";
Project.SetBuildVar("USBTYPE", usbStyle);
let m = Project.NewModule("dbStompbox");
let libnms = [
// lib order matters for linking, lower-level libs should appear later
// `libControlSurface_${usbStyle}`,
"libBounce",
"libwire",
];
let libcore = `libcore_${usbStyle}`;
let searchpaths = libnms.map( (nm) =>
{
return Project.FindModule(nm).Interpolate("${INCDIR}");
});
let liblists = libnms.map((nm) =>
{
return Project.FindModuleOutputs(nm);
});
liblists.push(Project.FindModuleOutputs(libcore));
let libs = [].concat(...liblists); // flatten [[a,b,c], [d], [e]] -> [a,b,c,d,e]
// gcc -c -Os --specs=nano.specs -g -Wall \
// "-Iteensy3" "name.c" -o \
// "name.c.o"
let t1 = m.NewTask("compile", "cpp->o",
{
inputs: Project.Glob("*.cpp"),
define:
{
USB_MIDI_SERIAL: null
},
searchpaths: searchpaths
});
let t1a = m.NewTask("Compile", "c->o",
{
inputs: Project.Glob("*.c"),
define:
{
USB_MIDI_SERIAL: null
},
searchpaths: searchpaths
});
let t2 = m.NewTask("dbStompbox", "cpp.o->elf",
{
inputs: [...t1.GetOutputs(), ...t1a.GetOutputs(), ...libs],
searchpaths: []
});
let t3 = m.NewTask("extractData", "elf->eep",
{
inputs: t2.GetOutputs()
});
let t4 = m.NewTask("extractCode", "elf->hex",
{
inputs: t2.GetOutputs()
});
let t5 = m.NewTask("reportSize", "report",
{
inputs: t2.GetOutputs()
});
let t6 = m.NewTask("upload", "postcompile",
{
inputs: t4.GetOutputs()
});