# $Revision: 1.3 $ $Date: 2026-07-17 03:29:27-04 $
# $Source: /doc/html/htdocs/bezoar.org/local/posts/2025/0304/selinux/RCS/Makefile,v $
# $Host: furbag.home.arpa $
# $UUID: 5cf9ab38-38ea-3f2a-bf21-a2ab6c79fd76 $
#
# Run with no arguments to show available targets.

ARCH   = /tmp/policies.tar
SHELL := /bin/sh
.POSIX:
.PHONY: help build config clean install all

help: ## show all targets
	@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | \
	awk 'BEGIN {FS = ":.*?## "} \
		{printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

MANIFEST:   ## make file manifest for tarball to upload
	mkman

build:  ## turn policies.t2t into index.htm
	txt2tags -t html -o - policies.t2t > index.htm

clean: ## clean up build files
	rm -f index.htm MANIFEST
	-test -f $(ARCH) && rm $(ARCH)

example:    ## create TOC page for my local policies
	(cd examples; ls2htm -t "My local policies" index.wn > index.htm)

install: MANIFEST   ## create tarball to upload to my website
	tar cf $(ARCH) `grep -v '^#' MANIFEST | awk '{print $$1}'`
	hcst put $(ARCH) && rm $(ARCH)
