github.com/xmplusdev/xmcore@v1.8.11-0.20240412132628-5518b55526af/Makefile (about) 1 NAME = xray 2 3 VERSION=$(shell git describe --always --dirty) 4 5 LDFLAGS = -X github.com/xmplusdev/xmcore/core.build=$(VERSION) -s -w -buildid= 6 PARAMS = -trimpath -ldflags "$(LDFLAGS)" -v 7 MAIN = ./main 8 PREFIX ?= $(shell go env GOPATH) 9 ifeq ($(GOOS),windows) 10 OUTPUT = $(NAME).exe 11 ADDITION = go build -o w$(NAME).exe -trimpath -ldflags "-H windowsgui $(LDFLAGS)" -v $(MAIN) 12 else 13 OUTPUT = $(NAME) 14 endif 15 ifeq ($(shell echo "$(GOARCH)" | grep -Pq "(mips|mipsle)" && echo true),true) # 16 ADDITION = GOMIPS=softfloat go build -o $(NAME)_softfloat -trimpath -ldflags "$(LDFLAGS)" -v $(MAIN) 17 endif 18 .PHONY: clean 19 20 build: 21 go build -o $(OUTPUT) $(PARAMS) $(MAIN) 22 $(ADDITION) 23 24 install: 25 go build -o $(PREFIX)/bin/$(OUTPUT) $(PARAMS) $(MAIN) 26 27 clean: 28 go clean -v -i $(PWD) 29 rm -f xray xray.exe wxray.exe xray_softfloat