Created
November 21, 2009 21:55
-
-
Save jakubkulhan/240299 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
fmt.Println("hello, world!") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TARGET=$(notdir $(shell pwd)) | |
MAGIC=$(shell (([ "$(GOARCH)" == "amd64" ] && echo 6) || ([ "$(GOARCH)" == "arm" ] && echo 5)) || echo 8) | |
all: | |
@for dir in `find * -type d`; do \ | |
go=$$(find "$$dir" -maxdepth 1 -name "*.go"); \ | |
if [ ! -z "$$go" ]; then \ | |
echo "- $$dir: $$go"; \ | |
$(MAGIC)g -I. -o _go_.8 $$go; \ | |
rm -f $$dir.a; \ | |
gopack grc $$dir.a _go_.8; \ | |
fi \ | |
done | |
@if [ -f 'main.go' ]; then \ | |
$(MAGIC)g -I. -o _go_.8 main.go; \ | |
$(MAGIC)l -o $(TARGET) _go_.8; \ | |
fi | |
@rm -f _go_.8 | |
clean: | |
@rm -f _go_.8 `find * -name "*.a"` $(TARGET) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment