1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28# --- Targets ------------------------------------------------------
29
30.IF "$(GUI)"=="UNX"
31# uppercase and no filename extension for txt
32SYSTEXTDOCS=$(foreach,i,$(alllangiso) $(MISC)$/$(GUI)$/README_$i)
33SYSHTMLDOCS=$(SYSTEXTDOCS:+".html")
34.ELSE		# "$(GUI)"=="UNX"
35SYSTEXTDOCS=$(foreach,i,$(alllangiso) $(MISC)$/$(GUI)$/readme_$i.txt)
36SYSHTMLDOCS=$(SYSTEXTDOCS:s/.txt/.html/)
37.ENDIF		# "$(GUI)"=="UNX"
38
39.IF "$(WITH_LANG)"!=""
40MERGEDXRM=$(COMMONMISC)$/$(TARGET)$/readme.xrm
41.ELSE		# "$(WITH_LANG)"!=""
42MERGEDXRM=.$/readme.xrm
43.ENDIF		# "$(WITH_LANG)"!=""
44
45.INCLUDE : target.mk
46
47ALLTAR : $(SYSTEXTDOCS) $(SYSHTMLDOCS)
48
49$(COMMONMISC)$/readme.dtd : ..$/readme.dtd
50	$(MKDIRHIER) $(MISC)$/$(GUI)
51	$(COPY) $< $@
52
53virtual : $(MERGEDXRM) $(COMMONMISC)$/readme.dtd $(PRJ)$/docs/readme.xsl
54
55$(MISC)$/readme_text.xsl : virtual
56 	$(SED) '' < ..$/readme.xsl > $@
57
58$(MISC)$/$(GUI)$/$(eq,$(GUI),WNT readme README)_%.html : 'virtual'
59	@@-$(MKDIRHIER) $(@:d)
60	$(XSLTPROC) --nonet --novalid -o $@ \
61	--stringparam os1 $(OS)	--stringparam gui1 $(GUI)	--stringparam com1  $(COM) \
62	--stringparam cp1 $(CPUNAME)	--stringparam type html	--stringparam lang1 $* \
63	..$/readme.xsl	$(MERGEDXRM)
64.IF "$(GUI)"=="UNX"
65	chmod g+w $(MISC)$/$(GUI)
66.ENDIF			# "$(GUI)"=="UNX"
67
68$(MISC)$/$(GUI)$/$(eq,$(GUI),OS2 readme README)_%.html : 'virtual'
69	@@-$(MKDIRHIER) $(@:d)
70	$(XSLTPROC) --nonet --novalid -o $@ \
71	--stringparam os1 $(OS)	--stringparam gui1 $(GUI)	--stringparam com1  $(COM) \
72	--stringparam cp1 $(CPUNAME)	--stringparam type html	--stringparam lang1 $* \
73	..$/readme.xsl	$(MERGEDXRM)
74
75# no percent-rule to avoid ambiguous inference chains for README_<lang>.html
76$(SYSTEXTDOCS) : $(MISC)$/readme_text.xsl
77	@@-$(MKDIRHIER) $(@:d)
78	$(XSLTPROC) --nonet --novalid -o $@ \
79	--stringparam os1 $(OS)	--stringparam gui1 $(GUI)	--stringparam com1  $(COM) \
80	--stringparam cp1 $(CPUNAME)	--stringparam type text	--stringparam lang1 $(@:b:s/readme_//:s/README_//) \
81	$<	$(MERGEDXRM)
82
83.IF "$(GUI)"=="UNX"
84	chmod g+w $(MISC)$/$(GUI)
85.ENDIF			# "$(GUI)"=="UNX"
86
87