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