-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
80 lines (61 loc) · 2.8 KB
/
Makefile
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
72
73
74
75
76
77
78
79
80
include properties.mk
SUPPORTED_DEVICES_LIST = $(shell sed -n -e 's/<iq:product id="\(.*\)"\/>/\1/p' manifest-app.xml)
SOURCES = $(shell find source -name '[^.]*.mc')
RESFILES = $(shell find resources* -name '[^.]*.xml')
APPNAME = $(shell grep entry manifest-app.xml | sed 's/.*entry="\([^"]*\).*/\1/' | sed 's/App$$//')
SIMULATOR = LD_LIBRARY_PATH="$(SDK_HOME)/bin" "$(SDK_HOME)/bin/connectiq"
MONKEYC = "$(SDK_HOME)/bin/monkeyc"
MONKEYDO = "$(SDK_HOME)/bin/monkeydo"
.PHONY: build deploy buildall run package clean sim package-widget package-app
all: build
clean:
@rm -fr bin
@find . -name '*~' -print0 | xargs -0 rm -f
build: bin/$(APPNAME)-$(DEVICE).prg bin/$(APPNAME)-widget-$(DEVICE).prg
bin/$(APPNAME)-$(DEVICE).prg: $(SOURCES) $(RESFILES) manifest-app.xml
$(MONKEYC) --warn --output bin/$(APPNAME)-$(DEVICE).prg \
-f 'monkey-base.jungleinc;monkey-app.jungleinc' \
-y $(PRIVATE_KEY) \
-d $(DEVICE)
bin/$(APPNAME)-widget-$(DEVICE).prg: $(SOURCES) $(RESFILES) manifest-widget.xml
$(MONKEYC) --warn --output bin/$(APPNAME)-widget-$(DEVICE).prg \
-f 'monkey-base.jungleinc;monkey-widget.jungleinc' \
-y $(PRIVATE_KEY) \
-d $(DEVICE)
bin/$(APPNAME)-$(DEVICE)-test.prg: $(SOURCES) $(RESFILES)
$(MONKEYC) --warn --output bin/$(APPNAME)-$(DEVICE)-test.prg \
-f 'monkey-base.jungleinc;monkey-app.jungleinc' \
-y $(PRIVATE_KEY) \
--unit-test \
-d $(DEVICE)
buildall:
@for device in $(SUPPORTED_DEVICES_LIST); do \
echo "-----"; \
echo "Building for" $$device; \
$(MONKEYC) --warn --output bin/$(APPNAME)-$$device.prg \
-f 'monkey-base.jungleinc;monkey-app.jungleinc' \
-y $(PRIVATE_KEY) \
-d $$device; \
done
sim:
@pidof 'simulator*' &>/dev/null || ( $(SIMULATOR) & sleep 3 )
run: sim bin/$(APPNAME)-$(DEVICE).prg
$(MONKEYDO) bin/$(APPNAME)-$(DEVICE).prg $(DEVICE) &
test: sim bin/$(APPNAME)-$(DEVICE)-test.prg
$(MONKEYDO) bin/$(APPNAME)-$(DEVICE)-test.prg $(DEVICE) -t
$(DEPLOY)/$(APPNAME).prg: bin/$(APPNAME)-$(DEVICE).prg
@cp bin/$(APPNAME)-$(DEVICE).prg $(DEPLOY)/$(APPNAME).prg
@touch $(DEPLOY)/LOGS/76963622.TXT
$(DEPLOY)/$(APPNAME)-widget.prg: bin/$(APPNAME)-widget-$(DEVICE).prg
@cp bin/$(APPNAME)-widget-$(DEVICE).prg $(DEPLOY)/$(APPNAME)-widget.prg
@touch $(DEPLOY)/LOGS/76A74803.TXT
deploy: build $(DEPLOY)/$(APPNAME).prg $(DEPLOY)/$(APPNAME)-widget.prg
manifest-widget.xml: manifest-app.xml
sed -e 's/watch-app/widget/g;s/9B0A09CFC89E4F7CA5E4AB21400EE424/B5FD4C5FE0F848E88A03E37E86971CEB/g' < manifest-app.xml > manifest-widget.xml
package: package-app package-widget
package-app:
$(MONKEYC) --warn -e --output bin/$(APPNAME)-app.iq -f 'monkey-base.jungleinc;monkey-app.jungleinc' \
-y $(PRIVATE_KEY) -r
package-widget: manifest-widget.xml
$(MONKEYC) --warn -e --output bin/$(APPNAME)-widget.iq -f 'monkey-base.jungleinc;monkey-widget.jungleinc' \
-y $(PRIVATE_KEY) -r