-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
131 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# cache | ||
/docs/.yummy | ||
# built site | ||
/docs/_site | ||
# man pages | ||
jqt.1.gz | ||
# other | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
######################################################################## | ||
# 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 | ||
|
||
#!# Only one target at the same time | ||
#!MAKECMDGOALS ?= all | ||
#!ifneq (1,$(words $(MAKECMDGOALS))) | ||
#!$(error Only one target accepted!) | ||
#!endif | ||
|
||
# Check 'root' intentions | ||
ifeq (,$(filter install uninstall,$(MAKECMDGOALS))) | ||
ifeq (0,$(shell id --user)) | ||
$(error Root only can make "(un)install" targets) | ||
endif | ||
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. | ||
.PHONY: all | ||
.DEFAULT_GOAL := all | ||
|
||
# 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: | ||
|
||
#!# Enable a second expansion of the prerequisites | ||
#!.SECONDEXPANSION: | ||
|
||
######################################################################## | ||
# Common macros | ||
######################################################################## | ||
|
||
# Hacks for string manipulation | ||
comma := , | ||
empty := | ||
space := $(empty) $(empty) | ||
|
||
# Hack for list manipulation | ||
rest = $(wordlist 2,2147483648,$1) | ||
|
||
#!# Make a directory if it no exists | ||
#!define mkdir | ||
#! if test ! -d $1; then \ | ||
#! echo 1>&2 '==> $1'; \ | ||
#! mkdir --parents $1; \ | ||
#! fi | ||
#!endef | ||
|
||
# vim:ai:sw=8:ts=8:noet:fileencoding=utf8:syntax=make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
######################################################################## | ||
# Metadata | ||
######################################################################## | ||
|
||
# Imported variables: | ||
# Metadata | ||
|
||
# Metadata directory | ||
$(Metadata): | ||
$(info ==> $@) | ||
mkdir $@ >/dev/null 2>&1 || true | ||
|
||
# Main configuration file | ||
ifeq (config.yaml, $(wildcard config.yaml)) | ||
|
||
# Convert config.yaml to $(Metadata)/config.json | ||
$(Metadata)/config.json: config.yaml \ | ||
| $(Metadata) | ||
$(info ==> $@) | ||
yaml2json <$< >$@ | ||
|
||
else ifeq (config.json, $(wildcard config.json)) | ||
|
||
# Convert config.json to $(Metadata)/config.json | ||
$(Metadata)/config.json: config.json \ | ||
| $(Metadata) | ||
$(info ==> $@) | ||
cp $< $@ | ||
|
||
else | ||
$(error Configuration file not found) | ||
endif | ||
|
||
# vim:ai:sw=8:ts=8:noet:fileencoding=utf8:syntax=make |