directory/Makefile

43 lines
801 B
Makefile
Raw Permalink Normal View History

2024-06-01 22:39:55 +00:00
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 .)"'
2024-06-01 23:07:34 +00:00
debug: ./$(FN)
2024-06-01 22:39:55 +00:00
DEBUG=1 GOTRACEBACK=all ./$(FN)d
debugger:
2024-06-01 23:07:34 +00:00
cd cmd/$(FN) && dlv debug main.go
2024-06-01 22:39:55 +00:00
run: ./$(FN)d
./$(FN)d
clean:
2024-06-01 23:07:34 +00:00
-rm -f ./$(FN) debug.log
2024-06-01 22:39:55 +00:00
docker:
docker build --progress plain .
2024-06-01 23:07:34 +00:00
./$(FN): cmd/$(FN)/main.go internal/*/*.go assets/*/*
cd ./cmd/$(FN) && \
go build -o ../../$(FN) $(GOFLAGS) .
2024-06-15 14:41:37 +00:00
./importer: cmd/importer/main.go internal/*/*.go
go build -o ./importer $(GOFLAGS) ./cmd/importer