%.html: echo -n > $@ INDEXES = index.html $(patsubst %,%/index.html,$(SUBDIRECTORIES)) indexes: $(INDEXES) @: .PHONY: clean_indexes clean_indexes: $(RM) $(RMFLAGS) $(INDEXES) clean: clean_indexes LISTING_FILE:= listing.html .PHONY: listing_message listing_message: @echo Creating $(LISTING_FILE) from $(DIRECTORY) .PHONY: listing listing: BASH := /usr/bin/env bash listing: ROOT := "../`[ -d "../${NAME}" ] && echo ${NAME} || echo $(DIRECTORY)`" listing: CREATE := sed 's/ \\//g' | $(BASH) -s - "$(NAME)" "$(ROOT)" "$(HREFPREFIX)" "$(DETAILSATTRIBUTES)" listing: listing_message @echo ' \ listing() \ { \ local title="$${1}" \ local directory="$${2}" \ local hrefprefix="$${3:+$${3}/}" \ local detailsattributes="$${4}" \ \ cat << _END_ \
  • \ $${title} \ $$(list " " "$${directory}" "$${hrefprefix}" "") \ \ _END_ \ } \ list() \ { \ local indent="$${1}" \ local directory="$${2}/" \ local hrefprefix="$${3:-}" \ local detailsattributes="$${4:-}" \ local file="" \ local name="" \ echo "$${indent}" \ } \ set -euo pipefail \ listing "$${1}" "$${2:-.}" "$${3:-}" "$${4:-}"' | $(CREATE) > $(LISTING_FILE) .PHONY: clean_listing clean_listing: $(RM) $(RMFLAGS) $(LISTING_FILE) clean: clean_listing .PHONY: text_manual text_manual: manual $(RM) $(RMFLAGS) $(MANPAGE) $(MANUAL_MDOC:.mdoc=.d) .PHONY: website website: clean stripformfeeds .WAIT text_manual .WAIT listing .WAIT indexes