2021-03-22 21:23:24 +00:00
|
|
|
PREFIX ?= /usr
|
|
|
|
BINDIR ?= $(PREFIX)/bin
|
|
|
|
LIBDIR ?= $(PREFIX)/share/hilbish
|
|
|
|
|
2022-04-14 13:45:50 +00:00
|
|
|
MY_GOFLAGS = -ldflags "-s -w"
|
|
|
|
|
|
|
|
all: dev
|
2021-03-22 21:23:24 +00:00
|
|
|
|
2022-04-14 13:45:50 +00:00
|
|
|
dev: MY_GOFLAGS = -ldflags "-s -w -X main.version=$(shell git describe --tags)"
|
|
|
|
dev: build
|
2021-05-17 23:04:20 +00:00
|
|
|
|
2022-04-14 13:45:50 +00:00
|
|
|
build:
|
|
|
|
go build $(MY_GOFLAGS)
|
|
|
|
|
|
|
|
install: all
|
|
|
|
install -v -d "$(DESTDIR)$(BINDIR)/" && install -m 0755 -v hilbish "$(DESTDIR)$(BINDIR)/hilbish"
|
|
|
|
mkdir -p "$(DESTDIR)$(LIBDIR)"
|
|
|
|
cp -r libs docs emmyLuaDocs prelude .hilbishrc.lua "$(DESTDIR)$(LIBDIR)"
|
|
|
|
grep -qxF "$(DESTDIR)$(BINDIR)/hilbish" /etc/shells || echo "$(DESTDIR)$(BINDIR)/hilbish" >> /etc/shells
|
2021-03-22 21:23:24 +00:00
|
|
|
|
|
|
|
uninstall:
|
2022-04-14 13:45:50 +00:00
|
|
|
rm -vrf \
|
2021-03-26 02:07:58 +00:00
|
|
|
"$(DESTDIR)$(BINDIR)/hilbish" \
|
|
|
|
"$(DESTDIR)$(LIBDIR)"
|
2022-04-14 13:45:50 +00:00
|
|
|
sed -i '/hilbish/d' /etc/shells
|
2021-03-22 21:23:24 +00:00
|
|
|
|
|
|
|
clean:
|
2022-04-14 13:45:50 +00:00
|
|
|
go clean
|
2021-03-22 21:23:24 +00:00
|
|
|
|
2022-04-14 13:45:50 +00:00
|
|
|
.PHONY: all dev build install uninstall clean
|