cpt

Carbs Packaging Tools
git clone git://git.carbslinux.org/cpt
Log | Files | Refs | README | LICENSE

commit 11d5bfa20b8b8258c4d98691abd332283a613e0c
parent 46fa118a9c8ca1653ade77b0f8429f4f8b005db8
Author: Cem Keylan <cem@ckyln.com>
Date:   Fri,  4 Sep 2020 12:47:58 +0300

Makefile: add option to install tools "statically"

'make install-static' will now install shell tools statically, meaning that
cpt-lib will be written into the installed tool, so the tool will not depend
on the existence of the shell library.

Diffstat:
MMakefile | 35++++++++++++++++++++++++++++++-----
1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile @@ -13,17 +13,42 @@ all: ${BIN} clean: rm -f ${BIN} ${OBJ} -install: all - for bin in src/* ${BIN} contrib/*; do \ +install-bin: ${BIN} + for bin in ${BIN}; do \ install -Dm755 $${bin} ${DESTDIR}${BINDIR}/$${bin##*/}; done + +install-src: + for bin in src/*; do \ + install -Dm755 $${bin} ${DESTDIR}${BINDIR}/$${bin##*/}; done + +install-contrib: + for bin in contrib/*; do \ + install -Dm755 $${bin} ${DESTDIR}${BINDIR}/$${bin##*/}; done + +install-contrib-static: + mkdir -p ${DESTDIR}${BINDIR} + for bin in contrib/*; do \ + sed '/\. cpt-lib/r src/cpt-lib' $${bin} | \ + sed '/\. cpt-lib/d' > ${DESTDIR}${BINDIR}/$${bin##*/}; \ + chmod 755 ${DESTDIR}${BINDIR}/$${bin##*/}; done + +install-src-static: + mkdir -p ${DESTDIR}${BINDIR} + for bin in src/*; do \ + sed '/\. cpt-lib/r src/cpt-lib' $${bin} | \ + sed '/\. cpt-lib/d' > ${DESTDIR}${BINDIR}/$${bin##*/}; \ + chmod 755 ${DESTDIR}${BINDIR}/$${bin##*/}; done + +install-doc: for man in man/*.1; do install -Dm644 $${man} ${DESTDIR}${MAN1}/$${man##*/}; done - for doc in doc/*; do install -Dm644 $${doc} ${DESTDIR}${CPTDOC}/$${doc##*/}; done + +install: install-bin install-src install-contrib install-doc +install-static: install-bin install-src-static install-contrib-static install-doc uninstall: for bin in ${BIN} src/* contrib/*; do \ rm -f ${DESTDIR}${BINDIR}/$${bin##*/}; done for man in man/*; do rm -f ${DESTDIR}${MAN1}/$${man##*/}; done - rm -rf ${DESTDIR}${CPTDOC} -.PHONY: all install uninstall clean +.PHONY: all install-bin install-src install-contrib install-doc install-src-static install-contrib-static install uninstall test clean