directory/Makefile
sneak f1dcc7acf4
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
checkpoint
2024-06-15 07:41:37 -07:00

43 lines
801 B
Makefile

FN := directory
VERSION := $(shell git describe --always --dirty=-dirty)
ARCH := $(shell uname -m)
UNAME_S := $(shell uname -s)
GOLDFLAGS += -X main.Version=$(VERSION)
GOLDFLAGS += -X main.Buildarch=$(ARCH)
GOFLAGS := -ldflags "$(GOLDFLAGS)"
default: clean debug
commit: fmt lint
git commit -a
fmt:
golangci-lint run --fix
lint:
golangci-lint run
sh -c 'test -z "$$(gofmt -l .)"'
debug: ./$(FN)
DEBUG=1 GOTRACEBACK=all ./$(FN)d
debugger:
cd cmd/$(FN) && dlv debug main.go
run: ./$(FN)d
./$(FN)d
clean:
-rm -f ./$(FN) debug.log
docker:
docker build --progress plain .
./$(FN): cmd/$(FN)/main.go internal/*/*.go assets/*/*
cd ./cmd/$(FN) && \
go build -o ../../$(FN) $(GOFLAGS) .
./importer: cmd/importer/main.go internal/*/*.go
go build -o ./importer $(GOFLAGS) ./cmd/importer