Self-documenting Makefile experiment

git-svn-id: file:///srv/svn/repo/aya/trunk@97 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
shinyoukai
2026-01-10 12:14:01 +00:00
parent 15ff43ba7a
commit e991109b4c

View File

@@ -8,16 +8,24 @@ DATE ?= `date -u +%F`
GOOS ?= `${GO} env GOOS`
VERSION ?= 1.0I+${REV}
REV ?= `svn info --show-item revision || git rev-list --all | wc -l`
build:
all: help
build: ## Build
${GO} build ${GOFLAGS} ./cmd/aya
clean:
clean: ## Remove built artifact(s)
rm -f aya
help:
@printf "Aya v%s\n" ${VERSION}
@printf "Build targets: \n"
@printf "\n"
@awk 'BEGIN {FS = ":.*## "}; /^[a-zA-Z0-9_.%-]+:.*## / {printf " %-12s%s\n", $$1, $$2}' ${MAKEFILE}
pre-install:
mkdir -p ${DESTDIR}${BINDIR}
mkdir -p ${DESTDIR}${MANDIR}/man1
install:
install: pre-install ## Copy the built artifact(s) and manual pages into the system
install -m0755 aya ${DESTDIR}${BINDIR}
install -m0644 aya.1 ${DESTDIR}${MANDIR}/man1
uninstall:
uninstall: ## Remove the built artifact(s) and manual pages from the system
rm -f ${DESTDIR}${BINDIR}/aya
rm -f ${DESTDIR}${MANDIR}/man1/aya.1