github.com/gobwas/gtrace@v0.4.3/Makefile (about)

     1  .PHONY: gtrace
     2  gtrace:
     3  	go build -o gtrace ./cmd/gtrace
     4  
     5  .PHONY: examples
     6  examples: gtrace
     7  	PATH=$(PWD):$(PATH)	go generate ./examples/...
     8  	go build -o pinger ./examples/pinger
     9  	go build -o buildtags ./examples/buildtags
    10  
    11  .PHONY: test
    12  test: gtrace
    13  	find ./test -name '*_gtrace*' -delete
    14  	for os in linux darwin windows; do \
    15  		echo "--------"; \
    16  		echo "running: GOOS=$$os go generate ./test"; \
    17  		echo "--------"; \
    18  		PATH=$(PWD):$(PATH)	GOOS=$$os go generate ./test; \
    19  		if [[ $$? -ne 0 ]]; then \
    20  			exit 1;\
    21  		fi; \
    22  	done; \
    23  	for os in linux darwin; do \
    24  		for arch in amd64 arm64; do \
    25  			echo "--------"; \
    26  			echo "running: GOOS=$$os GOARCH=$$arch go generate ./test"; \
    27  			echo "--------"; \
    28  			PATH=$(PWD):$(PATH)	GOOS=$$os GOARCH=$$arch go generate ./test; \
    29  			if [[ $$? -ne 0 ]]; then \
    30  				exit 1;\
    31  			fi; \
    32  		done; \
    33  	done
    34  	go test -v ./test
    35  
    36  clean:
    37  	rm -f gtrace
    38  	rm -f pinger
    39  	find ./test -name '*_gtrace*' -delete
    40  	find ./examples -name '*_gtrace*' -delete