utils/isohybrid.c: Encode GPT partition names as UTF-16LE
[syslinux.git] / txt / Makefile
blobdd9c7999f1d406ad07ddaa54cfab944216e8ee33
1 ## -----------------------------------------------------------------------
2 ##
3 ## Copyright 2012 Gene Cumm
4 ##
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
8 ##
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
21 topdir = ..
22 MAKEDIR = $(topdir)/mk
23 # include $(MAKEDIR)/embedded.mk
25 VPATH = $(SRC)
27 A2X_OPTS = -k
28 # A2X_OPTS += -v
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))
40 TARGETS =
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 $$?)
49 endif
51 ifeq ($(ASCIIDOC_OK),0)
52 TARGETS += $(HTML_DOCS)
53 endif
54 ifeq ($(A2X_MAN_OK),0)
55 TARGETS += $(MAN_DOCS)
56 endif
57 ifeq ($(A2X_XHTML_OK),0)
58 TARGETS += $(XHTML_DOCS)
59 endif
60 ifeq ($(A2X_TEXT_OK),0)
61 TARGETS += $(TEXT_DOCS)
62 endif
64 # $(HTML_DOCS) $(MAN_DOCS) $(XHTML_DOCS) $(TEXT_DOCS)
65 all: $(TARGETS)
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?
71 .PRECIOUS: %.xml
73 # %.html: %.txt
74 # asciidoc -D html $<
76 # Mark as .PHONY so they're ignored if found in VPATH
77 .PHONY: html/ man/ text/ xhtml/
79 html/ man/ text/ xhtml/:
80 mkdir -p $@
82 html/%.html: %.txt | html/
83 asciidoc -o $@ $<
85 # As of AsciiDoc-8.5.2, altering the output filename for a2x does not appear possible
86 # xhtml/%.html: %.txt
87 # a2x $(A2X_OPTS) -D xhtml -f xhtml $<
88 # text/%.text: %.xml %.txt
89 # a2x $(A2X_OPTS) -D text -f text $<
91 %.xml: %.txt
92 a2x $(A2X_OPTS) -f docbook $<
94 # when %.xml is missing, an update to %.txt must force regeneration
95 %.html: %.xml %.txt
96 a2x $(A2X_OPTS) -f xhtml $<
98 man/%.1: %.txt | man/
99 a2x $(A2X_MAN_OPTS) $<
101 man/%.5: %.txt | man/
102 a2x $(A2X_MAN_OPTS) $<
104 %.text: %.xml %.txt
105 a2x $(A2X_OPTS) -f text $<
107 %.pdf: %.xml %.txt
108 a2x $(A2X_OPTS) -f pdf $<
110 tidy dist:
111 rm -f *~ *.xml *.text.html text/*.text.html text/*.xml xhtml/*.xml
113 clean: tidy
115 spotless: clean
116 rm -f *.1 *.5 *.css *.html *.text html/*.html man/*.1 man/*.5 text/*.text xhtml/*.html xhtml/*.css
118 -include .*.d