Last active
March 1, 2020 06:25
-
-
Save nathanmalishev/ecbe642e4b9447c39c30c7aafd19e7c2 to your computer and use it in GitHub Desktop.
makefile, for use with AWS Lambda & golang, showing local development
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
clean: | |
@rm -rf dist | |
@mkdir -p dist | |
gomon: | |
reflex -r '\.go' -s -- sh -c 'make build' | |
build: clean | |
@for dir in `ls handler`; do \ | |
GOOS=linux go build -o dist/handler/$$dir PATH/handler/$$dir; \ | |
done | |
// Improvement to build time, with more CPU load. Running each go build in parallel | |
buildP: clean | |
@for dir in `ls handler`; do \ | |
echo 'building…' $$dir; \ | |
CGO_ENABLED=0 GOOS=linux go build -o dist/handler/$$dir PATH/handler/$$dir & done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment