X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=doc%2FMakefile;h=33b5c26865ac2476ca2c8ff339192a309f53caa0;hb=a10f36c837c1608c59fa6b7932b547207dd16391;hp=169e6438154a58a828e326bef77da8878b4c9074;hpb=0d4b9c59f38aabe14ef3bb1ede2190b64c651db1;p=cc65 diff --git a/doc/Makefile b/doc/Makefile index 169e64381..33b5c2686 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,134 +1,66 @@ -# -*- 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 \ - apple2enh.sgml \ - ar65.sgml \ - atari.sgml \ - atmos.sgml \ - c128.sgml \ - c16.sgml \ - c64.sgml \ - ca65.sgml \ - ca65html.sgml \ - cbm510.sgml \ - cbm610.sgml \ - cc65.sgml \ - cl65.sgml \ - co65.sgml \ - coding.sgml \ - customizing.sgml\ - da65.sgml \ - debugging.sgml \ - dio.sgml \ - funcref.sgml \ - geos.sgml \ - grc65.sgml \ - index.sgml \ - intro.sgml \ - ld65.sgml \ - library.sgml \ - lynx.sgml \ - using-make.sgml \ - nes.sgml \ - od65.sgml \ - pet.sgml \ - plus4.sgml \ - smc.sgml \ - supervision.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 - linuxdoc -B txt -f $(TXT_OPTIONS) $< - -%.html: %.sgml - linuxdoc -B html --split=1 $(BUTTONS) $< - -%.info: %.sgml - linuxdoc -B info $< - -%.dvi: %.sgml - linuxdoc -B latex --output=dvi $< - -%.tex: %.sgml - linuxdoc -B latex --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 -clean: - $(RM) *~ +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 + +ifdef CMD_EXE + +doc clean install zip: + +else # CMD_EXE + +SGMLS := $(wildcard *.sgml) -.PHONY: zap -zap: clean - $(RM) $(TXT) $(TEX) $(DVI) *.htm* *.inf* *.man +../html/coding.html ../html/index.html: \ +TOC_LEVEL = 0 -# ------------------------------------------------------------------------------ -# Special target rules +TOC_LEVEL = 2 -coding.html: coding.sgml - sgml2html --split=0 $< +INSTALL = install -# funcref.sgml's third section is huge. -# So, funcref.html is split into sub-section files. -# -funcref.html: funcref.sgml - sgml2html --split=2 $(BUTTONS) $< +doc: html info -# 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 $< +html: $(addprefix ../html/,$(SGMLS:.sgml=.html) doc.css doc.png) + +info: $(addprefix ../info/,$(SGMLS:.sgml=.info)) + +../html ../info: + @mkdir $@ + +../html/%.html: %.sgml header.html | ../html + @cd ../html && linuxdoc -B html -s 0 -T $(TOC_LEVEL) -H ../doc/header.html ../doc/$< + +../html/doc.%: doc.% | ../html + cp $< ../html + +../info/%.info: %.sgml | ../info + @cd ../info && linuxdoc -B info ../doc/$< + +clean: + $(RM) -r ../html ../info + +install: + $(if $(PREFIX),,$(error variable `PREFIX' must be set)) +ifeq ($(wildcard ../html),../html) + $(INSTALL) -d $(DESTDIR)$(htmldir) + $(INSTALL) -m0644 ../html/*.* $(DESTDIR)$(htmldir) +endif +ifeq ($(wildcard ../info),../info) + $(INSTALL) -d $(DESTDIR)$(infodir) + $(INSTALL) -m0644 ../info/*.* $(DESTDIR)$(infodir) +endif + +zip: +ifneq "$(wildcard ../html)" "" + @cd .. && zip cc65 html/*.* +endif + +endif # CMD_EXE + +all mostlyclean: