2021-03-22 21:23:24 +00:00
|
|
|
PREFIX ?= /usr
|
2021-03-26 02:07:58 +00:00
|
|
|
DESTDIR ?=
|
2021-03-22 21:23:24 +00:00
|
|
|
BINDIR ?= $(PREFIX)/bin
|
|
|
|
LIBDIR ?= $(PREFIX)/share/hilbish
|
|
|
|
|
|
|
|
build:
|
2021-05-17 23:38:53 +00:00
|
|
|
@go build -ldflags "-s -w"
|
2021-03-22 21:23:24 +00:00
|
|
|
|
2021-05-17 23:04:20 +00:00
|
|
|
dev:
|
2021-05-17 23:38:53 +00:00
|
|
|
@go build -ldflags "-s -w -X main.version=$(shell git describe --tags)"
|
2021-05-17 23:04:20 +00:00
|
|
|
|
2022-02-27 23:21:21 +00:00
|
|
|
gnurl:
|
|
|
|
@go build -ldflags "-s -w -X main.version=$(shell git describe --tags)+grnurl" -tags gnurl
|
2021-05-14 10:22:20 +00:00
|
|
|
|
2021-03-23 04:05:21 +00:00
|
|
|
install:
|
2021-03-26 02:07:58 +00:00
|
|
|
@install -v -d "$(DESTDIR)$(BINDIR)/" && install -m 0755 -v hilbish "$(DESTDIR)$(BINDIR)/hilbish"
|
|
|
|
@mkdir -p "$(DESTDIR)$(LIBDIR)"
|
2021-10-16 19:33:22 +00:00
|
|
|
@cp libs docs preload.lua .hilbishrc.lua "$(DESTDIR)$(LIBDIR)" -r
|
2021-04-24 23:32:41 +00:00
|
|
|
@grep "$(DESTDIR)$(BINDIR)/hilbish" -qxF /etc/shells || echo "$(DESTDIR)$(BINDIR)/hilbish" >> /etc/shells
|
2021-03-22 21:23:24 +00:00
|
|
|
@echo "Hilbish Installed"
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
@rm -vrf \
|
2021-03-26 02:07:58 +00:00
|
|
|
"$(DESTDIR)$(BINDIR)/hilbish" \
|
|
|
|
"$(DESTDIR)$(LIBDIR)"
|
|
|
|
@sed -i '/hilbish/d' /etc/shells
|
2021-03-22 21:23:24 +00:00
|
|
|
@echo "Hilbish Uninstalled"
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@go clean
|
|
|
|
|
|
|
|
all: build install
|
|
|
|
|
2021-05-17 23:22:58 +00:00
|
|
|
.PHONY: install uninstall build dev hilbiline clean
|