]> git.sur5r.net Git - cc65/blobdiff - doc/Makefile
Merge remote-tracking branch 'upstream/master' into a5200
[cc65] / doc / Makefile
index 3dff24f68c46789e34adee1ca84b6efd413e8d1a..159c300210a95c6591d88f8b7928ea51b10ebc19 100644 (file)
@@ -1,63 +1,48 @@
-#
-# Makefile for the cc65 documentation
-#
+ifneq ($(shell echo),)
+  CMD_EXE = 1
+endif
 
+.PHONY: all mostlyclean clean install zip doc html info gh-pages
 
-# Default for the compiler lib search path as compiler define
+.SUFFIXES:
 
-SGML  =        ar65.sgml       \
-       ca65.sgml
+all mostlyclean install:
 
-TXT   =        $(SGML:.sgml=.txt)
-HTML  = $(SGML:.sgml=.html)
-INFO  = $(SGML:.sgml=.info)
-DVI   = $(SGML:.sgml=.dvi)
+ifdef CMD_EXE
 
-# ------------------------------------------------------------------------------
-# Rules to make targets
+clean zip doc:
 
-%.txt: %.sgml
-       sgml2txt $<
+else # CMD_EXE
 
-%.html:        %.sgml
-       sgml2html $<
+SGMLS := $(wildcard *.sgml)
 
-%.info:        %.sgml
-       sgml2info $<
+../html/coding.html ../html/index.html: \
+TOC_LEVEL = 0
 
-%.dvi: %.sgml
-       sgml2latex $<
+TOC_LEVEL = 2
 
-# ------------------------------------------------------------------------------
-# Targets
-
-.PHONY: all
-all:   txt html info dvi
-
-.PHONY:        txt
-txt:   $(TXT)
+clean:
+       $(RM) -r ../html ../info
 
-.PHONY:        html
-html:  $(HTML)
+zip:
+       @cd .. && zip cc65 html/*.*
 
-.PHONY:        info
-info:  $(INFO)
+doc: html info
 
-.PHONY:        dvi
-dvi:   $(DVI)
+html: $(addprefix ../html/,$(SGMLS:.sgml=.html) doc.css doc.png)
 
-clean:
-       rm -f *~
+info: $(addprefix ../info/,$(SGMLS:.sgml=.info))
 
-zap:   clean
-       rm -f $(TXT) $(HTML) $(INFO) $(DVI)
+../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