lume/Makefile

25 lines
563 B
Makefile
Raw Normal View History

2021-03-02 20:41:58 -06:00
V ?= 0
Q = $(if $(filter 1, $V),, @)
2021-03-02 00:41:55 -06:00
2021-03-01 22:59:11 -06:00
ifeq ($(OS), Windows_NT)
EXE=lume.exe
2021-03-02 00:40:22 -06:00
RM=del /f /q
2021-03-02 20:41:18 -06:00
BUILD_DATE=$(shell powershell Get-Date -Format "yyyy-MM-ddThh:mm:sszzz")
2021-03-01 22:59:11 -06:00
else
EXE=lume
EXE=rm -f
2021-03-02 20:41:18 -06:00
BUILD_DATE=$(shell date --iso-8601=seconds)
2021-03-01 22:59:11 -06:00
endif
2021-03-02 20:41:18 -06:00
LUME_VERSION ?= $(shell git describe --tags --always)
2021-03-03 00:29:40 -06:00
LDFLAGS := $(LDFLAGS) \
-X git.kill0.net/chill9/lume/cmd.Version=$(LUME_VERSION) \
-X git.kill0.net/chill9/lume/cmd.BuildDate=$(BUILD_DATE)
2021-03-02 20:41:18 -06:00
2020-02-29 12:55:28 -06:00
.PHONY: build
build:
2021-03-03 00:29:40 -06:00
$(Q) go build -o $(EXE) -ldflags="$(LDFLAGS)" ./cmd/lume
2020-02-29 12:55:28 -06:00
.PHONY: clean
clean:
2021-03-03 00:29:40 -06:00
$(RM) $(EXE)