X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=doc%2FMakefile;h=967443ef0091eb12be9bcf7e6c6595c1f9a227c3;hb=f328532030db1f4e2d97ebde6607dee99e6cde0b;hp=5544976ed514ba10768f89fe783b2d777f99703f;hpb=9e06c888655c3d22540b8baefbe9c3cecd1c3b4f;p=cc65 diff --git a/doc/Makefile b/doc/Makefile index 5544976ed..967443ef0 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,113 +1,64 @@ -# -# Makefile for the cc65 documentation -# - - -# Default for the compiler lib search path as compiler define - -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) - -# ------------------------------------------------------------------------------ -# Rules to make targets - -%.txt: %.sgml - sgml2txt $< - -%.html: %.sgml - sgml2html --split=1 $< - -%.info: %.sgml - sgml2info $< - -%.dvi: %.sgml - sgml2latex $< - -%.tex: %.sgml - sgml2latex --output=tex $< - -# ------------------------------------------------------------------------------ -# Targets - -.PHONY: all -all: txt html info dvi - -.PHONY: txt -txt: $(TXT) - -.PHONY: html -html: $(HTML) - -.PHONY: info -info: $(INFO) - -.PHONY: dvi -dvi: $(DVI) - -.PHONY: tex -tex: $(TEX) - -# The index.html target is special, since it does not get splitted -index.html: index.sgml - sgml2html --split=0 $< +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 -f *~ + $(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 -zap: clean - rm -f $(TXT) $(HTML) $(INFO) $(DVI) $(TEX) *.html *.info-* *.man +zip: + @cd .. && zip cc65 html/*.* -# ------------------------------------------------------------------------------ -# Special target rules +doc: html info -coding.html: coding.sgml - sgml2html --split=0 $< +html: $(addprefix ../html/,$(SGMLS:.sgml=.html) doc.css doc.png) -funcref.html: funcref.sgml - sgml2html --split=2 $< +info: $(addprefix ../info/,$(SGMLS:.sgml=.info)) -index.html: index.sgml - sgml2html --split=0 $< +../html ../info: + @mkdir $@ -# ------------------------------------------------------------------------------ -# Make the dependencies +../html/%.html: %.sgml header.html | ../html + @cd ../html && linuxdoc -B html -s 0 -T $(TOC_LEVEL) -H ../doc/header.html ../doc/$< -.PHONY: depend dep -depend dep: $(OBJS:.o=.c) - @echo "Creating dependency information" - $(CC) -MM $^ > .depend +../html/doc.%: doc.% | ../html + cp $< ../html +../info/%.info: %.sgml | ../info + @cd ../info && linuxdoc -B info ../doc/$< +endif # CMD_EXE