Files
casecmp/Makefile
Jim Myhrberg 9a904fee99 feat!: remove external dependencies
Remove the kingpin external dependency, and instead just use Go's stdlib
flag package.

BREAKING CHANGE: Long versions of command line flags are no longer supported.
2022-11-14 19:01:31 +00:00

28 lines
605 B
Makefile

NAME = casecmp
BINARY = bin/${NAME}
VERSION ?= $(shell cat VERSION)
SOURCES = $(shell find . -name '*.go' -o -name 'Makefile')
$(BINARY): $(SOURCES)
CGO_ENABLED=0 go build -o ${BINARY} -ldflags \ "\
-s -w \
-X main.version=${VERSION} \
-X main.commit=$(shell git show --format="%h" --no-patch)"
.PHONY: build
build: $(BINARY)
.PHONY: run
run: $(BINARY)
$(BINARY)
.PHONY: clean
clean:
$(eval BIN_DIR := $(shell dirname ${BINARY}))
if [ -f ${BINARY} ]; then rm ${BINARY}; fi
if [ -d ${BIN_DIR} ]; then rmdir ${BIN_DIR}; fi
.PHONY: docker
docker:
docker build -t "$(shell whoami)/$(NAME)" .