initial commit
This commit is contained in:
commit
f6e6e78beb
398 changed files with 242114 additions and 0 deletions
39
Makefile
Normal file
39
Makefile
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
CC=go
|
||||
BUILD=build -v
|
||||
GCFLAGS=-gcflags '-e'
|
||||
LDFLAGS=-ldflags '-s -w'
|
||||
PROGRAM=gocrypt
|
||||
ENV=CGO_ENABLED=0 GO111MODULE=on
|
||||
|
||||
all: $(PROGRAM)
|
||||
|
||||
release: clean gofmt test
|
||||
$(ENV) $(CC) $(BUILD) $(GCFLAGS) $(LDFLAGS)
|
||||
|
||||
release-vendor: clean gofmt test
|
||||
$(ENV) $(CC) $(BUILD) -mod=vendor $(GCFLAGS) $(LDFLAGS)
|
||||
|
||||
vendor: clean gofmt
|
||||
$(ENV) $(CC) $(BUILD) -mod=vendor $(GCFLAGS) $(LDFLAGS)
|
||||
|
||||
$(PROGRAM): clean gofmt
|
||||
$(ENV) $(CC) $(BUILD) $(GCFLAGS) $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
$(CC) clean -x
|
||||
|
||||
gofmt:
|
||||
gofmt -w pkg/* main.go
|
||||
|
||||
test:
|
||||
ifeq ($(shell go env GOARCH), $(shell go env GOHOSTARCH))
|
||||
ifeq ($(shell go env GOOS), $(shell go env GOHOSTOS))
|
||||
$(CC) test ./...
|
||||
else
|
||||
$(info skipping tests of other platforms)
|
||||
endif
|
||||
else
|
||||
$(info skipping tests of other platforms)
|
||||
endif
|
||||
|
||||
.PHONY: release release-vendor vendor build clean gofmt test
|
||||
Loading…
Add table
Add a link
Reference in a new issue