aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2021-02-04 14:30:43 +0000
committermerakor <cem@ckyln.com>2021-02-04 14:30:43 +0000
commit97312778a09decf65030e994e72ce07434ce0f07 (patch)
treeeeb18b94a461a05a6993d98ab9a68eee1152faf9 /Makefile
parent63c4051197cfcad2231de6eb9874055d668f47df (diff)
downloadcpt-97312778a09decf65030e994e72ce07434ce0f07.tar.gz
cpt: switch back to 'make'
FossilOrigin-Name: 048c099fa4155f31725c51c27b09359d7b04f4c2d7e64f2a2b381ab7dea7803d
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f90bc46
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,43 @@
+# Carbs Packaging Tools
+include config.mk
+
+INSTALL_SH = ./tools/install.sh
+BIN = `find contrib src -name 'cpt*' ! -name '*.*'`
+LIB = src/cpt-lib
+LIB_IN = ${LIB:=.in}
+
+all: src/cpt-lib
+ test "${DOCS}" != yes || ${MAKE} -C docs all
+
+src/cpt-lib: src/cpt-lib.in
+ sed -e "s|@VERSION@|${VERSION}|g" \
+ -e "s|@DOCSTRING@|Call functions from the library|g" < src/cpt-lib.in > $@
+ chmod 755 $@
+
+test: all
+ shellspec
+ cd src; find . ../contrib -name 'cpt*' ! -name '*.*' -exec shellcheck -e 2119 -x -f gcc {} +
+
+dist: docs/cpt.info
+ mkdir "cpt-${VERSION}"
+ cp -r ${DISTFILES} "cpt-${VERSION}"
+ tar cf "cpt-${VERSION}.tar" "cpt-${VERSION}"
+ xz -z "cpt-${VERSION}.tar"
+ rm -rf -- "cpt-${VERSION}"
+
+install:
+ test "${DOCS}" != yes || ${MAKE} -C docs install
+ ${INSTALL_SH} -Dm755 -t ${DESTDIR}${BINDIR} ${BIN}
+ ${INSTALL_SH} -Dm644 -t ${DESTDIR}${MAN1} man/*.1
+
+uninstall:
+ test "${DOCS}" != yes || ${MAKE} -C docs uninstall
+ for bin in ${BIN}; do \
+ rm -f ${DESTDIR}${BINDIR}/$${bin##*/}; done
+ for man in man/*.1; do rm -f ${DESTDIR}${MAN1}/$${man##*/}; done
+
+clean:
+ test "${DOCS}" != yes || ${MAKE} -C docs clean
+ rm -rf src/cpt-lib "cpt-${VERSION}.tar.xz" coverage report
+
+.PHONY: all dist clean install uninstall