forked from hybridgroup/gobot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (35 loc) · 1.23 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
PACKAGES := gobot gobot/api gobot/platforms/firmata/client gobot/platforms/intel-iot/edison gobot/sysfs $(shell ls ./platforms | sed -e 's/^/gobot\/platforms\//')
.PHONY: test cover robeaux examples
test:
for package in $(PACKAGES) ; do \
go test -a github.com/hybridgroup/$$package ; \
done ; \
cover:
echo "mode: set" > profile.cov ; \
for package in $(PACKAGES) ; do \
go test -a -coverprofile=tmp.cov github.com/hybridgroup/$$package ; \
cat tmp.cov | grep -v "mode: set" >> profile.cov ; \
done ; \
rm tmp.cov ; \
robeaux:
ifeq (,$(shell which go-bindata))
$(error robeaux not built! https://github.com/jteeuwen/go-bindata is required to build robeaux assets )
endif
cd api ; \
npm install robeaux ; \
cp -r node_modules/robeaux robeaux-tmp ; \
cd robeaux-tmp ; \
rm Makefile package.json README.markdown ; \
touch css/fonts.css ; \
echo "Updating robeaux..." ; \
go-bindata -pkg="robeaux" -o robeaux.go -ignore=\\.git ./... ; \
mv robeaux.go ../robeaux ; \
cd .. ; \
rm -rf robeaux-tmp/ ; \
rm -rf node_modules/ ; \
go fmt ./robeaux/robeaux.go ; \
EXAMPLES := $(shell ls examples/*.go | sed -e 's/examples\///')
examples:
for example in $(EXAMPLES) ; do \
go build -o /tmp/$$example examples/$$example ; \
done ; \