Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added makefile #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions go-example-webserver/Makefile
Original file line number Diff line number Diff line change
@@ -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
15 changes: 4 additions & 11 deletions go-example-webserver/README
Original file line number Diff line number Diff line change
Expand Up @@ -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