diff --git a/Makefile b/Makefile index 5b72216..e7b7c02 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,7 @@ # jqt management # -project=jqt - -include make.d/config.make -include make.d/debug.make +project := jqt ######################################################################## # Parameters (redefine as you like) @@ -14,12 +11,80 @@ prefix ?= /usr/local bindir ?= $(prefix)/bin datadir ?= $(prefix)/share +######################################################################## +# Prerequisites +######################################################################## + +# We are using some of the newest GNU Make features... so require GNU +# Make version >= 3.82 +version_test := $(filter 3.82,$(firstword $(sort $(MAKE_VERSION) 3.82))) +ifndef version_test +$(error GNU Make version $(MAKE_VERSION); version >= 3.82 is needed) +endif + +# Paranoia +ifeq (0,$(shell id --user)) +ifeq (,$(filter install uninstall,$(MAKECMDGOALS))) +$(error Root only can make "(un)install" targets) +endif +SUDO := +else +SUDO := sudo +endif + +######################################################################## +# Configuration +######################################################################## + +# Disable builtins. +MAKEFLAGS += --no-builtin-rules +MAKEFLAGS += --no-builtin-variables + +# Warn when an undefined variable is referenced. +MAKEFLAGS += --warn-undefined-variables + +# Make will not print the recipe used to remake files. +.SILENT: + +# Eliminate use of the built-in implicit rules. Also clear out the +# default list of suffixes for suffix rules. +.SUFFIXES: + +# Sets the default goal to be used if no targets were specified on the +# command line. +.DEFAULT_GOAL := all + +# When it is time to consider phony targets, make will run its recipe +# unconditionally, regardless of whether a file with that name exists or +# what its last-modification time is. +.PHONY: all + +# When a target is built all lines of the recipe will be given to a +# single invocation of the shell. +# !!!Does not work in make <= 3.82 event it is documented!!! +#.ONESHELL: + +# Default shell: if we require GNU Make, why not require Bash? +SHELL := /bin/bash + +# The argument(s) passed to the shell are taken from the variable +# .SHELLFLAGS. +.SHELLFLAGS := -o errexit -o pipefail -o nounset -c + +# Make will delete the target of a rule if it has changed and its recipe +# exits with a nonzero exit status. +.DELETE_ON_ERROR: + ######################################################################## # Rules ######################################################################## -# Configure tools -include make.d/setup.make +# Warning: only `dnf`! Use this rule as template to your own script. +setup: + @rpm -q --quiet general-purpose-preprocessor || sudo dnf -y install general-purpose-preprocessor + @rpm -q --quiet jq || sudo dnf -y install jq + @rpm -q --quiet pandoc || sudo dnf -y install pandoc + @test -d /usr/share/doc/PyYAML || sudo dnf -y install PyYAML # Default target all: check diff --git a/docs/Makefile b/docs/Makefile index 794480a..34eb462 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -101,7 +101,8 @@ TARGETS := $(foreach f,$(ASSETS) $(foreach p,index $(PAGES),$(p).html),$(DESTINA # Main all: $(TARGETS) test -f /etc/xml/xhtml1-dtds.xml \ - && xmllint --noout --valid $(DESTINATION)/*.html + && xmllint --noout --valid $(DESTINATION)/*.html \ + && echo 'XHTML valid!' # Directories $(CACHE) $(DESTINATION): diff --git a/docs/content/engine.md b/docs/content/engine.md index 6e16651..46a4d2d 100644 --- a/docs/content/engine.md +++ b/docs/content/engine.md @@ -1,7 +1,7 @@ --- <%include "site.yaml"> title: Operating the engine -updated: "2016-08-13T07:48:26Z" +updated: "2016-08-15T11:17:00Z" --- <%include "macros.m">& <%include "LINKS.md">& @@ -168,7 +168,7 @@ on the modules `json` and `yaml`. The project uses [GNU Make][MAKE] on several development activities, but `make` is not necessary to run `jqt`. -All external shell commands called by `jqt` are: +The external shell commands called by `jqt` are: * `cat` * `gpp` @@ -182,7 +182,7 @@ All external shell commands called by `jqt` are: * `sleep` * `tee` -Under a recent <%cite Fedora> <%cite Linux> distribution the following commands will install +Under a recent <%cite Fedora> <%cite Linux> distribution the following command will install all the extra software _jqt_ needs: ```zsh @@ -192,31 +192,33 @@ $ sudo dnf -y install make general-purpose-preprocessor jq pandoc PyYAML ## Installation If you know how to use `make` please read the `Makefile` located in the _jqt_ -top directory and run `make install` if you agree with the thinks that will +top directory and run `make install` if you agree with the things that will happen. You can also change the installation directory: ```zsh $ sudo make install prefix=/your/installation/path ``` -You can also install _jqt_ by hand with few orders like: +But if you choose a directory diferent of `/usr/local/share` for the shared data +you must still edit the parameter `DATADIR` definition in the `bin/jqt` file. +You can also install _jqt_ by hand executing few orders from the _jqt_ top +directory: ```zsh $ sudo mkdir -p /usr/local/bin /usr/local/share/jqt -$ sudo cp bin/jqt /usr/local/bin -$ sudo chmod +x /usr/local/bin/jqt +$ sudo cp bin/* /usr/local/bin $ sudo cp share/* /usr/local/share/jqt ``` If you are using a recent <%cite Fedora> <%cite Linux> distribution or similar -`make` will also help you to install all the extra software _jqt_ needs: +`make` will also help you to install all the extra software _jqt_ needs (except +`make` itself): ```zsh $ sudo make setup ``` - <# vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=markdown #> diff --git a/docs/content/home.md b/docs/content/home.md index 95ecfe7..e0c3654 100644 --- a/docs/content/home.md +++ b/docs/content/home.md @@ -1,6 +1,6 @@ --- <%include "site.yaml"> -updated: "2016-08-13T07:48:26Z" +updated: "2016-08-15T08:56:24Z" --- <%include "macros.m">& <%include "LINKS.md">& @@ -74,8 +74,9 @@ example looks like a template? ### Status -If you want to learn to use _jqt_, read the documentation at -[https://fadado.github.io/jqt/][JQT]. _jqt_ is developed under the _Fedora_ Linux +If you want to learn to use _jqt_, [read this documentation](#) +and [install _jqt_](./engine.html#installation) and associated utilities. +_jqt_ is developed under the _Fedora_ Linux distribution, and a lot of portability issues are expected at this stage of development. Please, use the project [GitHub repository][REPO] features if you want to collaborate or send any kind of questions. diff --git a/make.d/config.make b/make.d/config.make deleted file mode 100644 index 8dc3e4c..0000000 --- a/make.d/config.make +++ /dev/null @@ -1,65 +0,0 @@ -######################################################################## -# Prerequisites -######################################################################## - -# We are using some of the newest GNU Make features... so require GNU -# Make version >= 3.82 -version_test := $(filter 3.82,$(firstword $(sort $(MAKE_VERSION) 3.82))) -ifndef version_test -$(error GNU Make version $(MAKE_VERSION); version >= 3.82 is needed) -endif - -# Paranoia -ifeq (0,$(shell id --user)) -ifeq (,$(filter install uninstall,$(MAKECMDGOALS))) -$(error Root only can make "(un)install" targets) -endif -SUDO := -else -SUDO := sudo -endif - -######################################################################## -# Configuration -######################################################################## - -# Disable builtins. -MAKEFLAGS += --no-builtin-rules -MAKEFLAGS += --no-builtin-variables - -# Warn when an undefined variable is referenced. -MAKEFLAGS += --warn-undefined-variables - -# Make will not print the recipe used to remake files. -.SILENT: - -# Eliminate use of the built-in implicit rules. Also clear out the -# default list of suffixes for suffix rules. -.SUFFIXES: - -# Sets the default goal to be used if no targets were specified on the -# command line. -.DEFAULT_GOAL := all - -# When it is time to consider phony targets, make will run its recipe -# unconditionally, regardless of whether a file with that name exists or -# what its last-modification time is. -.PHONY: all - -# When a target is built all lines of the recipe will be given to a -# single invocation of the shell. -# !!!Does not work in make <= 3.82 event it is documented!!! -#.ONESHELL: - -# Default shell: if we require GNU Make, why not require Bash? -SHELL := /bin/bash - -# The argument(s) passed to the shell are taken from the variable -# .SHELLFLAGS. -.SHELLFLAGS := -o errexit -o pipefail -o nounset -c - -# Make will delete the target of a rule if it has changed and its recipe -# exits with a nonzero exit status. -.DELETE_ON_ERROR: - -# vim:ai:sw=8:ts=8:noet:syntax=make diff --git a/make.d/debug.make b/make.d/debug.make deleted file mode 100644 index 7fea9e0..0000000 --- a/make.d/debug.make +++ /dev/null @@ -1,30 +0,0 @@ -######################################################################## -# Tools -######################################################################## - -# -# Check required tools -# - -ifneq (file,$(shell type -t gpp)) -$(error Run 'make setup' to install gpp using dnf) -endif - -ifneq (file,$(shell type -t jq)) -$(error Run 'make setup' to install jq using dnf) -endif - -ifneq (file,$(shell type -t pandoc)) -$(error Run 'make setup' to install pandoc using dnf) -endif - -# -# Show variable value. Usage: make ?VARNAME -# - -?%: .force - echo -E '$($*)' - -.force: # simulate phony target - -# vim:ai:sw=8:ts=8:noet:syntax=make diff --git a/make.d/setup.make b/make.d/setup.make deleted file mode 100644 index 75243cf..0000000 --- a/make.d/setup.make +++ /dev/null @@ -1,16 +0,0 @@ -######################################################################## -# Setup -######################################################################## - -# -# Install dependencies -# - -# Warning: only `dnf`! Use this rule as template to your own script. -setup: - @rpm -q --quiet general-purpose-preprocessor || sudo dnf -y install general-purpose-preprocessor - @rpm -q --quiet jq || sudo dnf -y install jq - @rpm -q --quiet pandoc || sudo dnf -y install pandoc - @test -d /usr/share/doc/PyYAML || sudo dnf -y install PyYAML - -# vim:ai:sw=8:ts=8:noet:syntax=make diff --git a/tests/expected/macros-00.txt b/tests/expected/macros-00.txt index a10d18d..417164f 100644 --- a/tests/expected/macros-00.txt +++ b/tests/expected/macros-00.txt @@ -4,16 +4,11 @@ frameborder="0">