>> add install recipes

This commit is contained in:
Thomas Lindop 2025-07-22 11:07:09 +01:00
parent c45d3bda9a
commit 9c34a31fde
2 changed files with 14 additions and 12 deletions

3
.gitignore vendored
View file

@ -1,3 +1,2 @@
owl
testdata/
owl.1*
dist/

View file

@ -1,23 +1,26 @@
SOURCES=*.go
LINKER_FLAGS=-X main.OwlVersion=`git describe --tags --dirty`
ifeq (${XDG_DATA_HOME},)
XDG_DATA_HOME=${HOME}/.local/share
endif
MAN_DIR=${XDG_DATA_HOME}/man/man1
BIN_DIR=${HOME}/.local/bin
INSTALL_DIR=${HOME}/.local
owl: ${SOURCES}
go build -o owl -ldflags "${LINKER_FLAGS}" -- ${SOURCES}
owl.1: man.md
pandoc -s --shift-heading-level-by=-1 --to=man man.md > owl.1
build: owl owl.1
test: *.go
go test -v .
install: build
install -m 0777 owl ${BIN_DIR}
mkdir -p ${MAN_DIR}
install owl.1 ${MAN_DIR}
install:
install -m 0755 -D owl ${INSTALL_DIR}/bin/owl
install -m 0644 -D owl.1 ${INSTALL_DIR}/man/man1/owl.1
install -m 0644 -D LICENSE ${INSTALL_DIR}/share/doc/LICENSE
uninstall:
rm -I ${BIN_DIR}/owl ${MAN_DIR}/owl.1
rm -I ${INSTALL_DIR}/bin/owl \
${INSTALL_DIR}/man/man1/owl.1 \
${INSTALL_DIR}/share/doc/LICENSE
.PHONY: build test install uninstall