# GNUmakefile for RCS web pages

# Copyright 2025 Free Software Foundation, Inc.
# [This file is no longer maintained.
#  It is kept primarily for historical interest.]
ifeq (1,0)

# Copyright (C) 2010, 2022 Thien-Thi Nguyen

# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

## Commentary:

# The ttn-do command is from:
#  <https://www.gnuvola.org/software/ttn-do/>
#
# The tidy command is from:
#  <https://github.com/htacg/tidy-html5/>
#
# Usage: make [RAW=1]
#
# If given ‘RAW=1’, bypass tidy.  Otherwise, the default is to
# generate the page and pipe it through tidy (with many options).

## Code:

RAW = 0

gen := ttn-do make-gnu-pkg-homepage

ifeq (1,$(RAW))
clean := cat
else
clean := { tidy -i				\
		--vertical-space yes		\
		--doctype omit			\
		--fix-style-tags no		\
		--omit-optional-tags yes	\
		--tidy-mark no ;		\
	   echo '</div></body></html>' ; }
endif

all: rcs.html

rcs.html: NEWS-excerpt

%.html : %.in
	$(gen) $< | $(clean) 1>$@ 2>/dev/null || true

endif

# GNUmakefile ends here
