mirror of
https://github.com/Hilbis/Hilbish
synced 2025-07-03 09:44:17 +00:00
build: return Makefile
This commit is contained in:
parent
387d7d2243
commit
59739e929a
@ -1,7 +1,7 @@
|
|||||||
# 🎀 Changelog
|
# 🎀 Changelog
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
**NOTE:** Hilbish now uses [Task] insead of Make for builds.
|
**NOTE:** Hilbish now uses [Task] insead of Make for builds. Make is still available as a build method.
|
||||||
|
|
||||||
[Task]: https://taskfile.dev/#/
|
[Task]: https://taskfile.dev/#/
|
||||||
|
|
||||||
|
30
Makefile
Normal file
30
Makefile
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
PREFIX ?= /usr
|
||||||
|
BINDIR ?= $(PREFIX)/bin
|
||||||
|
LIBDIR ?= $(PREFIX)/share/hilbish
|
||||||
|
|
||||||
|
MY_GOFLAGS = -ldflags "-s -w"
|
||||||
|
|
||||||
|
all: dev
|
||||||
|
|
||||||
|
dev: MY_GOFLAGS = -ldflags "-s -w -X main.gitCommit=$(shell git rev-parse --short HEAD) -X main.gitBranch=$(shell git rev-parse --abbrev-ref HEAD)"
|
||||||
|
dev: build
|
||||||
|
|
||||||
|
build:
|
||||||
|
go build $(MY_GOFLAGS)
|
||||||
|
|
||||||
|
install:
|
||||||
|
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)"
|
||||||
|
grep -qxF "$(DESTDIR)$(BINDIR)/hilbish" /etc/shells || echo "$(DESTDIR)$(BINDIR)/hilbish" >> /etc/shells
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
rm -vrf \
|
||||||
|
"$(DESTDIR)$(BINDIR)/hilbish" \
|
||||||
|
"$(DESTDIR)$(LIBDIR)"
|
||||||
|
sed -i '/hilbish/d' /etc/shells
|
||||||
|
|
||||||
|
clean:
|
||||||
|
go clean
|
||||||
|
|
||||||
|
.PHONY: all dev build install uninstall clean
|
Loading…
x
Reference in New Issue
Block a user