diff --git a/go-example-webserver/Makefile b/go-example-webserver/Makefile new file mode 100644 index 0000000..f3940c4 --- /dev/null +++ b/go-example-webserver/Makefile @@ -0,0 +1,21 @@ +magic-bin/x86_64-linux-gnu: + mkdir ./magic-bin/x86_64-linux-gnu + +magic-bin/arm-linux-gnueabihf: + mkdir ./magic-bin/arm-linux-gnueabihf + +build_amd64: magic-bin/x86_64-linux-gnu + cd ./magic-bin/x86_64-linux-gnu && \ + go build ../../ + +build_arm: magic-bin/arm-linux-gnueabihf + cd ./magic-bin/arm-linux-gnueabihf && \ + GOARCH=arm go build ../../ + +snap: build_amd64 build_arm + snappy build . + +clean: + rm -rf ./magic-bin/x86_64-linux-gnu + rm -rf ./magic-bin/arm-linux-gnueabihf + rm -rf ./*multi.snap \ No newline at end of file diff --git a/go-example-webserver/README b/go-example-webserver/README index 6b03417..d187859 100644 --- a/go-example-webserver/README +++ b/go-example-webserver/README @@ -9,20 +9,13 @@ to find the right architecture and launch the right binary. To build simply do this: - # change to the x86_64 directory and build the binary... - 1. cd magic-bin/x86_64-linux-gnu - 2. go build ../../ - - # switch to the armhf directory and build for ARM - 3. cd ../arm-linux-gnueabihf - 4. GOARCH=arm go build ../../ - - # go to top level dir and build the snapp - 5. cd ../.. - 6. snappy build . + make snap This produces a snappy package for you that you can try on your snappy system. + cd /apps/go-example-webserver.*/current + sudo ./magic-bin/go-example-webserver + Have fun! - Snappy Team