1*e6b7d829SAndrew Rist#**************************************************************
2*e6b7d829SAndrew Rist#
3*e6b7d829SAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*e6b7d829SAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*e6b7d829SAndrew Rist#  distributed with this work for additional information
6*e6b7d829SAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*e6b7d829SAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*e6b7d829SAndrew Rist#  "License"); you may not use this file except in compliance
9*e6b7d829SAndrew Rist#  with the License.  You may obtain a copy of the License at
10*e6b7d829SAndrew Rist#
11*e6b7d829SAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*e6b7d829SAndrew Rist#
13*e6b7d829SAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*e6b7d829SAndrew Rist#  software distributed under the License is distributed on an
15*e6b7d829SAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*e6b7d829SAndrew Rist#  KIND, either express or implied.  See the License for the
17*e6b7d829SAndrew Rist#  specific language governing permissions and limitations
18*e6b7d829SAndrew Rist#  under the License.
19*e6b7d829SAndrew Rist#
20*e6b7d829SAndrew Rist#**************************************************************
21*e6b7d829SAndrew Rist
22*e6b7d829SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir# --- Targets ------------------------------------------------------
25cdf0e10cSrcweir
26cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
27cdf0e10cSrcweir# uppercase and no filename extension for txt
28cdf0e10cSrcweirSYSTEXTDOCS=$(foreach,i,$(alllangiso) $(MISC)$/$(GUI)$/README_$i)
29cdf0e10cSrcweirSYSHTMLDOCS=$(SYSTEXTDOCS:+".html")
30cdf0e10cSrcweir.ELSE		# "$(GUI)"=="UNX"
31cdf0e10cSrcweirSYSTEXTDOCS=$(foreach,i,$(alllangiso) $(MISC)$/$(GUI)$/readme_$i.txt)
32cdf0e10cSrcweirSYSHTMLDOCS=$(SYSTEXTDOCS:s/.txt/.html/)
33cdf0e10cSrcweir.ENDIF		# "$(GUI)"=="UNX"
34cdf0e10cSrcweir
35cdf0e10cSrcweir.IF "$(WITH_LANG)"!=""
36cdf0e10cSrcweirMERGEDXRM=$(COMMONMISC)$/$(TARGET)$/readme.xrm
37cdf0e10cSrcweir.ELSE		# "$(WITH_LANG)"!=""
38cdf0e10cSrcweirMERGEDXRM=.$/readme.xrm
39cdf0e10cSrcweir.ENDIF		# "$(WITH_LANG)"!=""
40cdf0e10cSrcweir
41cdf0e10cSrcweir.INCLUDE : target.mk
42cdf0e10cSrcweir
43cdf0e10cSrcweirALLTAR : $(SYSTEXTDOCS) $(SYSHTMLDOCS)
44cdf0e10cSrcweir
45cdf0e10cSrcweir$(COMMONMISC)$/readme.dtd : ..$/readme.dtd
46cdf0e10cSrcweir	$(MKDIRHIER) $(MISC)$/$(GUI)
47cdf0e10cSrcweir	$(COPY) $< $@
48cdf0e10cSrcweir
49cdf0e10cSrcweirvirtual : $(MERGEDXRM) $(COMMONMISC)$/readme.dtd $(PRJ)$/docs/readme.xsl
50cdf0e10cSrcweir
51cdf0e10cSrcweir$(MISC)$/readme_text.xsl : virtual
52cdf0e10cSrcweir 	$(SED) '' < ..$/readme.xsl > $@
53cdf0e10cSrcweir
54cdf0e10cSrcweir$(MISC)$/$(GUI)$/$(eq,$(GUI),WNT readme README)_%.html : 'virtual'
55cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
56cdf0e10cSrcweir	$(XSLTPROC) --nonet --novalid -o $@ \
57cdf0e10cSrcweir	--stringparam os1 $(OS)	--stringparam gui1 $(GUI)	--stringparam com1  $(COM) \
58cdf0e10cSrcweir	--stringparam cp1 $(CPUNAME)	--stringparam type html	--stringparam lang1 $* \
59cdf0e10cSrcweir	..$/readme.xsl	$(MERGEDXRM)
60cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
61cdf0e10cSrcweir	chmod g+w $(MISC)$/$(GUI)
62cdf0e10cSrcweir.ENDIF			# "$(GUI)"=="UNX"
63cdf0e10cSrcweir
64cdf0e10cSrcweir$(MISC)$/$(GUI)$/$(eq,$(GUI),OS2 readme README)_%.html : 'virtual'
65cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
66cdf0e10cSrcweir	$(XSLTPROC) --nonet --novalid -o $@ \
67cdf0e10cSrcweir	--stringparam os1 $(OS)	--stringparam gui1 $(GUI)	--stringparam com1  $(COM) \
68cdf0e10cSrcweir	--stringparam cp1 $(CPUNAME)	--stringparam type html	--stringparam lang1 $* \
69cdf0e10cSrcweir	..$/readme.xsl	$(MERGEDXRM)
70cdf0e10cSrcweir
71cdf0e10cSrcweir# no percent-rule to avoid ambiguous inference chains for README_<lang>.html
72cdf0e10cSrcweir$(SYSTEXTDOCS) : $(MISC)$/readme_text.xsl
73cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
74cdf0e10cSrcweir	$(XSLTPROC) --nonet --novalid -o $@ \
75cdf0e10cSrcweir	--stringparam os1 $(OS)	--stringparam gui1 $(GUI)	--stringparam com1  $(COM) \
76cdf0e10cSrcweir	--stringparam cp1 $(CPUNAME)	--stringparam type text	--stringparam lang1 $(@:b:s/readme_//:s/README_//) \
77cdf0e10cSrcweir	$<	$(MERGEDXRM)
78cdf0e10cSrcweir
79cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
80cdf0e10cSrcweir	chmod g+w $(MISC)$/$(GUI)
81cdf0e10cSrcweir.ENDIF			# "$(GUI)"=="UNX"
82cdf0e10cSrcweir
83