-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwscript
43 lines (35 loc) · 1.3 KB
/
wscript
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
#
# This file is the default set of rules to compile a Pebble project.
#
# Feel free to customize this to your needs.
#
import os.path
import sys
sys.path.insert(0, os.path.join('extra', 'config'))
import makecfg
top = '.'
out = 'build'
def options(ctx):
ctx.load('pebble_sdk')
def configure(ctx):
ctx.load('pebble_sdk')
with open('appinfo.json.in', 'r') as inFile:
with open('appinfo.json', 'w') as outFile:
outFile.write(inFile.read() % { 'appKeys': makecfg.main([
'--ifile', 'config/livedigits0.cfg',
'--cfile', os.path.join('src', 'config.c'),
'--hfile', os.path.join('src', 'config.h'),
'--ofile', os.path.join('html', 'livedigits0.htm') ]) })
def build(ctx):
ctx.load('pebble_sdk')
ctx.pbl_program(source=ctx.path.ant_glob('src/**/*.c'),
target='pebble-app.elf')
if os.path.exists('worker_src'):
ctx.pbl_worker(source=ctx.path.ant_glob('worker_src/**/*.c'),
target='pebble-worker.elf')
ctx.pbl_bundle(elf='pebble-app.elf',
worker_elf='pebble-worker.elf',
js=ctx.path.ant_glob('src/js/**/*.js'))
else:
ctx.pbl_bundle(elf='pebble-app.elf',
js=ctx.path.ant_glob('src/js/**/*.js'))