mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-18 04:51:05 +01:00
Various additions:
- added a man page - added build and install code to the Makefile - enhanced the README
This commit is contained in:
22
Makefile
22
Makefile
@@ -3,16 +3,24 @@
|
||||
tool = tablizer
|
||||
version = $(shell egrep "^var version = " cmd/root.go | cut -d'=' -f2 | cut -d'"' -f 2)
|
||||
archs = android darwin freebsd linux netbsd openbsd windows
|
||||
PREFIX = /usr/local
|
||||
UID = root
|
||||
GID = 0
|
||||
|
||||
all:
|
||||
@echo "Type 'make install' to install $(tool)"
|
||||
all: buildlocal man
|
||||
|
||||
install:
|
||||
install -m 755 -d $(bindir)
|
||||
install -m 755 -d $(linkdir)
|
||||
install -m 755 $(tool) $(bindir)/$(tool)-$(version)
|
||||
ln -sf $(bindir)/$(tool)-$(version) $(linkdir)/$(tool)
|
||||
man:
|
||||
pod2man -c "User Commands" -r 1 -s 1 $(tool).pod > $(tool).1
|
||||
|
||||
buildlocal:
|
||||
go build
|
||||
|
||||
release:
|
||||
mkdir -p releases
|
||||
$(foreach arch,$(archs), GOOS=$(arch) GOARCH=amd64 go build -x -o releases/$(tool)-$(arch)-amd64-$(version); sha256sum releases/$(tool)-$(arch)-amd64-$(version) | cut -d' ' -f1 > releases/$(tool)-$(arch)-amd64-$(version).sha256sum;)
|
||||
|
||||
install: buildlocal
|
||||
install -d -o $(UID) -g $(GID) $(PREFIX)/bin
|
||||
install -d -o $(UID) -g $(GID) $(PREFIX)/man/man1
|
||||
install -o $(UID) -g $(GID) -m 555 $(tool) $(PREFIX)/sbin/
|
||||
install -o $(UID) -g $(GID) -m 444 $(tool).1 $(PREFIX)/man/man1/
|
||||
|
||||
Reference in New Issue
Block a user