X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=doc%2FMakefile;h=bb8f551ad22f82ac5e27c7be826bb8ffcf7bfc55;hb=HEAD;hp=f90918b97cccb641fb33d245111287eb687e08d8;hpb=5e493842f002c16eb3688257b02a543ca53e794d;p=cc65 diff --git a/doc/Makefile b/doc/Makefile index f90918b97..bb8f551ad 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,88 +1,66 @@ -# -# Makefile for the cc65 documentation -# +ifneq ($(shell echo),) + CMD_EXE = 1 +endif +.PHONY: all mostlyclean clean install zip doc html info -# Default for the compiler lib search path as compiler define +.SUFFIXES: -SGML = ar65.sgml \ - ca65.sgml \ - cc65.sgml \ - cl65.sgml \ - coding.sgml \ - debugging.sgml \ - dio.sgml \ - funcref.sgml \ - geos.sgml \ - index.sgml \ - intro.sgml \ - ld65.sgml \ - library.sgml +htmldir = $(PREFIX)/share/doc/cc65$(DESTPACKAGE_SUFFIX)/html +infodir = $(PREFIX)/share/info -TXT = $(SGML:.sgml=.txt) -HTML = $(SGML:.sgml=.html) -INFO = $(SGML:.sgml=.info) -DVI = $(SGML:.sgml=.dvi) -TEX = $(SGML:.sgml=.tex) +ifdef CMD_EXE -# ------------------------------------------------------------------------------ -# Rules to make targets +doc clean install zip: -%.txt: %.sgml - sgml2txt $< +else # CMD_EXE -%.html: %.sgml - sgml2html --split=1 $< +SGMLS := $(wildcard *.sgml) -%.info: %.sgml - sgml2info $< +../html/coding.html ../html/index.html: \ +TOC_LEVEL = 0 -%.dvi: %.sgml - sgml2latex $< +TOC_LEVEL = 2 -%.tex: %.sgml - sgml2latex --output=tex $< +INSTALL = install -funcref.html: funcref.sgml - sgml2html --split=2 $< +doc: html info -# ------------------------------------------------------------------------------ -# Targets +html: $(addprefix ../html/,$(SGMLS:.sgml=.html) doc.css doc.png) -.PHONY: all -all: txt html info dvi +info: $(addprefix ../info/,$(SGMLS:.sgml=.info)) -.PHONY: txt -txt: $(TXT) +../html ../info: + @mkdir $@ -.PHONY: html -html: $(HTML) +../html/%.html: %.sgml header.html | ../html + @cd ../html && linuxdoc -B html -s 0 -T $(TOC_LEVEL) -H ../doc/header.html ../doc/$< -.PHONY: info -info: $(INFO) +../html/doc.%: doc.% | ../html + cp $< ../html -.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 $< +../info/%.info: %.sgml | ../info + @cd ../info && linuxdoc -B info ../doc/$< clean: - rm -f *~ - -zap: clean - rm -f $(TXT) $(HTML) $(INFO) $(DVI) $(TEX) *.html *.info-* *.man - -# ------------------------------------------------------------------------------ -# Make the dependencies - -.PHONY: depend dep -depend dep: $(OBJS:.o=.c) - @echo "Creating dependency information" - $(CC) -MM $^ > .depend - - + $(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: