aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-09-04 09:47:58 +0000
committermerakor <cem@ckyln.com>2020-09-04 09:47:58 +0000
commitb24b207ae08088459b8276856b927f9fec5996db (patch)
tree8987c414e8b40a7a0300d9bbcd5c82afb4a0feac /Makefile
parent3ba0366faf94c1a65f1c16a72d5c9c1149732a9c (diff)
downloadcpt-b24b207ae08088459b8276856b927f9fec5996db.tar.gz
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. FossilOrigin-Name: 905f3dd2700f187735e985af26c3eb9e11e566b16c24e0aec7425009fe913fb7
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 30 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index e1fab61..e3cebcf 100644
--- 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