Created
October 2, 2017 20:08
-
-
Save jmaitrehenry/5b66581295d2d4ca175e4f8f49b3dbaf 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
PID = ./app.pid | |
GO_FILES = $(wildcard *.go) | |
serve: start | |
@fswatch -x -o --event Created --event Updated --event Renamed -r -e '.*' -i '\.go$$' . | xargs -n1 -I{} make restart || make kill | |
kill: | |
@kill `cat $(PID)` || true | |
before: | |
@echo "actually do nothing" | |
build: $(GO_FILES) | |
@go build -o app | |
start: | |
@./app & echo $$! > $(PID) | |
restart: kill before build start | |
.PHONY: start serve restart kill before # let's go to reserve rules names |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment