aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-09-14 19:58:02 +0300
committerCem Keylan <cem@ckyln.com>2020-09-14 19:58:02 +0300
commit53e4b3243664705ad1ac5c6223f13877bf849f96 (patch)
tree7959c804a452dd7f1cc8ef82b8dcebfa6dfa3e02
parentfdebe8e585426ec55012108bcb16a2f16b044bd8 (diff)
downloaddocs-53e4b3243664705ad1ac5c6223f13877bf849f96.tar.gz
Makefile: create proper Makefile meant to distribute itself.
-rw-r--r--Makefile39
-rw-r--r--extMakefile13
2 files changed, 28 insertions, 24 deletions
diff --git a/Makefile b/Makefile
index fff2442..5967622 100644
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,39 @@
# This Makefile is meant to generate a dist tarball in order to avoid installing
# texinfo on the target system.
-TARBALL=carbs-docs-`date +%Y-%m-%d`
-DESTDIR=./docs
+PREFIX = /usr/local
+SHAREDIR = ${PREFIX}/share
+INFODIR = ${SHAREDIR}/info
+DOCDIR = ${SHAREDIR}/doc
+TARBALL = carbs-docs-`date +%Y%m%d`
+DESTDIR = ./carbslinux
+TEXI = contribution.texi cpt.texi init.texi install.texi top.texi
+OBJ = carbslinux.info carbslinux.txt
-all:
+all: ${OBJ}
-dist:
+clean:
+ rm -f ${OBJ} ${TARBALL}.tar.gz
+
+carbslinux.txt: ${TEXI}
+ makeinfo --plaintext top.texi -o carbslinux.txt
+
+carbslinux.info: ${TEXI}
+ makeinfo top.texi -o carbslinux.info
+
+dist: ${OBJ}
mkdir -p ${TARBALL}
- makeinfo -o ${TARBALL}/carbslinux.info top.texi
- makeinfo --plaintext top.texi > ${TARBALL}/carbslinux.txt
- cp extMakefile ${TARBALL}/Makefile
+ cp ${OBJ} ${TEXI} Makefile README ${TARBALL}
tar -cf ${TARBALL}.tar ${TARBALL}
gzip -9 ${TARBALL}.tar
- rm -rf ${TARBALL}.tar ${TARBALL}
+ rm -rf ${TARBALL}.tar ${TARBALL}
-htmldocs:
- rm -rf -- ${DESTDIR}
+htmldocs: ${OBJ}
+ rm -f -- ${DESTDIR}/*
makeinfo --html -o ${DESTDIR} top.texi
makeinfo --plaintext -o ${DESTDIR}/install.txt install.texi
-.PHONY: all dist htmldocs
+install: carbslinux.info carbslinux.txt
+ install -Dm644 carbslinux.info ${DESTDIR}${INFODIR}/carbslinux.info
+ install -Dm644 carbslinux.txt ${DESTDIR}${DOCDIR}/carbslinux.txt
+
+.PHONY: all dist htmldocs install clean
diff --git a/extMakefile b/extMakefile
deleted file mode 100644
index 61e61fb..0000000
--- a/extMakefile
+++ /dev/null
@@ -1,13 +0,0 @@
-PREFIX=/usr/local
-SHAREDIR=${PREFIX}/share
-INFODIR=${SHAREDIR}/info
-DOCDIR=${SHAREDIR}/doc
-
-all:
- @echo run make install
-
-install:
- install -Dm644 carbslinux.info ${DESTDIR}${INFODIR}/carbslinux.info
- install -Dm644 carbslinux.txt ${DESTDIR}${DOCDIR}/carbslinux.txt
-
-.PHONY: all install