Hilbish/Makefile

31 lines
738 B
Makefile
Raw Normal View History

PREFIX ?= /usr
BINDIR ?= $(PREFIX)/bin
LIBDIR ?= $(PREFIX)/share/hilbish
2022-04-14 13:45:50 +00:00
MY_GOFLAGS = -ldflags "-s -w"
all: dev
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)
2022-04-14 14:11:20 +00:00
install:
2022-04-14 13:45:50 +00:00
install -v -d "$(DESTDIR)$(BINDIR)/" && install -m 0755 -v hilbish "$(DESTDIR)$(BINDIR)/hilbish"
mkdir -p "$(DESTDIR)$(LIBDIR)"
cp -r libs docs emmyLuaDocs nature .hilbishrc.lua "$(DESTDIR)$(LIBDIR)"
2022-04-14 13:45:50 +00:00
grep -qxF "$(DESTDIR)$(BINDIR)/hilbish" /etc/shells || echo "$(DESTDIR)$(BINDIR)/hilbish" >> /etc/shells
uninstall:
2022-04-14 13:45:50 +00:00
rm -vrf \
"$(DESTDIR)$(BINDIR)/hilbish" \
"$(DESTDIR)$(LIBDIR)"
2022-04-14 13:45:50 +00:00
sed -i '/hilbish/d' /etc/shells
clean:
2022-04-14 13:45:50 +00:00
go clean
2022-04-14 13:45:50 +00:00
.PHONY: all dev build install uninstall clean