# rcsid $Id: Makefile,v 1.1 1995/09/03 09:14:06 smp Exp smp $

# makefile for doc

# special command to load *.html files onto http server
# NOT provided with distribution, make EMPTY if a problem
##LOAD_HTML_SERVER = LOAD.rchtml
LOAD_HTML_SERVER =


include ../rc.mk
PACKAGE = doc
DIR = doc

FILES = \
	Makefile \
	README.rc.sgml

ASCIIS = \
	README.rc.ascii

HTMLS = \
	README.rc*\.html

TMP_FILE = tmp.html

.PHONY : all
all :	README.rc.html
all :	README.rc.ascii

html :	README.rc.html
ascii :	README.rc.ascii

README.rc.ascii :	README.rc.sgml
	$(SGMLFORMAT) -f ascii README.rc.sgml

README.rc.html :	README.rc.sgml
	$(SGMLFORMAT) -f html README.rc.sgml
	$(MAKE) FIX.rc.html
	$(LOAD_HTML_SERVER)

FIX.rc.html:
	@echo FIXing "$(HTMLS)"
	@$(foreach f,$(wildcard $(HTMLS)), \
		sed 's/&lt;/</g' $(f) > $(TMP_FILE); \
		sed 's/&gt;/>/g' $(TMP_FILE) > $(f);)
	@rm -f $(TMP_FILE)

.PHONY : clean
clean:
	rm -f $(ASCIIS) $(HTMLS) $(TMP_FILE)

.PHONY : install
install : README.rc.ascii README.rc.html
	cp $(ASCIIS) $(HTMLS) $(DOC_DIR)

.PHONY : ci
ci :
	ci -l $(FILES) $(TOOLS)

.PHONY : list
list :
	@$(foreach f,$(FILES),echo $(PPATH)$(PACKAGE)/$(f);)
##	@$(foreach f,$(ASCIIS),echo $(PPATH)$(PACKAGE)/$(f);)
##	@$(foreach f,$(wildcard $(HTMLS)),echo $(PPATH)$(PACKAGE)/$(f);)
