20 lines
417 B
Makefile
20 lines
417 B
Makefile
# Get version from git tags
|
|
VERSION := $(shell git describe --tags --always 2>/dev/null)
|
|
|
|
.PHONY: clean
|
|
|
|
build/lab-ca: main.go ca.go certdb.go
|
|
@mkdir -p build
|
|
ifneq ($(VERSION),)
|
|
@echo "Building version: $(VERSION)"
|
|
go build -o build/lab-ca -ldflags "-X main.Version=$(VERSION)"
|
|
else
|
|
@echo "Building without version information"
|
|
go build -o build/lab-ca .
|
|
endif
|
|
|
|
lab-ca: build/lab-ca
|
|
|
|
clean:
|
|
rm -f build/lab-ca
|