xref: /aoo42x/main/readlicense_oo/makefile.mk (revision d71964d5)
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# *************************************************************
21PRJ=.
22PRJNAME=readlicense_oo
23TARGET=source
24
25# ------------------------------------------------------------------
26.INCLUDE: settings.mk
27# ------------------------------------------------------------------
28
29.IF "$(GUI)"=="WNT"
30SYSLICBASE=license.txt license.html license.rtf
31SYSLICDEST=$(MISC)$/license$/wnt
32.ELIF "$(GUI)"=="OS2"
33SYSLICBASE=license.txt license.html license.rtf
34SYSLICDEST=$(MISC)$/license$/os2
35.ELSE          # "$(GUI)"=="WNT"
36SYSLICBASE=LICENSE LICENSE.html
37SYSLICDEST=$(MISC)$/license$/unx
38.ENDIF          # "$(GUI)"=="WNT"
39
40SOURCELICENCES=$(foreach,i,$(SYSLICBASE) $(SYSLICDEST)$/$(i:b)_en-US$(i:e))
41
42fallbacklicenses=$(foreach,i,{$(subst,$(defaultlangiso), $(alllangiso))} $(foreach,j,$(SYSLICBASE) $(SYSLICDEST)$/$(j:b)_$i$(j:e)))
43
44# ------------------------------------------------------------------
45.INCLUDE: target.mk
46# ------------------------------------------------------------------
47
48ALLTAR: $(SOURCELICENCES) $(fallbacklicenses) just_for_nice_optics
49
50.IF "$(fallbacklicenses)"!=""
51$(fallbacklicenses) : $(SOURCELICENCES)
52	@$(ECHON) .
53	@$(COPY) $(@:d)$(@:b:s/_/./:b)_$(defaultlangiso)$(@:e) $@
54.ENDIF          # "$(fallbacklicenses)"!=""
55
56just_for_nice_optics: $(fallbacklicenses)
57	@$(ECHONL)
58
59# for windows, convert linends to DOS
60$(SYSLICDEST)$/license_en-US.% : source$/license$/license_en-US.%
61	@-$(MKDIRHIER) $(SYSLICDEST)
62	$(PERL) -p -e 's/\r?\n$$/\r\n/' < $< > $@
63
64# for others just copy
65$(SYSLICDEST)$/LICENSE_en-US : source$/license$/license_en-US.txt
66	@-$(MKDIRHIER) $(SYSLICDEST)
67	$(COPY) $< $@
68
69$(SYSLICDEST)$/LICENSE_en-US.html : source$/license$/license_en-US.html
70	@-$(MKDIRHIER) $(SYSLICDEST)
71	$(COPY) $< $@
72