vendor/github.com/pelletier/go-toml/Makefile
changeset 265 05c40b36d3b2
parent 264 8f478162d991
child 266 80973a656b81
equal deleted inserted replaced
264:8f478162d991 265:05c40b36d3b2
     1 export CGO_ENABLED=0
       
     2 go := go
       
     3 go.goos ?= $(shell echo `go version`|cut -f4 -d ' '|cut -d '/' -f1)
       
     4 go.goarch ?= $(shell echo `go version`|cut -f4 -d ' '|cut -d '/' -f2)
       
     5 
       
     6 out.tools := tomll tomljson jsontoml
       
     7 out.dist := $(out.tools:=_$(go.goos)_$(go.goarch).tar.xz)
       
     8 sources := $(wildcard **/*.go)
       
     9 
       
    10 
       
    11 .PHONY:
       
    12 tools: $(out.tools)
       
    13 
       
    14 $(out.tools): $(sources)
       
    15 	GOOS=$(go.goos) GOARCH=$(go.goarch) $(go) build ./cmd/$@
       
    16 
       
    17 .PHONY:
       
    18 dist: $(out.dist)
       
    19 
       
    20 $(out.dist):%_$(go.goos)_$(go.goarch).tar.xz: %
       
    21 	if [ "$(go.goos)" = "windows" ]; then \
       
    22 		tar -cJf $@ $^.exe; \
       
    23 	else \
       
    24 		tar -cJf $@ $^; \
       
    25 	fi
       
    26 
       
    27 .PHONY:
       
    28 clean:
       
    29 	rm -rf $(out.tools) $(out.dist)