xref: /trunk/main/solenv/inc/tg_xmerge.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28.IF "$(XTXFILES)"!=""
29
30L10NEXT*=.txt
31XTX_TARGET_PATH*=$(MISC)/$(TARGET)
32
33ALLTAR : $(XTX_TARGET_PATH).xtx.pmerge.mk $(XTXFILES)
34
35$(XTX_TARGET_PATH).xtx.pmerge.mk :  $(XTXFILES)
36
37$(XTXFILES) : $(LOCALIZESDF)
38
39.INCLUDE .IGNORE : $(XTX_TARGET_PATH).xtx.pmerge.mk
40
41.IF "$(alllangiso)"!="$(last_merge)"
42XTXMERGEPHONY:=.PHONY
43.ENDIF          # "$(alllangiso)" != "$(last_merge)"
44
45$(XTX_TARGET_PATH)/%$(L10NEXT) $(XTXMERGEPHONY) : %.xtx
46	@@-$(MKDIRHIER) $(@:d)
47.IF "$(WITH_LANG)"==""
48    $(COMMAND_ECHO)$(COPY) $< $(@:d)$(@:b)_en-US$(L10NEXT)
49.ELSE          # "$(WITH_LANG)"==""
50    @@-$(RM) $@
51    $(COMMAND_ECHO)@noop $(assign XTXMERGELIST+:=$(<:f))
52    $(COMMAND_ECHO)@noop $(assign XTXDESTDIR:=$(@:d))
53.ENDIF          # "$(WITH_LANG)"==""
54
55$(XTX_TARGET_PATH).xtx.pmerge.mk : $(XTXMERGELIST)
56.IF "$(WITH_LANG)"!=""
57# xtxex command file requirements:
58# - one file per line
59# - no spaces
60# - no empty lines
61# $(uniq ...) to workaround $assign adding the value twice...
62    @noop $(assign XTXMERGEFILELIST:=$(uniq $(XTXMERGELIST)))
63    $(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)"
64.ENDIF          # "$(WITH_LANG)"!=""
65
66	@-$(RM) $@
67    $(COMMAND_ECHO)echo last_merge=$(alllangiso) > $@
68.ENDIF          # "$(XTXFILES)"!=""
69
70.IF "$(TREEFILE)"!=""
71ALLTAR : $(MISC)/$(TARGET).tree.pmerge.mk $(TREEFILE)
72
73$(MISC)/$(TARGET).tree.pmerge.mk :  $(TREEFILE)
74
75$(TREEFILE) : $(LOCALIZESDF)
76
77.INCLUDE .IGNORE : $(MISC)/$(TARGET).tree.pmerge.mk
78
79.IF "$(alllangiso)"!="$(last_merge)"
80TREEMERGEPHONY:=.PHONY
81.ENDIF          # "$(alllangiso)" != "$(last_merge)"
82
83$(OUT_HELP)/en-US/help.tree $(TREEMERGEPHONY) : help.tree
84	@@-$(MKDIRHIER) $(@:d)
85.IF "$(WITH_LANG)"==""
86    $(COMMAND_ECHO)$(COPY) $< $@
87.ELSE          # "$(WITH_LANG)"==""
88    @@-$(RM) $@
89    $(COMMAND_ECHO)@noop $(assign TREEMERGELIST+:=$(<:f))
90    $(COMMAND_ECHO)@noop $(assign TREEDESTDIR:=$(@:d:d:d))
91.ENDIF          # "$(WITH_LANG)"==""
92
93$(MISC)/$(TARGET).tree.pmerge.mk : $(TREEMERGELIST)
94.IF "$(WITH_LANG)"!=""
95# xtxex command file requirements:
96# - one file per line
97# - no spaces
98# - no empty lines
99# $(uniq ...) to workaround $assign adding the value twice...
100    @noop $(assign TREEMERGEFILELIST:=$(uniq $(TREEMERGELIST)))
101# Variables for the pattern filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path
102    $(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"
103.ENDIF          # "$(WITH_LANG)"!=""
104	@-$(RM) $@
105    $(COMMAND_ECHO)echo last_merge=$(alllangiso) > $@
106.ENDIF          # "$(TREEFILE)"!=""
107
108
109