mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-10-30 01:13:08 +00:00
Add Makefile
This commit is contained in:
parent
c3d0748d27
commit
fbe8122ebd
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
kiln
|
32
Makefile
Normal file
32
Makefile
Normal file
|
@ -0,0 +1,32 @@
|
|||
.POSIX:
|
||||
.SUFFIXES:
|
||||
|
||||
VERSION=0.0.0
|
||||
|
||||
PREFIX?=/usr/local
|
||||
|
||||
GO?=go
|
||||
GOFLAGS?=
|
||||
GOSRC!=find . -name '*.go'
|
||||
GOSRC+=go.mod go.sum
|
||||
|
||||
all: kiln
|
||||
|
||||
kiln: $(GOSRC)
|
||||
$(GO) build $(GOFLAGS) \
|
||||
-ldflags "-X main.Prefix=$(PREFIX) \
|
||||
-X main.ShareDir=$(SHAREDIR) \
|
||||
-X main.Version=$(VERSION)" \
|
||||
-o $@
|
||||
|
||||
clean:
|
||||
rm -f kiln
|
||||
|
||||
install: all
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
install -m755 kiln $(DESTDIR)$(PREFIX)/bin
|
||||
|
||||
uninstall:
|
||||
$(RM) $(DESTDIR)$(PREFIX)/bin/kiln
|
||||
|
||||
.PHONY: all clean install uninstall
|
Loading…
Reference in a new issue