aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 8 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index b2c7a5f..f30181c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
# Carbs Packaging Tools
--include config.mk
+include config.mk
INSTALL_SH = ./tools/install.sh
CONTRIB = `find contrib -name 'cpt*' ! -name '*.*'`
@@ -7,13 +7,13 @@ SRC = `find src -name 'cpt*' ! -name '*.*'`
BIN = ${SRC} ${CONTRIB}
all: src/cpt-lib
- @if ! [ -e config.mk ]; then echo "Please run './configure'"; exit 1; fi
@test "${DOCS}" != yes || ${MAKE} -C docs all
src/cpt-lib: src/cpt-lib.in
sed -n '/^Copyright/{s,^, ",;s,$$," \\,;p}' LICENSE | \
sed -e '/@LICENSE@/r /dev/stdin' \
-e '/@LICENSE@/d' \
+ -e 's|@SYSCONFDIR@|${SYSCONFDIR}|g' \
-e "s|@VERSION@|${VERSION}|g" \
-e "s|@DOCSTRING@|Call functions from the library|g" src/cpt-lib.in > $@
chmod 755 $@
@@ -22,7 +22,10 @@ shellspec: all tests/etc/cpt-hook
shellspec
shellcheck: all
- cd src; find . ../contrib -name 'cpt*' ! -name '*.*' -exec shellcheck -e 2119 -x -f gcc {} +
+ @cd src; find . ../contrib -name 'cpt*' ! -name '*.*' | while read -r file; do \
+ echo SHELLCHECK "$$file"; \
+ shellcheck -e 2119 -x -f gcc "$$file"; \
+ done
test: shellspec shellcheck
@@ -30,15 +33,14 @@ tests/etc/cpt-hook:
ln -s ../hook-file $@
dist: docs/cpt.info
- @if ! [ -e config.mk ]; then echo "Please run './configure'"; exit 1; fi
./tools/mkdist.sh "${VERSION}"
install: all
test "${DOCS}" != yes || ${MAKE} -C docs install
[ -f docs/cpt.info ] && \
- ${INSTALL_SH} -Dm644 docs/cpt.info ${DESTDIR}${INFODIR}/cpt.info
+ ${INSTALL_SH} -Dm644 docs/cpt.info ${DESTDIR}${INFODIR}/cpt.info ||:
[ -f docs/cpt.txt ] && \
- ${INSTALL_SH} -Dm644 docs/cpt.txt ${DESTDIR}${DOCDIR}/cpt.txt
+ ${INSTALL_SH} -Dm644 docs/cpt.txt ${DESTDIR}${DOCDIR}/cpt.txt ||:
${INSTALL_SH} -Dm644 CHANGELOG.md ${DESTDIR}${DOCDIR}/CHANGELOG
${INSTALL_SH} -Dm755 -t ${DESTDIR}${BINDIR} ${BIN}
${INSTALL_SH} -Dm644 -t ${DESTDIR}${MAN1} man/*.1