X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=doc%2FMakefile;h=967443ef0091eb12be9bcf7e6c6595c1f9a227c3;hb=f328532030db1f4e2d97ebde6607dee99e6cde0b;hp=7b295c31fb9b0ac8796ee676dd682fcb927d9fa2;hpb=52d0b2b5a728d7c8c3e7e2f96e92073b740d090f;p=cc65 diff --git a/doc/Makefile b/doc/Makefile index 7b295c31f..967443ef0 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,127 +1,64 @@ -# -*- makefile -*- -# -# Makefile for the cc65 documentation -# - -# You can put navigation-arrow pictures (next, back, contents) into HTML files -# by setting this variable, either here or on make's command-line. -# (You will need to copy the .png files from "share/doc/linuxdoc-tools*/html/".) -# -#BUTTONS=-I - -# These options decide how text files are made: -# -f -- removes the backspace-overtyping that makes bold text -# in the more/less commands and on typewriter-printers -# -m -- makes Unix manual pages -# -#TXT_OPTIONS=-f -m - -SGML = apple2.sgml \ - ar65.sgml \ - atari.sgml \ - atmos.sgml \ - c128.sgml \ - c16.sgml \ - c64.sgml \ - ca65.sgml \ - ca65html.sgml \ - cbm610.sgml \ - cc65.sgml \ - cl65.sgml \ - co65.sgml \ - coding.sgml \ - da65.sgml \ - debugging.sgml \ - dio.sgml \ - funcref.sgml \ - geos.sgml \ - grc.sgml \ - index.sgml \ - intro.sgml \ - ld65.sgml \ - library.sgml \ - lynx.sgml \ - nes.sgml \ - pet.sgml \ - plus4.sgml \ - vic20.sgml - -TXT = $(SGML:.sgml=.txt) -HTML = $(SGML:.sgml=.html) -INFO = $(SGML:.sgml=.info) -DVI = $(SGML:.sgml=.dvi) -TEX = $(SGML:.sgml=.tex) - -# ------------------------------------------------------------------------------ -# Pattern-rules, to make targets - -%.txt: %.sgml - sgml2txt $(TXT_OPTIONS) $< - -%.html: %.sgml - sgml2html --split=1 $(BUTTONS) $< - -%.info: %.sgml - sgml2info $< - -%.dvi: %.sgml - sgml2latex $< - -%.tex: %.sgml - sgml2latex --output=tex $< - -# ------------------------------------------------------------------------------ -# Targets - -.PHONY: all -all: txt html info dvi - -.PHONY: txt -txt: linuxdoc $(TXT) - -.PHONY: html -html: linuxdoc $(HTML) - -.PHONY: info -info: linuxdoc $(INFO) - -.PHONY: dvi -dvi: linuxdoc $(DVI) - -.PHONY: tex -tex: linuxdoc $(TEX) - -.PHONY: linuxdoc -linuxdoc: - @sgmlcheck index >/dev/null 2>&1 || { \ - echo; \ - echo '"LinuxDoc Tools" does not exist on this system.'; \ - echo 'So, most of the documentation might not have been built.'; \ - echo; \ - false;} - -.PHONY: clean +ifneq ($(shell echo),) + CMD_EXE = 1 +endif + +.PHONY: all mostlyclean clean install zip doc html info + +.SUFFIXES: + +htmldir = $(prefix)/share/doc/cc65$(DESTPACKAGE_SUFFIX)/html +infodir = $(prefix)/share/info + +all mostlyclean: + +ifdef CMD_EXE + +clean install zip doc: + +else # CMD_EXE + +SGMLS := $(wildcard *.sgml) + +../html/coding.html ../html/index.html: \ +TOC_LEVEL = 0 + +TOC_LEVEL = 2 + +INSTALL = install + clean: - $(RM) *~ + $(RM) -r ../html ../info + +install: + $(if $(prefix),,$(error variable `prefix' must be set)) +ifeq ($(wildcard ../html),../html) + $(INSTALL) -d $(DESTDIR)$(htmldir) + $(INSTALL) -m644 ../html/*.* $(DESTDIR)$(htmldir) +endif +ifeq ($(wildcard ../info),../info) + $(INSTALL) -d $(DESTDIR)$(infodir) + $(INSTALL) -m644 ../info/*.* $(DESTDIR)$(infodir) +endif + +zip: + @cd .. && zip cc65 html/*.* + +doc: html info + +html: $(addprefix ../html/,$(SGMLS:.sgml=.html) doc.css doc.png) + +info: $(addprefix ../info/,$(SGMLS:.sgml=.info)) -.PHONY: zap -zap: clean - $(RM) $(TXT) $(TEX) $(DVI) *.htm* *.inf* *.man +../html ../info: + @mkdir $@ -# ------------------------------------------------------------------------------ -# Special target rules +../html/%.html: %.sgml header.html | ../html + @cd ../html && linuxdoc -B html -s 0 -T $(TOC_LEVEL) -H ../doc/header.html ../doc/$< -coding.html: coding.sgml - sgml2html --split=0 $< +../html/doc.%: doc.% | ../html + cp $< ../html -# funcref.sgml's third section is huge. -# So, funcref.html is split into sub-section files. -# -funcref.html: funcref.sgml - sgml2html --split=2 $(BUTTONS) $< +../info/%.info: %.sgml | ../info + @cd ../info && linuxdoc -B info ../doc/$< -# The index.html target is special: -# It is only a table of contents. So, it should not be split. -# -index.html: index.sgml - sgml2html --split=0 $< +endif # CMD_EXE