xref: /aoo42x/main/readlicense_oo/makefile.mk (revision ae258647)
1d71964d5SAndrew Rist# *************************************************************
2d71964d5SAndrew Rist#
3d71964d5SAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4d71964d5SAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5d71964d5SAndrew Rist#  distributed with this work for additional information
6d71964d5SAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7d71964d5SAndrew Rist#  to you under the Apache License, Version 2.0 (the
8d71964d5SAndrew Rist#  "License"); you may not use this file except in compliance
9d71964d5SAndrew Rist#  with the License.  You may obtain a copy of the License at
10d71964d5SAndrew Rist#
11d71964d5SAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12d71964d5SAndrew Rist#
13d71964d5SAndrew Rist#  Unless required by applicable law or agreed to in writing,
14d71964d5SAndrew Rist#  software distributed under the License is distributed on an
15d71964d5SAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d71964d5SAndrew Rist#  KIND, either express or implied.  See the License for the
17d71964d5SAndrew Rist#  specific language governing permissions and limitations
18d71964d5SAndrew Rist#  under the License.
19d71964d5SAndrew Rist#
20d71964d5SAndrew Rist# *************************************************************
21cdf0e10cSrcweirPRJ=.
22cdf0e10cSrcweirPRJNAME=readlicense_oo
23cdf0e10cSrcweirTARGET=source
24cdf0e10cSrcweir
25cdf0e10cSrcweir# ------------------------------------------------------------------
26cdf0e10cSrcweir.INCLUDE: settings.mk
27cdf0e10cSrcweir# ------------------------------------------------------------------
28cdf0e10cSrcweir
29cdf0e10cSrcweir.IF "$(GUI)"=="WNT"
30cdf0e10cSrcweirSYSLICBASE=license.txt license.html license.rtf
31cdf0e10cSrcweirSYSLICDEST=$(MISC)$/license$/wnt
3227ead02aSPedro Giffuni.ELIF "$(GUI)"=="OS2"
3327ead02aSPedro GiffuniSYSLICBASE=license.txt license.html license.rtf
3427ead02aSPedro GiffuniSYSLICDEST=$(MISC)$/license$/os2
35cdf0e10cSrcweir.ELSE          # "$(GUI)"=="WNT"
36cdf0e10cSrcweirSYSLICBASE=LICENSE LICENSE.html
37cdf0e10cSrcweirSYSLICDEST=$(MISC)$/license$/unx
38cdf0e10cSrcweir.ENDIF          # "$(GUI)"=="WNT"
39cdf0e10cSrcweir
40cdf0e10cSrcweirSOURCELICENCES=$(foreach,i,$(SYSLICBASE) $(SYSLICDEST)$/$(i:b)_en-US$(i:e))
41cdf0e10cSrcweir
42cdf0e10cSrcweirfallbacklicenses=$(foreach,i,{$(subst,$(defaultlangiso), $(alllangiso))} $(foreach,j,$(SYSLICBASE) $(SYSLICDEST)$/$(j:b)_$i$(j:e)))
43cdf0e10cSrcweir
44*ae258647SHerbert DürrALL_LICENSE=..$/LICENSE
45*ae258647SHerbert DürrALL_NOTICE=..$/NOTICE
46*ae258647SHerbert Dürr.IF "${ENABLE_CATEGORY_B}"=="YES"
47*ae258647SHerbert Dürr    # extend the install set's LICENSE and NOTICE files
48*ae258647SHerbert Dürr    # for content distributed under category-B licenses
49*ae258647SHerbert Dürr    ALL_LICENSE+=..$/LICENSE_category_b
50*ae258647SHerbert Dürr    ALL_NOTICE+=..$/NOTICE_category_b
51*ae258647SHerbert Dürr.ENDIF
52*ae258647SHerbert Dürr.IF "${BUNDLED_EXTENSION_BLOBS}"!=""
53*ae258647SHerbert Dürr    # extend the install set's LICENSE and NOTICE files
54*ae258647SHerbert Dürr    # for content distributed as mere aggregations
55*ae258647SHerbert Dürr    ALL_LICENSE+=..$/LICENSE_aggregated
56*ae258647SHerbert Dürr    ALL_NOTICE+=..$/NOTICE_aggregated
57*ae258647SHerbert Dürr.ENDIF
58*ae258647SHerbert DürrSUM_LICENSE=$(MISC)$/SUM_LICENSE
59*ae258647SHerbert DürrSUM_NOTICE=$(MISC)$/SUM_NOTICE
60*ae258647SHerbert Dürr
61cdf0e10cSrcweir# ------------------------------------------------------------------
62cdf0e10cSrcweir.INCLUDE: target.mk
63cdf0e10cSrcweir# ------------------------------------------------------------------
64cdf0e10cSrcweir
65*ae258647SHerbert DürrALLTAR: ${SUM_LICENSE} ${SUM_NOTICE} $(SOURCELICENCES) $(fallbacklicenses) just_for_nice_optics
66*ae258647SHerbert Dürr
67*ae258647SHerbert Dürr${SUM_LICENSE} : ${ALL_LICENSE}
68*ae258647SHerbert Dürr    cat $< > $@
69*ae258647SHerbert Dürr
70*ae258647SHerbert Dürr${SUM_NOTICE} : ${ALL_NOTICE}
71*ae258647SHerbert Dürr    cat $< > $@
72cdf0e10cSrcweir
73cdf0e10cSrcweir.IF "$(fallbacklicenses)"!=""
74cdf0e10cSrcweir$(fallbacklicenses) : $(SOURCELICENCES)
75cdf0e10cSrcweir	@$(ECHON) .
76cdf0e10cSrcweir	@$(COPY) $(@:d)$(@:b:s/_/./:b)_$(defaultlangiso)$(@:e) $@
77cdf0e10cSrcweir.ENDIF          # "$(fallbacklicenses)"!=""
78cdf0e10cSrcweir
79cdf0e10cSrcweirjust_for_nice_optics: $(fallbacklicenses)
80cdf0e10cSrcweir	@$(ECHONL)
81cdf0e10cSrcweir
82*ae258647SHerbert Dürr# for windows, convert line ends to CR/LF
83cdf0e10cSrcweir$(SYSLICDEST)$/license_en-US.% : source$/license$/license_en-US.%
84cdf0e10cSrcweir	@-$(MKDIRHIER) $(SYSLICDEST)
85cdf0e10cSrcweir	$(PERL) -p -e 's/\r?\n$$/\r\n/' < $< > $@
86cdf0e10cSrcweir
87cdf0e10cSrcweir# for others just copy
88cdf0e10cSrcweir$(SYSLICDEST)$/LICENSE_en-US : source$/license$/license_en-US.txt
89cdf0e10cSrcweir	@-$(MKDIRHIER) $(SYSLICDEST)
90cdf0e10cSrcweir	$(COPY) $< $@
91cdf0e10cSrcweir
92cdf0e10cSrcweir$(SYSLICDEST)$/LICENSE_en-US.html : source$/license$/license_en-US.html
93cdf0e10cSrcweir	@-$(MKDIRHIER) $(SYSLICDEST)
94cdf0e10cSrcweir	$(COPY) $< $@
95