Hilbish/Makefile

32 lines
781 B
Makefile
Raw Normal View History

PREFIX ?= /usr
DESTDIR ?=
BINDIR ?= $(PREFIX)/bin
LIBDIR ?= $(PREFIX)/share/hilbish
build:
@go build -ldflags "-s -w"
2021-05-17 23:04:20 +00:00
dev:
@go build -ldflags "-s -w -X main.version=$(shell git describe --tags)"
2021-05-17 23:04:20 +00:00
install:
@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
@grep "$(DESTDIR)$(BINDIR)/hilbish" -qxF /etc/shells || echo "$(DESTDIR)$(BINDIR)/hilbish" >> /etc/shells
@echo "Hilbish Installed"
uninstall:
@rm -vrf \
"$(DESTDIR)$(BINDIR)/hilbish" \
"$(DESTDIR)$(LIBDIR)"
@sed -i '/hilbish/d' /etc/shells
@echo "Hilbish Uninstalled"
clean:
@go clean
all: build install
2021-05-17 23:22:58 +00:00
.PHONY: install uninstall build dev hilbiline clean