2017-03-25 19:05:10 +08:00
|
|
|
.PHONY: test cover robeaux examples deps
|
2014-07-11 02:13:32 +08:00
|
|
|
|
2014-06-12 11:10:46 +08:00
|
|
|
test:
|
2017-03-25 19:05:10 +08:00
|
|
|
go test ./...
|
2014-07-19 04:18:01 +08:00
|
|
|
|
2014-06-12 11:10:46 +08:00
|
|
|
cover:
|
2017-02-17 00:28:35 +08:00
|
|
|
echo "" > profile.cov
|
2017-03-25 19:05:10 +08:00
|
|
|
for package in $$(go list ./...) ; do \
|
|
|
|
go test -covermode=count -coverprofile=tmp.cov $$package ; \
|
|
|
|
if [ -f tmp.cov ]; then \
|
|
|
|
cat tmp.cov >> profile.cov ; \
|
|
|
|
rm tmp.cov ; \
|
|
|
|
fi ; \
|
|
|
|
done
|
2014-07-02 14:10:12 +08:00
|
|
|
|
|
|
|
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 ; \
|
2015-10-27 00:09:28 +08:00
|
|
|
npm install robeaux ; \
|
|
|
|
cp -r node_modules/robeaux robeaux-tmp ; \
|
2014-07-11 02:35:00 +08:00
|
|
|
cd robeaux-tmp ; \
|
2015-10-27 00:09:28 +08:00
|
|
|
rm Makefile package.json README.markdown ; \
|
2014-07-11 02:13:32 +08:00
|
|
|
touch css/fonts.css ; \
|
2015-10-27 00:09:28 +08:00
|
|
|
echo "Updating robeaux..." ; \
|
2014-07-11 02:35:00 +08:00
|
|
|
go-bindata -pkg="robeaux" -o robeaux.go -ignore=\\.git ./... ; \
|
|
|
|
mv robeaux.go ../robeaux ; \
|
2014-07-02 14:10:12 +08:00
|
|
|
cd .. ; \
|
2014-07-11 02:35:00 +08:00
|
|
|
rm -rf robeaux-tmp/ ; \
|
2015-10-27 00:09:28 +08:00
|
|
|
rm -rf node_modules/ ; \
|
2014-07-11 02:35:00 +08:00
|
|
|
go fmt ./robeaux/robeaux.go ; \
|
2016-02-20 10:40:30 +08:00
|
|
|
|
|
|
|
EXAMPLES := $(shell ls examples/*.go | sed -e 's/examples\///')
|
|
|
|
|
|
|
|
examples:
|
|
|
|
for example in $(EXAMPLES) ; do \
|
|
|
|
go build -o /tmp/$$example examples/$$example ; \
|
|
|
|
done ; \
|
2016-10-03 14:25:07 +08:00
|
|
|
|
|
|
|
deps:
|
2017-03-25 19:05:10 +08:00
|
|
|
go get -d -v \
|
|
|
|
github.com/bmizerany/pat \
|
|
|
|
github.com/codegangsta/cli \
|
|
|
|
github.com/currantlabs/ble \
|
|
|
|
github.com/donovanhide/eventsource \
|
|
|
|
github.com/eclipse/paho.mqtt.golang \
|
|
|
|
github.com/hashicorp/go-multierror \
|
|
|
|
github.com/hybridgroup/go-ardrone/client \
|
|
|
|
github.com/lazywei/go-opencv \
|
|
|
|
github.com/mgutz/logxi/v1 \
|
|
|
|
github.com/nats-io/nats \
|
|
|
|
github.com/sigurn/crc8 \
|
|
|
|
github.com/tarm/serial \
|
|
|
|
github.com/veandco/go-sdl2/sdl \
|
|
|
|
golang.org/x/net/websocket \
|
|
|
|
golang.org/x/sys/unix
|