-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (28 loc) · 774 Bytes
/
Makefile
File metadata and controls
38 lines (28 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
GOBIN=$(shell pwd)/bin
GOFILES=$(shell find . -type f -name '*.go')
GONAME="manypoint"
build:
@echo "Building react client"
cd client; npm install && npm run build
@echo "Building $(GOFILES) to ./bin"
GOBIN=$(GOBIN) go build -o bin/$(GONAME)
get:
GOBIN=$(GOBIN) go get .
install:
GOBIN=$(GOBIN) go install $(GOFILES)
watch:
@$(MAKE) restart &
@fswatch -o . -e 'bin/.*' | xargs -n1 -I{} make restart
restart: clear stop clean build start
start:
@echo "Starting bin/$(GONAME)"
@./bin/$(GONAME) & echo $$! > $(PID)
stop:
@echo "Stopping bin/$(GONAME) if it's running"
@-kill `[[ -f $(PID) ]] && cat $(PID)` 2>/dev/null || true
clear:
@clear
clean:
@echo "Cleaning"
GOBIN=$(GOBIN) go clean
.PHONY: build get install run watch start stop restart clean