-
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
34 changed files
with
408 additions
and
424 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
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 |
---|---|---|
@@ -1,158 +1,56 @@ | ||
######################################################################## | ||
# Makefile | ||
# | ||
# Project: jqt | ||
# Author: <Joan Josep Ordinas Rosa> [email protected] | ||
# Description: Makefile for JQT web site management. | ||
# Published: https://fadado.github.io/jqt/ | ||
# | ||
# Variables: | ||
# $(Metadata) | ||
# Rules: | ||
# $(Metadata) directory target and clobber method | ||
# Project specific makefile. All the imported modules are expected to be | ||
# independent, valid for any project without any change. This should be | ||
# the only makefile to edit by hand! | ||
# | ||
######################################################################## | ||
|
||
######################################################################## | ||
# Load _Make_ configuration. | ||
######################################################################## | ||
|
||
include make.d/configuration.make | ||
|
||
# Do not try to rebuilt static makefiles. | ||
Makefile make.d/configuration.make: ; | ||
|
||
######################################################################## | ||
# Metadata directory for all generated make and metadata files. | ||
######################################################################## | ||
|
||
Metadata ?= .meta | ||
|
||
$(Metadata): | ||
$(info ==> $@) | ||
mkdir --parents $@ >/dev/null 2>&1 || true | ||
|
||
# Delete all generated metadata | ||
clobber:: ; @rm -rf $(Metadata) | ||
|
||
######################################################################## | ||
# Print debug info. | ||
######################################################################## | ||
|
||
ifneq (,$(TRACE)) | ||
ifdef MAKE_RESTARTS | ||
$(info Makefile phase restarted: $(MAKE_RESTARTS)) | ||
endif | ||
endif | ||
|
||
######################################################################## | ||
# Check command line sanity. | ||
######################################################################## | ||
|
||
# Target 'clobber' must be alone. | ||
ifeq (clobber,$(filter clobber,$(MAKECMDGOALS))) | ||
ifneq (1,$(words $(MAKECMDGOALS))) | ||
$(error Target "clobber" must be alone) | ||
endif | ||
endif | ||
# Variables used: | ||
# Root | ||
# | ||
# Variables modified: | ||
# JQTFLAGS | ||
|
||
# Do not build to clobber immediately. | ||
ifeq (clobber,$(MAKECMDGOALS)) | ||
ifeq (,$(wildcard $(Metadata))) | ||
$(error Nothing to clobber) | ||
endif | ||
endif | ||
#Meta := .meta | ||
#VERBOSE := 1 | ||
#TRACE := 1 | ||
|
||
# Do not build to clean immediately. | ||
ifeq (clean,$(filter clean,$(MAKECMDGOALS))) | ||
ifeq (,$(wildcard $(Metadata))) | ||
$(error Nothing to clean) | ||
endif | ||
endif | ||
include make.d/Makefile.make | ||
|
||
# Check _root_ intentions. | ||
ifeq (,$(filter install uninstall,$(MAKECMDGOALS))) | ||
ifeq (0,$(shell id --user)) | ||
$(error Root only can make "(un)install" targets) | ||
endif | ||
else | ||
ifneq (0,$(shell id --user)) | ||
$(error Only root can make "(un)install" targets) | ||
endif | ||
endif | ||
# Last phase, after metadata configuration. | ||
ifdef __build | ||
|
||
######################################################################## | ||
# Include all makefile phases. | ||
# Build pages options. | ||
######################################################################## | ||
|
||
# Recursive variable used in all included makefiles. This works because the | ||
# included files do not include other makefiles. | ||
|
||
THIS = $(lastword $(MAKEFILE_LIST)) | ||
# Pandoc options | ||
JQTFLAGS += -5 --toc-depth=4 | ||
|
||
######################################################################## | ||
# Derive metadata from `config.yaml` or `config.json`. | ||
|
||
-include $(Metadata)/phase1.make | ||
include make.d/phase1.make | ||
|
||
# Do not try to rebuilt static makefiles. | ||
make.d/phase1.make: ; | ||
|
||
# If `__phase_1` is not defined because `phase1.make` does not exists, after | ||
# this point the rest of the file is ignored, but `phase1.make` is built | ||
# because a rule exists in the file `config.make`. Then this `Makefile` is | ||
# restarted, `MAKE_RESTARTS` is be equal to 1, `phase1.make` is now loaded and | ||
# `__phase_1` is defined. Equivalent situation happens in all phases. | ||
|
||
ifdef __phase_1 | ||
|
||
# HTML 5 validation. | ||
######################################################################## | ||
# Build metadata from filesystem introspection. | ||
|
||
-include $(Metadata)/phase2.make | ||
include make.d/phase2.make | ||
# Download vnu.jar from `https://github.com/validator/validator/releases`. | ||
|
||
# Do not try to rebuilt static makefiles. | ||
make.d/phase2.make: ; | ||
.PHONY: h5.valid h5.lint | ||
|
||
ifdef __phase_2 | ||
|
||
######################################################################## | ||
# Define standard rules and rules for HTML pages and nodes. | ||
|
||
-include $(Metadata)/phase3.make | ||
include make.d/phase3.make | ||
|
||
# Do not try to rebuilt static makefiles. | ||
make.d/phase3.make: ; | ||
|
||
ifdef __phase_3 | ||
|
||
######################################################################## | ||
# Several complementary makefiles. | ||
|
||
include make.d/sitemap.make | ||
include make.d/styles.make | ||
##include make.d/tools.make | ||
|
||
# Do not try to rebuilt static makefiles. | ||
make.d/sitemap.make: ; | ||
make.d/styles.make: ; | ||
##make.d/tools.make: ; | ||
|
||
######################################################################## | ||
# Project specific makefile. All the previous modules are expected to be | ||
# independent, valid for any project without any change. This file must | ||
# exist but can be empty. | ||
# Validation tool. | ||
VNU := /usr/local/vnu/vnu.jar | ||
|
||
include config.make | ||
# Validation. | ||
h5.valid: build | ||
@xmlwf $(Root)/*.html | ||
@java -jar $(VNU) --errors-only --format gnu $(Root)/*.html | ||
|
||
# Do not try to rebuilt static makefiles. | ||
config.make: ; | ||
# Validation with warnings. | ||
h5.lint: build | ||
@xmlwf $(Root)/*.html | ||
@java -jar $(VNU) --format text $(Root)/*.html | ||
|
||
endif # __phase_3 | ||
endif # __phase_2 | ||
endif # __phase_1 | ||
endif # __build | ||
|
||
# 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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.