1 ## -----------------------------------------------------------------------
3 ## Copyright 2012 Gene Cumm
5 ## Some logic from win32/Makefile:
6 ## Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
7 ## Copyright 2010 Intel Corporation; author: H. Peter Anvin
9 ## This program is free software; you can redistribute it and/or modify
10 ## it under the terms of the GNU General Public License as published by
11 ## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
12 ## Boston MA 02111-1307, USA; either version 2 of the License, or
13 ## (at your option) any later version; incorporated herein by reference.
15 ## -----------------------------------------------------------------------
18 ## AsciiDoc documentation for syslinux
22 MAKEDIR
= $(topdir
)/mk
23 # include $(MAKEDIR)/embedded.mk
29 A2X_MAN_OPTS
= -D man
-f manpage
31 DOCS
= syslinux.txt syslinux-cli.txt syslinux.cfg.txt \
32 isolinux.txt pxelinux.txt
33 MAN_DOCS
= man
/syslinux
.1 man
/syslinux-cli
.1 man
/syslinux.cfg
.5 \
34 man
/isolinux
.1 man
/pxelinux
.1
35 HTML_DOCS
:= $(patsubst %.txt
,html
/%.html
,$(DOCS
))
36 XHTML_DOCS
:= $(patsubst %.txt
,%.html
,$(DOCS
))
37 # MAN_DOCS := $(patsubst %.txt,man/%.1,$(DOCS1)) $(patsubst %.txt,man/%.5,$(DOCS5))
38 TEXT_DOCS
:= $(patsubst %.txt
,%.text
,$(DOCS
))
39 PDF_DOCS
:= $(patsubst %.txt
,%.pdf
,$(DOCS
))
42 # ASCIIDOC_OK := $(shell which asciidoc 2>&1 ; echo $$?)
43 ASCIIDOC_OK
:= $(shell which asciidoc
> /dev
/null
; echo
$$?
)
44 A2X_XML_OK
:= $(shell a2x
$(A2X_OPTS
) -f docbook hello.txt
2>&1 ; echo
$$?
)
45 ifeq ($(A2X_XML_OK
),0)
46 A2X_MAN_OK
:= $(shell [ ! -d man
] && mkdir man
; a2x
$(A2X_MAN_OPTS
) hello.txt
2>&1 ; echo
$$?
)
47 A2X_XHTML_OK
:= $(shell a2x
$(A2X_OPTS
) -f xhtml hello.xml
2>&1 ; echo
$$?
)
48 A2X_TEXT_OK
:= $(shell a2x
$(A2X_OPTS
) -f text hello.xml
2>&1 ; echo
$$?
)
51 ifeq ($(ASCIIDOC_OK
),0)
52 TARGETS
+= $(HTML_DOCS
)
54 ifeq ($(A2X_MAN_OK
),0)
55 TARGETS
+= $(MAN_DOCS
)
57 ifeq ($(A2X_XHTML_OK
),0)
58 TARGETS
+= $(XHTML_DOCS
)
60 ifeq ($(A2X_TEXT_OK
),0)
61 TARGETS
+= $(TEXT_DOCS
)
64 # $(HTML_DOCS) $(MAN_DOCS) $(XHTML_DOCS) $(TEXT_DOCS)
67 syslinux.cfg.txt
: com-bug.txt com-rpt.txt
69 # During 'make all', *.xml is kept but deleted at the end; do we _really_
70 # need the XML longer?
76 # Mark as .PHONY so they're ignored if found in VPATH
77 .PHONY
: html
/ man
/ text
/ xhtml
/
79 html
/ man
/ text
/ xhtml
/:
82 html
/%.html
: %.txt | html
/
85 # As of AsciiDoc-8.5.2, altering the output filename for a2x does not appear possible
87 # a2x $(A2X_OPTS) -D xhtml -f xhtml $<
88 # text/%.text: %.xml %.txt
89 # a2x $(A2X_OPTS) -D text -f text $<
92 a2x
$(A2X_OPTS
) -f docbook
$<
94 # when %.xml is missing, an update to %.txt must force regeneration
96 a2x
$(A2X_OPTS
) -f xhtml
$<
99 a2x
$(A2X_MAN_OPTS
) $<
101 man
/%.5: %.txt | man
/
102 a2x
$(A2X_MAN_OPTS
) $<
105 a2x
$(A2X_OPTS
) -f text
$<
108 a2x
$(A2X_OPTS
) -f pdf
$<
111 rm -f
*~
*.xml
*.text.html text
/*.text.html text
/*.xml xhtml
/*.xml
116 rm -f
*.1 *.5 *.css
*.html
*.text html
/*.html man
/*.1 man
/*.5 text
/*.text xhtml
/*.html xhtml
/*.css