Skip to content

Instantly share code, notes, and snippets.

@nathanmalishev
Last active March 1, 2020 06:25
Show Gist options
  • Save nathanmalishev/ecbe642e4b9447c39c30c7aafd19e7c2 to your computer and use it in GitHub Desktop.
Save nathanmalishev/ecbe642e4b9447c39c30c7aafd19e7c2 to your computer and use it in GitHub Desktop.
makefile, for use with AWS Lambda & golang, showing local development
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