From 933483aa0fe4475724dab26fcffbb5b4aabfe5c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ho=CC=88gborg?= Date: Fri, 17 Jul 2015 22:23:30 +0200 Subject: [PATCH] Cross compile and README update --- .gitignore | 1 + Makefile | 29 +++++++++++++++++++++++++---- README.md | 26 ++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a253552..18a21b0 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,5 @@ _testmain.go *.prof /gopow +/build resources.go diff --git a/Makefile b/Makefile index 0b8b663..fd3b19b 100755 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ VERSION = $(shell git describe --always --dirty) TIMESTAMP = $(shell git show -s --format=%ct) -default: build +default: build_darwin setup: go get -u github.com/jteeuwen/go-bindata/... @@ -12,13 +12,34 @@ setup: resources: go-bindata -pkg resources -o internal/resources/resources.go resources/... -build: resources - go build -o ./gopow *.go +build_darwin: resources + GOOS=darwin GOARCH=amd64 go build -a -o ./build/gopow *.go + zip ./build/gopow_darwin64.zip ./build/gopow + +build_linux: resources + GOOS=linux GOARCH=amd64 go build -a -o ./build/gopow *.go + zip ./build/gopow_linux64.zip ./build/gopow + +build_arm5: resources + GOOS=linux GOARM=5 GOARCH=arm go build -a -o ./build/gopow *.go + zip ./build/gopow_linux_arm5.zip ./build/gopow + +build_arm7: resources + GOOS=linux GOARM=7 GOARCH=arm go build -a -o ./build/gopow *.go + zip ./build/gopow_linux_arm7.zip ./build/gopow + +build_win: resources + GOOS=windows GOARCH=amd64 go build -a -o ./build/gopow.exe *.go + zip ./build/gopow_win64.zip ./build/gopow.exe + +all: build_darwin build_linux build_arm5 build_arm7 build_win + rm ./build/gopow + rm ./build/gopow.exe lint: golint . clean: - rm -f gopow + rm -f build rm -rf internal/resources diff --git a/README.md b/README.md index ce1c75b..6c0dfb6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,28 @@ # rtl-gopow Render tables from rtl_power to a nice heat map +Here is an render of rtl_power tool scanning 80-90 MHz during 2.5 hours moving in a car. ![80-90 MHz](http://i.imgur.com/knkzLXO.jpg). + +# Availability +Since Go is easy to cross compile, this tool can be easily distributed as a binary without any dependencies. You'll find it under Releases here on github. The following platforms are avalible as a ready to run binary file: + +* OS X (x64) +* Linux (x64) +* Linux (arm5) +* Linux (arm7) +* Windows (x64) + +## Performance +A render of a 600 MB csv file takes about 2 minutes on a 2,4 GHz Intel Core i5. There is still lots of room for improvement on that though. Memory usage is quite horrid. + +## Options +``` +GLOBAL OPTIONS: + --input, -i CSV input file generated by rtl_power [required] + --output, -o Output file, default same as input file with new extension + --format, -f 'png' Output file format, default png [png,jpeg] + --verbose Enable more verbose output + --no-annotations Disabled annotations such as time and frequency scales + --help, -h show help + --version, -v print the version + + ``` \ No newline at end of file