commit 035ce9b59a26ba073cb8472889083201da19e9e4 parent 0948a64aff8fb1956b56c69da72b28b33b35f201 Author: Cem Keylan <cem@ckyln.com> Date: Wed, 12 Feb 2020 14:35:50 +0300 simplify Makefile and build Diffstat:
M | Makefile | | | 71 | +++++++++++++++++++++-------------------------------------------------- |
M | sb.in | | | 4 | ++-- |
2 files changed, 23 insertions(+), 52 deletions(-)
diff --git a/Makefile b/Makefile @@ -1,63 +1,34 @@ -# sb -# See LICENSE file for copyright and license details. - -# sb version VERSION = 1.3.1-p1 -# path PREFIX = /usr/local +BINDIR = ${PREFIX}/bin MANPREFIX = ${PREFIX}/share/man CONF = \$$HOME/.config/sbrc -all: options build +all: sb -options: - @echo Installation options for sb - @echo PREFIX = ${PREFIX} - @echo MANPREFIX = ${MANPREFIX} - @echo VERSION = ${VERSION} - @echo CONF = ${CONF} +sb: + sed 's#conffile#${CONF}#g;s#VERSION="git"#VERSION="${VERSION}"#g' sb.in > sb + chmod +x sb -build: - @echo Generating sb from sb.in - @rm -f sb - @sed "s#vnumber#${VERSION}#g" sb.in > sb - @sed -i "s#conffile#${CONF}#g" sb - @chmod +x sb +clean: + rm -f sb install: all - @echo Installing sb ${VERSION} to ${DESTDIR}${PREFIX}/bin - @mkdir -p ${DESTDIR}${PREFIX}/bin - @sed "s#getfunctionpath#${PREFIX}/share/sb-func#g" < sb > ${DESTDIR}${PREFIX}/bin/sb - @chmod 755 ${DESTDIR}${PREFIX}/bin/sb - @echo Installing sb function modules to ${DESTDIR}${PREFIX}/share/sb-func - @mkdir -p ${DESTDIR}${PREFIX}/share/sb-func - @cp -f func/* ${DESTDIR}${PREFIX}/share/sb-func - @chmod 644 ${DESTDIR}${PREFIX}/share/sb-func/* - @echo Installing manuals to ${DESTDIR}${MANPREFIX} - @mkdir -p ${DESTDIR}${MANPREFIX}/man1 - @mkdir -p ${DESTDIR}${MANPREFIX}/man5 - @sed "s#vnumber#${VERSION}#g" < sb.1 > ${DESTDIR}${MANPREFIX}/man1/sb.1 - @sed "s#vnumber#${VERSION}#g" < sbrc.5 > ${DESTDIR}${MANPREFIX}/man5/sbrc.5 - @chmod 644 ${DESTDIR}${MANPREFIX}/man1/sb.1 - @chmod 644 ${DESTDIR}${MANPREFIX}/man5/sbrc.5 - @echo Copying sbrc.example to ${DESTDIR}${PREFIX}/share/sb - @mkdir -p ${DESTDIR}${PREFIX}/share/sb - @cp -f sbrc.example ${DESTDIR}${PREFIX}/share/sb/sbrc.example + mkdir -p ${DESTDIR}${BINDIR} + sed 's#FUNCPATH="./func"#FUNCPATH="${PREFIX}/share/sb-func"#g' < sb > ${DESTDIR}${BINDIR}/sb + chmod +x ${DESTDIR}${BINDIR}/sb + install -Dm644 -t ${DESTDIR}${PREFIX}/share/sb-func func/* + mkdir -p ${DESTDIR}${MANPREFIX}/man1 + mkdir -p ${DESTDIR}${MANPREFIX}/man5 + sed 's#vnumber#${VERSION}#g' < sb.1 > ${DESTDIR}${MANPREFIX}/man1/sb.1 + sed 's#vnumber#${VERSION}#g' < sbrc.5 > ${DESTDIR}${MANPREFIX}/man5/sbrc.5 uninstall: - @echo Removing sb from ${DESTDIR}${PREFIX}/bin - @rm -f ${DESTDIR}${PREFIX}/bin/sb - @echo Removing sb-func from ${DESTDIR}${PREFIX}/share - @rm -rf ${DESTDIR}${PREFIX}/share/sb-func - @echo Removing manuals from ${DESTDIR}${MANPREFIX} - @rm -f ${DESTDIR}${MANPREFIX}/man1/sb.1 - @rm -f ${DESTDIR}${MANPREFIX}/man5/sbrc.5 - @echo Removing ${DESTDIR}${PREFIX}/share/sb - @rm -rf ${DESTDIR}${PREFIX}/share/sb - -clean: - @echo Removing sb - @rm -f sb + rm -rf \ + ${DESTDIR}${BINDIR}/sb \ + ${DESTDIR}${PREFIX}/share/sb-func \ + ${DESTDIR}${MANPREFIX}/man1/sb.1 \ + ${DESTDIR}${MANPREFIX}/man5/sbrc.5 -.PHONY: all options build install uninstall clean +.PHONY: all install clean uninstall diff --git a/sb.in b/sb.in @@ -1,8 +1,8 @@ #!/usr/bin/env sh # See the LICENSE file for copyright and license details. -FUNCPATH="getfunctionpath" -VERSION="vnumber" +FUNCPATH="./func" +VERSION="git" usage() { cat <<EOF