From 77534ea71ea7e902908015fb3aad5c48f66c12f6 Mon Sep 17 00:00:00 2001 From: Joan Josep Ordinas Rosa Date: Mon, 19 Nov 2018 10:29:00 +0100 Subject: [PATCH] Implemented `sake` wrapper to `make`. --- Makefile | 11 +-- README.md | 14 ++-- bin/sake | 70 +++++++++++++++++++ docs/README.md | 29 ++++++-- docs/{Makefile => Sakefile} | 43 +++++------- docs/config.yaml | 2 +- docs/content/data.md | 6 ++ docs/make.d/tools.make | 26 ------- .../sake}/make.d/configuration.make | 7 +- .../sake/make.d/main.make | 25 ++++++- {docs => share/sake}/make.d/phase1.jq | 0 {docs => share/sake}/make.d/phase1.make | 4 +- {docs => share/sake}/make.d/phase1_site.jq | 0 {docs => share/sake}/make.d/phase2.jq | 0 {docs => share/sake}/make.d/phase2.make | 30 ++++---- {docs => share/sake}/make.d/phase2_page.jq | 0 {docs => share/sake}/make.d/phase3.jq | 10 ++- {docs => share/sake}/make.d/phase3.make | 49 ++++--------- {docs => share/sake}/make.d/sitemap.jq | 0 {docs => share/sake}/make.d/sitemap.make | 4 +- {docs => share/sake}/make.d/styles.make | 13 ++-- share/sake/make.d/tools.make | 34 +++++++++ {docs/styles => share/sake}/milligram/BEM.m | 0 .../sake}/milligram/COLORNAMES.m | 0 .../sake}/milligram/Normalize.css | 0 .../styles => share/sake}/milligram/base.css | 0 .../sake}/milligram/blockquote.css | 0 .../sake}/milligram/button.css | 0 .../styles => share/sake}/milligram/code.css | 0 .../styles => share/sake}/milligram/color.css | 0 .../sake}/milligram/divider.css | 0 .../styles => share/sake}/milligram/form.css | 0 .../styles => share/sake}/milligram/grid.css | 0 .../styles => share/sake}/milligram/image.css | 0 .../styles => share/sake}/milligram/link.css | 0 .../styles => share/sake}/milligram/list.css | 0 .../sake}/milligram/spacing.css | 0 .../styles => share/sake}/milligram/table.css | 0 .../sake}/milligram/typography.css | 0 .../sake}/milligram/utility.css | 0 40 files changed, 243 insertions(+), 134 deletions(-) create mode 100755 bin/sake rename docs/{Makefile => Sakefile} (60%) delete mode 100644 docs/make.d/tools.make rename {docs => share/sake}/make.d/configuration.make (96%) rename docs/make.d/Makefile.make => share/sake/make.d/main.make (87%) rename {docs => share/sake}/make.d/phase1.jq (100%) rename {docs => share/sake}/make.d/phase1.make (97%) rename {docs => share/sake}/make.d/phase1_site.jq (100%) rename {docs => share/sake}/make.d/phase2.jq (100%) rename {docs => share/sake}/make.d/phase2.make (91%) rename {docs => share/sake}/make.d/phase2_page.jq (100%) rename {docs => share/sake}/make.d/phase3.jq (85%) rename {docs => share/sake}/make.d/phase3.make (74%) rename {docs => share/sake}/make.d/sitemap.jq (100%) rename {docs => share/sake}/make.d/sitemap.make (90%) rename {docs => share/sake}/make.d/styles.make (68%) create mode 100644 share/sake/make.d/tools.make rename {docs/styles => share/sake}/milligram/BEM.m (100%) rename {docs/styles => share/sake}/milligram/COLORNAMES.m (100%) rename {docs/styles => share/sake}/milligram/Normalize.css (100%) rename {docs/styles => share/sake}/milligram/base.css (100%) rename {docs/styles => share/sake}/milligram/blockquote.css (100%) rename {docs/styles => share/sake}/milligram/button.css (100%) rename {docs/styles => share/sake}/milligram/code.css (100%) rename {docs/styles => share/sake}/milligram/color.css (100%) rename {docs/styles => share/sake}/milligram/divider.css (100%) rename {docs/styles => share/sake}/milligram/form.css (100%) rename {docs/styles => share/sake}/milligram/grid.css (100%) rename {docs/styles => share/sake}/milligram/image.css (100%) rename {docs/styles => share/sake}/milligram/link.css (100%) rename {docs/styles => share/sake}/milligram/list.css (100%) rename {docs/styles => share/sake}/milligram/spacing.css (100%) rename {docs/styles => share/sake}/milligram/table.css (100%) rename {docs/styles => share/sake}/milligram/typography.css (100%) rename {docs/styles => share/sake}/milligram/utility.css (100%) diff --git a/Makefile b/Makefile index 5499aed..c446af8 100644 --- a/Makefile +++ b/Makefile @@ -106,14 +106,17 @@ setup: .PHONY: install uninstall +SAKE=$(datadir)/$(PROJECT)/sake/ + install: all - test -d $(bindir) || mkdir --verbose --parents $(bindir) - test -d $(datadir)/$(PROJECT) || mkdir --verbose --parents $(datadir)/$(PROJECT) - test -d $(mandir)/man1 || mkdir --verbose --parents $(mandir)/man1 + install --directory $(bindir) $(datadir) $(mandir)/man1 $(SAKE)/{make.d,milligram} install --verbose --compare --mode 555 bin/* $(bindir) - install --verbose --compare --mode 644 share/* $(datadir)/$(PROJECT) + install --verbose --compare --mode 644 share/*.* $(datadir)/$(PROJECT) install --verbose --compare --mode 644 $(ManPage) $(mandir)/man1 + install --verbose --compare --mode 644 share/sake/make.d/*.* $(SAKE)/make.d + install --verbose --compare --mode 644 share/sake/milligram/*.* $(SAKE)/milligram sed -i -e "s#DATADIR='.*'#DATADIR='$(datadir)'#" $(bindir)/jqt + sed -i -e "s#DATADIR='.*'#DATADIR='$(datadir)'#" $(bindir)/sake uninstall: rm --verbose --force -- $(addprefix $(prefix)/,$(wildcard bin/*)) diff --git a/README.md b/README.md index c41716e..c6b1ca4 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ The file `Makefile` concentrates all the routine procedures, like running the te or install last versions of scripts in the system directories. The main defined _targets_ are: +* `list`: list all targets defined in the Makefile. + * `check`: run the _jqt_ tests. This is the default target. * `clean`: remove all files generated during tests execution. @@ -39,8 +41,6 @@ are: * `uninstall`: remove installed files from the system directories. -* `help`: list all targets defined in the Makefile. - ### Installation In systems with the GNU software installed tools such as [Bash](https://www.gnu.org/software/bash/), @@ -50,7 +50,7 @@ or [Pandoc](http://pandoc.org/); for example, in recent _Fedora Linux_ distribut the following command will install all the extra software _jqt_ needs: ```zsh -$ sudo dnf -y install make general-purpose-preprocessor jq pandoc PyYAML +$ sudo dnf -y install make general-purpose-preprocessor jq pandoc python2-pyyaml ``` To install _jqt_ simply run `make install` on the _jqt_ repository top @@ -67,7 +67,7 @@ _jqt_ top directory: ```zsh $ sudo mkdir -p /usr/local/bin /usr/local/share/jqt $ sudo cp bin/* /usr/local/bin -$ sudo cp share/* /usr/local/share/jqt +$ sudo cp -r share/* /usr/local/share/jqt $ [[ $PATH =~ /usr/local/bin ]] || echo 'Add /usr/local/bin to your PATH' ``` @@ -84,9 +84,9 @@ another `jqt` uses. ### Documentation -The directory [`docs`](./docs/) contains the source files for _jqt_ documentation, and is in itself a subproject with his -own makefile. Please see the directory [`docs`](./docs/) for all information on -this subproject. +The directory [`docs`](./docs/) contains the source files for _jqt_ +documentation. Please see the directory [`docs`](./docs/) for all information +on this subproject.