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
24PRJ=..
25PRJNAME=instsetoo_native
26TARGET=util
27
28.INCLUDE:  settings.mk
29.INCLUDE: $(SOLARINCDIR)$/rtlbootstrap.mk
30
31# PERL:=@echo
32
33# watch for the path delimiter
34.IF "$(GUI)"=="WNT"
35PYTHONPATH:=$(PWD)$/$(BIN);$(SOLARLIBDIR);$(SOLARLIBDIR)$/python;$(SOLARLIBDIR)$/python$/lib-dynload
36.ELSE			# "$(GUI)"=="WNT"
37PYTHONPATH:=$(PWD)$/$(BIN):$(SOLARLIBDIR):$(SOLARLIBDIR)$/python:$(SOLARLIBDIR)$/python$/lib-dynload
38.ENDIF			# "$(GUI)"=="WNT"
39.EXPORT: PYTHONPATH
40
41.IF "$(CWS_WORK_STAMP)"=="" || "$(UPDATER)"!=""
42ENABLE_DOWNLOADSETS*=TRUE
43.ENDIF			# "$(CWS_WORK_STAMP)"=="" || "$(UPDATER)"!=""
44.IF "$(FORCE_DOWNLOADSETS)"!=""
45ENABLE_DOWNLOADSETS=TRUE
46.ENDIF			# "$(FORCE_DOWNLOADSETS)"!=""
47
48.EXPORT: ENABLE_DOWNLOADSETS
49.EXPORT: LAST_MINOR
50.EXPORT: PRJ
51.EXPORT: PRJNAME
52
53.IF "$(OS)"=="LINUX"
54DONT_REMOVE_PACKAGE:=TRUE
55.EXPORT: DONT_REMOVE_PACKAGE
56.ENDIF          # "$(OS)"=="LINUX"
57
58.INCLUDE .IGNORE: $(SRC_ROOT)$/cwsname.mk
59
60SHARED_COM_SDK_PATH*:=.
61
62INSTALLDIR=$(OUT)
63
64.INCLUDE: target.mk
65
66LOCALPYFILES= \
67    $(BIN)$/uno.py \
68	$(BIN)$/unohelper.py \
69	$(BIN)$/pythonloader.py \
70	$(BIN)$/pythonscript.py \
71	$(BIN)$/officehelper.py \
72	$(BIN)$/mailmerge.py
73
74xxxx:
75    echo $(PERL) -w $(SOLARENV)$/bin$/gen_update_info.pl --buildid $(BUILD) --arch "$(RTL_ARCH)" --os "$(RTL_OS)" --lstfile $(PRJ)$/util$/openoffice.lst --product OpenOffice --languages $(subst,$(@:s/_/ /:1)_, $(@:b)) $(PRJ)$/util$/update.xml
76
77.IF "$(GUI)"!="WNT" && "$(EPM)"=="NO" && "$(USE_PACKAGER)"==""
78ALLTAR  : $(LOCALPYFILES)
79	@echo "No EPM: do no packaging at this stage"
80.ELSE			# "$(GUI)"!="WNT" && "$(EPM)"=="NO" && "$(USE_PACKAGER)"==""
81.IF "$(UPDATER)"=="" || "$(USE_PACKAGER)"==""
82.IF "$(BUILD_TYPE)"=="$(BUILD_TYPE:s/ODK//)"
83ALLTAR : openoffice
84.ELSE
85ALLTAR : openoffice sdkoo_en-US ure_en-US
86.ENDIF
87.ELSE			# "$(UPDATER)"=="" || "$(USE_PACKAGER)"==""
88ALLTAR : updatepack
89.ENDIF			# "$(UPDATER)"=="" || "$(USE_PACKAGER)"==""
90.ENDIF			# "$(GUI)"!="WNT" && "$(EPM)"=="NO" && "$(USE_PACKAGER)"==""
91
92.IF "$(FORCE2ARCHIVE)" == "TRUE"
93PKGFORMAT = archive
94.END
95
96.IF "$(MAKETARGETS:e)"!=""
97PKGFORMAT+=$(MAKETARGETS:e:s/.//)
98.ENDIF			# "$(MAKETARGETS:e)"!=""
99
100# Independent of PKGFORMAT, always build a default-language openoffice product
101# also in archive format, so that tests that require an OOo installation (like
102# smoketestoo_native) have one available:
103openoffice_$(defaultlangiso) : $$@.archive
104
105.IF "$(VERBOSE)"=="TRUE"
106VERBOSESWITCH=-verbose
107.ENDIF
108.IF "$(VERBOSE)"=="FALSE"
109VERBOSESWITCH=-quiet
110.ENDIF
111
112# New target to prepare a source release
113SRC_RELEASE_OUT_DIR=$(shell cd $(OUT) && pwd)$/AOO_SRC_Release
114
115aoo_srcrelease: $(SOLARENV)$/bin$/srcrelease.xml
116	@-$(MKDIR) $(OUT)$/AOO_SRC_Release
117	$(ANT) -f $(SOLARENV)$/bin$/srcrelease.xml -q -Dbasedir=$(SOURCE_ROOT_DIR) -Dout.dir=$(SRC_RELEASE_OUT_DIR)
118
119updatepack:
120	$(PERL) -w $(SOLARENV)$/bin$/packager.pl
121
122.IF "$(alllangiso)"!=""
123
124openoffice: $(foreach,i,$(alllangiso) openoffice_$i)
125
126openofficedev: $(foreach,i,$(alllangiso) openofficedev_$i)
127
128openofficewithjre: $(foreach,i,$(alllangiso) openofficewithjre_$i)
129
130ooolanguagepack : $(foreach,i,$(alllangiso) ooolanguagepack_$i)
131
132ooodevlanguagepack: $(foreach,i,$(alllangiso) ooodevlanguagepack_$i)
133
134sdkoo: $(foreach,i,$(alllangiso) sdkoo_$i)
135
136sdkoodev: $(foreach,i,$(alllangiso) sdkoodev_$i)
137
138ure: $(foreach,i,$(alllangiso) ure_$i)
139
140MSIOFFICETEMPLATESOURCE=$(PRJ)$/inc_openoffice$/windows$/msi_templates
141MSILANGPACKTEMPLATESOURCE=$(PRJ)$/inc_ooolangpack$/windows$/msi_templates
142MSIURETEMPLATESOURCE=$(PRJ)$/inc_ure$/windows$/msi_templates
143MSISDKOOTEMPLATESOURCE=$(PRJ)$/inc_sdkoo$/windows$/msi_templates
144
145.IF "$(BUILD_SPECIAL)"!=""
146MSIOFFICETEMPLATEDIR=$(MSIOFFICETEMPLATESOURCE)
147MSILANGPACKTEMPLATEDIR=$(MSILANGPACKTEMPLATESOURCE)
148MSIURETEMPLATEDIR=$(MSIURETEMPLATESOURCE)
149MSISDKOOTEMPLATEDIR=$(MSISDKOOTEMPLATESOURCE)
150.ELSE			# "$(BUILD_SPECIAL)"!=""
151NOLOGOSPLASH:=$(BIN)$/intro.zip
152DEVNOLOGOSPLASH:=$(BIN)$/dev$/intro.zip
153MSIOFFICETEMPLATEDIR=$(MISC)$/openoffice$/msi_templates
154MSILANGPACKTEMPLATEDIR=$(MISC)$/ooolangpack$/msi_templates
155MSIURETEMPLATEDIR=$(MISC)$/ure$/msi_templates
156MSISDKOOTEMPLATEDIR=$(MISC)$/sdkoo$/msi_templates
157
158ADDDEPS=$(NOLOGOSPLASH) $(DEVNOLOGOSPLASH)
159
160.IF "$(OS)" == "WNT"
161ADDDEPS+=hack_msitemplates
162.ENDIF
163
164$(foreach,i,$(alllangiso) openoffice_$i) : $(ADDDEPS)
165openoffice_$(defaultlangiso).archive : $(ADDDEPS)
166
167$(foreach,i,$(alllangiso) openofficedev_$i) : $(ADDDEPS)
168
169$(foreach,i,$(alllangiso) openofficewithjre_$i) : $(ADDDEPS)
170
171$(foreach,i,$(alllangiso) ooolanguagepack_$i) : $(ADDDEPS)
172
173$(foreach,i,$(alllangiso) ooodevlanguagepack_$i) : $(ADDDEPS)
174
175$(foreach,i,$(alllangiso) sdkoo_$i) : $(ADDDEPS)
176
177$(foreach,i,$(alllangiso) sdkoodev_$i) : $(ADDDEPS)
178
179$(foreach,i,$(alllangiso) ure_$i) : $(ADDDEPS)
180
181.IF "$(MAKETARGETS)"!=""
182$(MAKETARGETS) : $(ADDDEPS)
183.ENDIF			# "$(MAKETARGETS)"!=""
184
185.ENDIF			# "$(BUILD_SPECIAL)"!=""
186
187$(foreach,i,$(alllangiso) openoffice_$i) : $$@{$(PKGFORMAT:^".")}
188.IF "$(MAKETARGETS)"!=""
189.IF "$(MAKETARGETS:e)"=="" && "$(MAKETARGETS:s/_//)"!="$(MAKETARGETS)"
190$(MAKETARGETS) : $$@{$(PKGFORMAT:^".")}
191$(MAKETARGETS){$(PKGFORMAT:^".")} : $(ADDDEPS)
192.ENDIF			# "$(MAKETARGETS:e)"=="" && "$(MAKETARGETS:s/_//)"!="$(MAKETARGETS)"
193.ENDIF			# "$(MAKETARGETS)"!=""
194openoffice_%{$(PKGFORMAT:^".") .archive} :
195	$(PERL) -w $(SOLARENV)$/bin$/make_installer.pl -f $(PRJ)$/util$/openoffice.lst -l $(subst,$(@:s/_/ /:1)_, $(@:b)) -p OpenOffice -u $(OUT) -buildid $(BUILD) -msitemplate $(MSIOFFICETEMPLATEDIR) -msilanguage $(MISC)$/win_ulffiles -format $(@:e:s/.//) $(VERBOSESWITCH)
196	$(PERL) -w $(SOLARENV)$/bin$/gen_update_info.pl --buildid $(BUILD) --arch "$(RTL_ARCH)" --os "$(RTL_OS)" --lstfile $(PRJ)$/util$/openoffice.lst --product OpenOffice --languages $(subst,$(@:s/_/ /:1)_, $(@:b)) $(PRJ)$/util$/update.xml > $(MISC)/$(@:b)_$(RTL_OS)_$(RTL_ARCH)$(@:e).update.xml
197
198$(foreach,i,$(alllangiso) openofficewithjre_$i) : $$@{$(PKGFORMAT:^".")}
199openofficewithjre_%{$(PKGFORMAT:^".")} :
200	$(PERL) -w $(SOLARENV)$/bin$/make_installer.pl -f $(PRJ)$/util$/openoffice.lst -l $(subst,$(@:s/_/ /:1)_, $(@:b)) -p OpenOffice_wJRE -u $(OUT) -buildid $(BUILD) -msitemplate $(MSIOFFICETEMPLATEDIR) -msilanguage $(MISC)$/win_ulffiles -format $(@:e:s/.//) $(VERBOSESWITCH)
201
202$(foreach,i,$(alllangiso) openofficedev_$i) : $$@{$(PKGFORMAT:^".")}
203openofficedev_%{$(PKGFORMAT:^".")} :
204	$(PERL) -w $(SOLARENV)$/bin$/make_installer.pl -f $(PRJ)$/util$/openoffice.lst -l $(subst,$(@:s/_/ /:1)_, $(@:b)) -p OpenOffice_Dev -u $(OUT) -buildid $(BUILD) -msitemplate $(MSIOFFICETEMPLATEDIR) -msilanguage $(MISC)$/win_ulffiles -format $(@:e:s/.//) $(VERBOSESWITCH)
205	$(PERL) -w $(SOLARENV)$/bin$/gen_update_info.pl --buildid $(BUILD) --arch "$(RTL_ARCH)" --os "$(RTL_OS)" --lstfile $(PRJ)$/util$/openoffice.lst --product OpenOffice_Dev --languages $(subst,$(@:s/_/ /:1)_, $(@:b)) $(PRJ)$/util$/update.xml > $(MISC)/$(@:b)_$(RTL_OS)_$(RTL_ARCH)$(@:e).update.xml
206
207$(foreach,i,$(alllangiso) ooolanguagepack_$i) : $$@{$(PKGFORMAT:^".")}
208ooolanguagepack_%{$(PKGFORMAT:^".")} :
209	$(PERL) -w $(SOLARENV)$/bin$/make_installer.pl -f $(PRJ)$/util$/openoffice.lst -l $(subst,$(@:s/_/ /:1)_, $(@:b)) -p OpenOffice -u $(OUT) -buildid $(BUILD) -msitemplate $(MSILANGPACKTEMPLATEDIR) -msilanguage $(MISC)$/win_ulffiles -languagepack -format $(@:e:s/.//) $(VERBOSESWITCH)
210
211$(foreach,i,$(alllangiso) ooodevlanguagepack_$i) : $$@{$(PKGFORMAT:^".")}
212ooodevlanguagepack_%{$(PKGFORMAT:^".")} :
213	$(PERL) -w $(SOLARENV)$/bin$/make_installer.pl -f $(PRJ)$/util$/openoffice.lst -l $(subst,$(@:s/_/ /:1)_, $(@:b)) -p OpenOffice_Dev -u $(OUT) -buildid $(BUILD) -msitemplate $(MSILANGPACKTEMPLATEDIR) -msilanguage $(MISC)$/win_ulffiles -languagepack -format $(@:e:s/.//) $(VERBOSESWITCH)
214
215$(foreach,i,$(alllangiso) sdkoo_$i) : $$@{$(PKGFORMAT:^".")}
216sdkoo_%{$(PKGFORMAT:^".")} :
217	$(PERL) -w $(SOLARENV)$/bin$/make_installer.pl -f $(PRJ)$/util$/openoffice.lst -l $(subst,$(@:s/_/ /:1)_, $(@:b)) -p OpenOffice_SDK -u $(OUT) -buildid $(BUILD) -msitemplate $(MSISDKOOTEMPLATEDIR) -msilanguage $(MISC)$/win_ulffiles -dontstrip -format $(@:e:s/.//) $(VERBOSESWITCH)
218
219$(foreach,i,$(alllangiso) sdkoodev_$i) : $$@{$(PKGFORMAT:^".")}
220sdkoodev_%{$(PKGFORMAT:^".")} :
221	$(PERL) -w $(SOLARENV)$/bin$/make_installer.pl -f $(PRJ)$/util$/openoffice.lst -l $(subst,$(@:s/_/ /:1)_, $(@:b)) -p OpenOffice_Dev_SDK -u $(OUT) -buildid $(BUILD) -msitemplate $(MSISDKOOTEMPLATEDIR) -msilanguage $(MISC)$/win_ulffiles -dontstrip -format $(@:e:s/.//) $(VERBOSESWITCH)
222
223$(foreach,i,$(alllangiso) ure_$i) : $$@{$(PKGFORMAT:^".")}
224ure_%{$(PKGFORMAT:^".")} :
225.IF "$(OS)" == "MACOSX"
226    @echo 'for now, there is no standalone URE for Mac OS X'
227.ELSE
228    $(PERL) -w $(SOLARENV)$/bin$/make_installer.pl -f $(PRJ)$/util$/openoffice.lst \
229        -l $(subst,$(@:s/_/ /:1)_, $(@:b)) -p URE -u $(OUT) -buildid $(BUILD) -format $(@:e:s/.//) $(VERBOSESWITCH) \
230        -msitemplate $(MSIURETEMPLATEDIR) \
231        -msilanguage $(MISC)$/win_ulffiles
232.ENDIF
233
234.IF "$(MAKETARGETS)"!=""
235.IF "$(MAKETARGETS:e)"=="" && "$(MAKETARGETS:s/_//)"!="$(MAKETARGETS)"
236$(MAKETARGETS) : $$@{$(PKGFORMAT:^".")}
237$(MAKETARGETS){$(PKGFORMAT:^".")} : $(ADDDEPS)
238.ENDIF			# "$(MAKETARGETS:e)"=="" && "$(MAKETARGETS:s/_//)"!="$(MAKETARGETS)"
239.ENDIF			# "$(MAKETARGETS)"!=""
240
241.ELSE			# "$(alllangiso)"!=""
242openoffice:
243	@echo cannot pack nothing...
244
245.ENDIF			# "$(alllangiso)"!=""
246
247.IF "$(LOCALPYFILES)"!=""
248$(foreach,i,$(alllangiso) openoffice_$i{$(PKGFORMAT:^".") .archive} openofficewithjre_$i{$(PKGFORMAT:^".")} openofficedev_$i{$(PKGFORMAT:^".")} sdkoo_$i{$(PKGFORMAT:^".")}) updatepack : $(LOCALPYFILES)
249.ENDIF			# "$(LOCALPYFILES)"!=""
250
251$(BIN)$/%.py : $(SOLARSHAREDBIN)$/pyuno$/%.py
252	@$(COPY) $< $@
253
254$(BIN)$/intro.zip : $(SOLARCOMMONPCKDIR)$/openoffice_nologo$/intro.zip
255	$(COPY) $< $@
256
257$(BIN)$/dev$/intro.zip : $(SOLARCOMMONPCKDIR)$/openoffice_dev_nologo$/intro.zip
258	@-$(MKDIR) $(@:d)
259	$(COPY) $< $@
260
261hack_msitemplates .PHONY:
262	-$(MKDIRHIER) $(MSIOFFICETEMPLATEDIR)
263	-$(MKDIRHIER) $(MSILANGPACKTEMPLATEDIR)
264	-$(MKDIRHIER) $(MSIURETEMPLATEDIR)
265	-$(MKDIRHIER) $(MSISDKOOTEMPLATEDIR)
266	-$(MKDIRHIER) $(MSIOFFICETEMPLATEDIR)$/Binary
267	-$(MKDIRHIER) $(MSILANGPACKTEMPLATEDIR)$/Binary
268	-$(MKDIRHIER) $(MSIURETEMPLATEDIR)$/Binary
269	-$(MKDIRHIER) $(MSISDKOOTEMPLATEDIR)$/Binary
270	$(GNUCOPY) $(MSIOFFICETEMPLATESOURCE)$/*.* $(MSIOFFICETEMPLATEDIR)
271	$(GNUCOPY) $(MSILANGPACKTEMPLATESOURCE)$/*.* $(MSILANGPACKTEMPLATEDIR)
272	$(GNUCOPY) $(MSIURETEMPLATESOURCE)$/*.* $(MSIURETEMPLATEDIR)
273	$(GNUCOPY) $(MSISDKOOTEMPLATESOURCE)$/*.* $(MSISDKOOTEMPLATEDIR)
274	$(GNUCOPY) $(MSIOFFICETEMPLATESOURCE)$/Binary$/*.* $(MSIOFFICETEMPLATEDIR)$/Binary
275	$(GNUCOPY) $(MSILANGPACKTEMPLATESOURCE)$/Binary$/*.* $(MSILANGPACKTEMPLATEDIR)$/Binary
276	$(GNUCOPY) $(MSIURETEMPLATESOURCE)$/Binary$/*.* $(MSIURETEMPLATEDIR)$/Binary
277	$(GNUCOPY) $(MSISDKOOTEMPLATESOURCE)$/Binary$/*.* $(MSISDKOOTEMPLATEDIR)$/Binary
278	$(RM) $(MSIOFFICETEMPLATEDIR)$/Binary$/Image.bmp
279	$(RM) $(MSILANGPACKTEMPLATEDIR)$/Binary$/Image.bmp
280	$(RM) $(MSIURETEMPLATEDIR)$/Binary$/Image.bmp
281	$(RM) $(MSISDKOOTEMPLATEDIR)$/Binary$/Image.bmp
282	$(COPY) $(PRJ)$/res$/nologoinstall.bmp $(MSIOFFICETEMPLATEDIR)$/Binary$/Image.bmp
283	$(COPY) $(PRJ)$/res$/nologoinstall.bmp $(MSILANGPACKTEMPLATEDIR)$/Binary$/Image.bmp
284	$(COPY) $(PRJ)$/res$/nologoinstall.bmp $(MSIURETEMPLATEDIR)$/Binary$/Image.bmp
285	$(COPY) $(PRJ)$/res$/nologoinstall.bmp $(MSISDKOOTEMPLATEDIR)$/Binary$/Image.bmp
286
287
288