From 30c0c11f5e8da2306970477630a97c472dd7941b Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Mon, 12 Jul 2021 23:53:52 +0300 Subject: add makefile --- Makefile | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ config.mk | 13 +++++++++++++ docs.el | 18 ++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 Makefile create mode 100644 config.mk create mode 100644 docs.el diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..23b8cf2 --- /dev/null +++ b/Makefile @@ -0,0 +1,52 @@ +include config.mk +ORG = carbslinux.org fdl.org +TEXI = carbslinux.texi + +TARGET = carbslinux.info install.txt carbslinux.txt + +all: ${TARGET} + +carbslinux.info: carbslinux.texi + ${MAKEINFO} -o $@ carbslinux.texi + +install.txt: ${ORG} + ${EMACS} carbslinux.org -f docs-install-txt + +carbslinux.txt: ${ORG} + ${EMACS} carbslinux.org -f org-ascii-export-to-ascii + +carbslinux.texi: ${ORG} + ${EMACS} carbslinux.org -f org-texinfo-export-to-texinfo + +clean: + rm -f carbslinux.info + +allclean: clean + rm -f carbslinux.txt install.txt carbslinux.texi + +htmldocs: + mkdir -p "${HTMLDIR}" + rm -rf ${HTMLDIR}/carbslinux \ + ${HTMLDIR}/carbslinux.html \ + ${HTMLDIR}/install.html.in \ + ${HTMLDIR}/install.txt + ${MAKEINFO} --html -o ${HTMLDIR}/carbslinux ${TEXI} + ${MAKEINFO} --html --no-split -o ${HTMLDIR}/carbslinux.html ${TEXI} + cp install.txt ${HTMLDIR}/install.txt + +install: + install -Dm644 carbslinux.info "${DESTDIR}${INFODIR}/carbslinux.info" + install -Dm644 carbslinux.txt "${DESTDIR}${DOCDIR}/carbslinux/carbslinux.txt" + +uninstall: + rm -f "${DESTDIR}${INFODIR}/carbslinux.info" + rm -f "${DESTDIR}${DOCDIR}/carbslinux/carbslinux.txt" + +dist: ${TARGET} + mkdir -p carbs-docs-${VERSION} + cp README.md Makefile config.mk ${ORG} ${TEXI} ${TARGET} carbs-docs-${VERSION} + tar cf carbs-docs-${VERSION}.tar carbs-docs-${VERSION} + xz -z carbs-docs-${VERSION}.tar + rm -r carbs-docs-${VERSION} + +.PHONY: all dist htmldocs install clean uninstall diff --git a/config.mk b/config.mk new file mode 100644 index 0000000..b9fc5ec --- /dev/null +++ b/config.mk @@ -0,0 +1,13 @@ +VERSION = 2021.07 + +# System and build directories +PREFIX = /usr/local +SHAREDIR = ${PREFIX}/share +INFODIR = ${SHAREDIR}/info +DOCDIR = ${SHAREDIR}/doc +HTMLDIR = ./carbslinux + +EMACS = emacs --batch -l docs.el +MAKEINFO = makeinfo + +INSTALLSH = ./tools/install.sh diff --git a/docs.el b/docs.el new file mode 100644 index 0000000..d6d53ff --- /dev/null +++ b/docs.el @@ -0,0 +1,18 @@ +;;; docs.el --- configuration for docs exports +;;; Commentary: +;;; Code: +(require 'org) +(require 'ox) +(require 'ox-ascii) + +;; We do NOT want backup files. +(setq make-backup-files nil) + +(defun docs-install-txt () + "Extract and export installation manual from the User Manual." + (let ((org-export-with-toc nil)) + (re-search-forward "^* Installation") + (org-ascii-export-to-ascii nil t))) + +(provide 'docs) +;;; docs.el ends here -- cgit v1.2.3