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
27 A2X_MAN_OPTS
= -D man
-f manpage
29 DOCS
= syslinux.txt syslinux-cli.txt syslinux.cfg.txt
30 MAN_DOCS
= man
/syslinux
.1 man
/syslinux-cli
.1 man
/syslinux.cfg
.5
31 HTML_DOCS
:= $(patsubst %.txt
,html
/%.html
,$(DOCS
))
32 XHTML_DOCS
:= $(patsubst %.txt
,%.html
,$(DOCS
))
33 # MAN_DOCS := $(patsubst %.txt,man/%.1,$(DOCS1)) $(patsubst %.txt,man/%.5,$(DOCS5))
34 TEXT_DOCS
:= $(patsubst %.txt
,%.text
,$(DOCS
))
35 PDF_DOCS
:= $(patsubst %.txt
,%.pdf
,$(DOCS
))
38 # ASCIIDOC_OK := $(shell which asciidoc 2>&1 ; echo $$?)
39 ASCIIDOC_OK
:= $(shell which asciidoc
> /dev
/null
; echo
$$?
)
40 A2X_XML_OK
:= $(shell a2x
$(A2X_OPTS
) -f docbook hello.txt
2>&1 ; echo
$$?
)
41 ifeq ($(A2X_XML_OK
),0)
42 A2X_MAN_OK
:= $(shell [ ! -d man
] && mkdir man
; a2x
$(A2X_MAN_OPTS
) hello.txt
2>&1 ; echo
$$?
)
43 A2X_XHTML_OK
:= $(shell a2x
$(A2X_OPTS
) -f xhtml hello.xml
2>&1 ; echo
$$?
)
44 A2X_TEXT_OK
:= $(shell a2x
$(A2X_OPTS
) -f text hello.xml
2>&1 ; echo
$$?
)
47 ifeq ($(ASCIIDOC_OK
),0)
48 TARGETS
+= $(HTML_DOCS
)
50 ifeq ($(A2X_MAN_OK
),0)
51 TARGETS
+= $(MAN_DOCS
)
53 ifeq ($(A2X_XHTML_OK
),0)
54 TARGETS
+= $(XHTML_DOCS
)
56 ifeq ($(A2X_TEXT_OK
),0)
57 TARGETS
+= $(TEXT_DOCS
)
60 # $(HTML_DOCS) $(MAN_DOCS) $(XHTML_DOCS) $(TEXT_DOCS)
63 syslinux.cfg.txt
: com-bug.txt com-rpt.txt
65 # During 'make all', *.xml is kept but deleted at the end; do we _really_
66 # need the XML longer?
72 html
/ man
/ text
/ xhtml
/:
75 html
/%.html
: %.txt html
/
78 # As of AsciiDoc-8.5.2, altering the output filename for a2x does not appear possible
80 # a2x $(A2X_OPTS) -D xhtml -f xhtml $<
81 # text/%.text: %.xml %.txt
82 # a2x $(A2X_OPTS) -D text -f text $<
85 a2x
$(A2X_OPTS
) -f docbook
$<
87 # when %.xml is missing, an update to %.txt must force regeneration
89 a2x
$(A2X_OPTS
) -f xhtml
$<
92 a2x
$(A2X_MAN_OPTS
) $<
95 a2x
$(A2X_MAN_OPTS
) $<
98 a2x
$(A2X_OPTS
) -f text
$<
101 a2x
$(A2X_OPTS
) -f pdf
$<
104 rm -f
*~
*.xml
*.text.html text
/*.text.html text
/*.xml xhtml
/*.xml
109 rm -f
*.1 *.5 *.css
*.html
*.text html
/*.html man
/*.1 man
/*.5 text
/*.text xhtml
/*.html xhtml
/*.css