xref: /aoo42x/main/solenv/inc/tg_xmerge.mk (revision 752c0af7)
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.IF "$(XTXFILES)"!=""
25
26L10NEXT*=.txt
27XTX_TARGET_PATH*=$(MISC)/$(TARGET)
28
29ALLTAR : $(XTX_TARGET_PATH).xtx.pmerge.mk $(XTXFILES)
30
31$(XTX_TARGET_PATH).xtx.pmerge.mk :  $(XTXFILES)
32
33$(XTXFILES) : $(LOCALIZESDF)
34
35.INCLUDE .IGNORE : $(XTX_TARGET_PATH).xtx.pmerge.mk
36
37.IF "$(alllangiso)"!="$(last_merge)"
38XTXMERGEPHONY:=.PHONY
39.ENDIF          # "$(alllangiso)" != "$(last_merge)"
40
41$(XTX_TARGET_PATH)/%$(L10NEXT) $(XTXMERGEPHONY) : %.xtx
42	@@-$(MKDIRHIER) $(@:d)
43.IF "$(WITH_LANG)"==""
44    $(COMMAND_ECHO)$(COPY) $< $(@:d)$(@:b)_en-US$(L10NEXT)
45.ELSE          # "$(WITH_LANG)"==""
46    @@-$(RM) $@
47    $(COMMAND_ECHO)@noop $(assign XTXMERGELIST+:=$(<:f))
48    $(COMMAND_ECHO)@noop $(assign XTXDESTDIR:=$(@:d))
49.ENDIF          # "$(WITH_LANG)"==""
50
51$(XTX_TARGET_PATH).xtx.pmerge.mk : $(XTXMERGELIST)
52.IF "$(WITH_LANG)"!=""
53# xtxex command file requirements:
54# - one file per line
55# - no spaces
56# - no empty lines
57# $(uniq ...) to workaround $assign adding the value twice...
58    @noop $(assign XTXMERGEFILELIST:=$(uniq $(XTXMERGELIST)))
59    $(COMMAND_ECHO) $(SOLARBINDIR)/xtxex -p $(PRJNAME) -r $(PRJ) -o $(XTXDESTDIR) -i @$(mktmp $(XTXMERGEFILELIST:t"\n":s/ //)) -l $(alllangiso:s/ /,/) -f $(alllangiso:s/ /,/) -m $(LOCALIZESDF) -s"[path]/[fileNoExt]_[language]$(L10NEXT)"
60.ENDIF          # "$(WITH_LANG)"!=""
61
62	@-$(RM) $@
63    $(COMMAND_ECHO)echo last_merge=$(alllangiso) > $@
64.ENDIF          # "$(XTXFILES)"!=""
65
66.IF "$(TREEFILE)"!=""
67ALLTAR : $(MISC)/$(TARGET).tree.pmerge.mk $(TREEFILE)
68
69$(MISC)/$(TARGET).tree.pmerge.mk :  $(TREEFILE)
70
71$(TREEFILE) : $(LOCALIZESDF)
72
73.INCLUDE .IGNORE : $(MISC)/$(TARGET).tree.pmerge.mk
74
75.IF "$(alllangiso)"!="$(last_merge)"
76TREEMERGEPHONY:=.PHONY
77.ENDIF          # "$(alllangiso)" != "$(last_merge)"
78
79$(OUT_HELP)/en-US/help.tree $(TREEMERGEPHONY) : help.tree
80	@@-$(MKDIRHIER) $(@:d)
81.IF "$(WITH_LANG)"==""
82    $(COMMAND_ECHO)$(COPY) $< $@
83.ELSE          # "$(WITH_LANG)"==""
84    @@-$(RM) $@
85    $(COMMAND_ECHO)@noop $(assign TREEMERGELIST+:=$(<:f))
86    $(COMMAND_ECHO)@noop $(assign TREEDESTDIR:=$(@:d:d:d))
87.ENDIF          # "$(WITH_LANG)"==""
88
89$(MISC)/$(TARGET).tree.pmerge.mk : $(TREEMERGELIST)
90.IF "$(WITH_LANG)"!=""
91# xtxex command file requirements:
92# - one file per line
93# - no spaces
94# - no empty lines
95# $(uniq ...) to workaround $assign adding the value twice...
96    @noop $(assign TREEMERGEFILELIST:=$(uniq $(TREEMERGELIST)))
97# Variables for the pattern filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path
98    $(COMMAND_ECHO) $(SOLARBINDIR)/xhtex -p $(PRJNAME) -r $(PRJ) -o $(TREEDESTDIR) -i @$(mktmp $(TREEMERGEFILELIST:t"\n":s/ //)) -l $(alllangiso:s/ /,/) -f $(alllangiso:s/ /,/) -m $(LOCALIZESDF) -s"[path]/[language]/[fileNoExt].tree"
99.ENDIF          # "$(WITH_LANG)"!=""
100	@-$(RM) $@
101    $(COMMAND_ECHO)echo last_merge=$(alllangiso) > $@
102.ENDIF          # "$(TREEFILE)"!=""
103
104
105