12345678910111213141516171819202122232425262728293031323334 |
- service=bar
- at_osc=@osc
- os=linux
- arch=amd64
- dir_guard=@mkdir -p $(@D)
- party_host=xuj.local
- exec=/usr/local/bin/$(service)
- all: $(service) $(at_osc)
- $(service): $(wildcard **.go)
- go build .
- $(at_osc): $(wildcard at-osc/**.go)
- go build -o "$(at_osc)" ./at-osc
- run: $(service)
- ./$(service)
- put: build/$(service).$(os)_$(arch)
- # Move old binary out of the way and ask old instance to quit
- ssh $(party_host) [ -f $(exec) ] "&&" mv $(exec) $(exec).retired "||" /bin/true
- scp $^ $(party_host):$(exec)
- osc-utility message --host $(party_host) --port 9137 --address /bar/halt
- build/$(service).%: $(wildcard **.go)
- $(dir_guard)
- GOOS=$(word 1, $(subst _, ,$*)) GOARCH=$(word 2, $(subst _, ,$*)) go build -o $@ .
- build/@osc.%: $(wildcard at-osc/**.go)
- $(dir_guard)
- GOOS=$(word 1, $(subst _, ,$*)) GOARCH=$(word 2, $(subst _, ,$*)) go build -o $@ ./at-osc
|