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.ELIF "$(VERBOSE)"=="FALSE"
108VERBOSESWITCH=-quiet
109.ENDIF
110
111.IF "$(VERBOSE_INSTALLER)"=="TRUE"
112VERBOSESWITCH+=-log
113.ENDIF
114
115# New target to prepare a source release
116SRC_RELEASE_OUT_DIR=$(shell cd $(OUT) && pwd)$/AOO_SRC_Release
117
118aoo_srcrelease: $(SOLARENV)$/bin$/srcrelease.xml
119	@-$(MKDIR) $(OUT)$/AOO_SRC_Release
120	$(ANT) -f $(SOLARENV)$/bin$/srcrelease.xml -q -Dbasedir=$(SOURCE_ROOT_DIR) -Dout.dir=$(SRC_RELEASE_OUT_DIR)
121
122updatepack:
123	$(PERL) -w $(SOLARENV)$/bin$/packager.pl
124
125.IF "$(alllangiso)"!=""
126
127openoffice: $(foreach,i,$(alllangiso) openoffice_$i)
128
129openofficedev: $(foreach,i,$(alllangiso) openofficedev_$i)
130
131openofficewithjre: $(foreach,i,$(alllangiso) openofficewithjre_$i)
132
133ooolanguagepack : $(foreach,i,$(alllangiso) ooolanguagepack_$i)
134
135ooodevlanguagepack: $(foreach,i,$(alllangiso) ooodevlanguagepack_$i)
136
137sdkoo: $(foreach,i,$(alllangiso) sdkoo_$i)
138
139sdkoodev: $(foreach,i,$(alllangiso) sdkoodev_$i)
140
141ure: $(foreach,i,$(alllangiso) ure_$i)
142
143MSIOFFICETEMPLATESOURCE=$(PRJ)$/inc_openoffice$/windows$/msi_templates
144MSILANGPACKTEMPLATESOURCE=$(PRJ)$/inc_ooolangpack$/windows$/msi_templates
145MSIURETEMPLATESOURCE=$(PRJ)$/inc_ure$/windows$/msi_templates
146MSISDKOOTEMPLATESOURCE=$(PRJ)$/inc_sdkoo$/windows$/msi_templates
147
148.IF "$(BUILD_SPECIAL)"!=""
149MSIOFFICETEMPLATEDIR=$(MSIOFFICETEMPLATESOURCE)
150MSILANGPACKTEMPLATEDIR=$(MSILANGPACKTEMPLATESOURCE)
151MSIURETEMPLATEDIR=$(MSIURETEMPLATESOURCE)
152MSISDKOOTEMPLATEDIR=$(MSISDKOOTEMPLATESOURCE)
153.ELSE			# "$(BUILD_SPECIAL)"!=""
154NOLOGOSPLASH:=$(BIN)$/intro.zip
155DEVNOLOGOSPLASH:=$(BIN)$/dev$/intro.zip
156MSIOFFICETEMPLATEDIR=$(MISC)$/openoffice$/msi_templates
157MSILANGPACKTEMPLATEDIR=$(MISC)$/ooolangpack$/msi_templates
158MSIURETEMPLATEDIR=$(MISC)$/ure$/msi_templates
159MSISDKOOTEMPLATEDIR=$(MISC)$/sdkoo$/msi_templates
160
161ADDDEPS=$(NOLOGOSPLASH) $(DEVNOLOGOSPLASH)
162
163.IF "$(OS)" == "WNT"
164ADDDEPS+=hack_msitemplates
165.ENDIF
166
167$(foreach,i,$(alllangiso) openoffice_$i) : $(ADDDEPS)
168openoffice_$(defaultlangiso).archive : $(ADDDEPS)
169
170$(foreach,i,$(alllangiso) openofficedev_$i) : $(ADDDEPS)
171
172$(foreach,i,$(alllangiso) openofficewithjre_$i) : $(ADDDEPS)
173
174$(foreach,i,$(alllangiso) ooolanguagepack_$i) : $(ADDDEPS)
175
176$(foreach,i,$(alllangiso) ooodevlanguagepack_$i) : $(ADDDEPS)
177
178$(foreach,i,$(alllangiso) sdkoo_$i) : $(ADDDEPS)
179
180$(foreach,i,$(alllangiso) sdkoodev_$i) : $(ADDDEPS)
181
182$(foreach,i,$(alllangiso) ure_$i) : $(ADDDEPS)
183
184.IF "$(MAKETARGETS)"!=""
185$(MAKETARGETS) : $(ADDDEPS)
186.ENDIF			# "$(MAKETARGETS)"!=""
187
188.ENDIF			# "$(BUILD_SPECIAL)"!=""
189
190$(foreach,i,$(alllangiso) openoffice_$i) : $$@{$(PKGFORMAT:^".")}
191.IF "$(MAKETARGETS)"!=""
192.IF "$(MAKETARGETS:e)"=="" && "$(MAKETARGETS:s/_//)"!="$(MAKETARGETS)"
193$(MAKETARGETS) : $$@{$(PKGFORMAT:^".")}
194$(MAKETARGETS){$(PKGFORMAT:^".")} : $(ADDDEPS)
195.ENDIF			# "$(MAKETARGETS:e)"=="" && "$(MAKETARGETS:s/_//)"!="$(MAKETARGETS)"
196.ENDIF			# "$(MAKETARGETS)"!=""
197openoffice_%{$(PKGFORMAT:^".") .archive} :
198	$(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)
199	$(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
200
201$(foreach,i,$(alllangiso) openofficewithjre_$i) : $$@{$(PKGFORMAT:^".")}
202openofficewithjre_%{$(PKGFORMAT:^".")} :
203	$(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)
204
205$(foreach,i,$(alllangiso) openofficedev_$i) : $$@{$(PKGFORMAT:^".")}
206openofficedev_%{$(PKGFORMAT:^".")} :
207	$(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)
208	$(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
209
210$(foreach,i,$(alllangiso) ooolanguagepack_$i) : $$@{$(PKGFORMAT:^".")}
211ooolanguagepack_%{$(PKGFORMAT:^".")} :
212	$(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)
213
214$(foreach,i,$(alllangiso) ooodevlanguagepack_$i) : $$@{$(PKGFORMAT:^".")}
215ooodevlanguagepack_%{$(PKGFORMAT:^".")} :
216	$(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)
217
218$(foreach,i,$(alllangiso) sdkoo_$i) : $$@{$(PKGFORMAT:^".")}
219sdkoo_%{$(PKGFORMAT:^".")} :
220	$(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)
221
222$(foreach,i,$(alllangiso) sdkoodev_$i) : $$@{$(PKGFORMAT:^".")}
223sdkoodev_%{$(PKGFORMAT:^".")} :
224	$(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)
225
226$(foreach,i,$(alllangiso) ure_$i) : $$@{$(PKGFORMAT:^".")}
227ure_%{$(PKGFORMAT:^".")} :
228.IF "$(OS)" == "MACOSX"
229    @echo 'for now, there is no standalone URE for Mac OS X'
230.ELSE
231    $(PERL) -w $(SOLARENV)$/bin$/make_installer.pl -f $(PRJ)$/util$/openoffice.lst \
232        -l $(subst,$(@:s/_/ /:1)_, $(@:b)) -p URE -u $(OUT) -buildid $(BUILD) -format $(@:e:s/.//) $(VERBOSESWITCH) \
233        -msitemplate $(MSIURETEMPLATEDIR) \
234        -msilanguage $(MISC)$/win_ulffiles
235.ENDIF
236
237.IF "$(MAKETARGETS)"!=""
238.IF "$(MAKETARGETS:e)"=="" && "$(MAKETARGETS:s/_//)"!="$(MAKETARGETS)"
239$(MAKETARGETS) : $$@{$(PKGFORMAT:^".")}
240$(MAKETARGETS){$(PKGFORMAT:^".")} : $(ADDDEPS)
241.ENDIF			# "$(MAKETARGETS:e)"=="" && "$(MAKETARGETS:s/_//)"!="$(MAKETARGETS)"
242.ENDIF			# "$(MAKETARGETS)"!=""
243
244.ELSE			# "$(alllangiso)"!=""
245openoffice:
246	@echo cannot pack nothing...
247
248.ENDIF			# "$(alllangiso)"!=""
249
250.IF "$(LOCALPYFILES)"!=""
251$(foreach,i,$(alllangiso) openoffice_$i{$(PKGFORMAT:^".") .archive} openofficewithjre_$i{$(PKGFORMAT:^".")} openofficedev_$i{$(PKGFORMAT:^".")} sdkoo_$i{$(PKGFORMAT:^".")}) updatepack : $(LOCALPYFILES)
252.ENDIF			# "$(LOCALPYFILES)"!=""
253
254$(BIN)$/%.py : $(SOLARSHAREDBIN)$/pyuno$/%.py
255	@$(COPY) $< $@
256
257$(BIN)$/intro.zip : $(SOLARCOMMONPCKDIR)$/openoffice_nologo$/intro.zip
258	$(COPY) $< $@
259
260$(BIN)$/dev$/intro.zip : $(SOLARCOMMONPCKDIR)$/openoffice_dev_nologo$/intro.zip
261	@-$(MKDIR) $(@:d)
262	$(COPY) $< $@
263
264hack_msitemplates .PHONY:
265	-$(MKDIRHIER) $(MSIOFFICETEMPLATEDIR)
266	-$(MKDIRHIER) $(MSILANGPACKTEMPLATEDIR)
267	-$(MKDIRHIER) $(MSIURETEMPLATEDIR)
268	-$(MKDIRHIER) $(MSISDKOOTEMPLATEDIR)
269	-$(MKDIRHIER) $(MSIOFFICETEMPLATEDIR)$/Binary
270	-$(MKDIRHIER) $(MSILANGPACKTEMPLATEDIR)$/Binary
271	-$(MKDIRHIER) $(MSIURETEMPLATEDIR)$/Binary
272	-$(MKDIRHIER) $(MSISDKOOTEMPLATEDIR)$/Binary
273	$(GNUCOPY) $(MSIOFFICETEMPLATESOURCE)$/*.* $(MSIOFFICETEMPLATEDIR)
274	$(GNUCOPY) $(MSILANGPACKTEMPLATESOURCE)$/*.* $(MSILANGPACKTEMPLATEDIR)
275	$(GNUCOPY) $(MSIURETEMPLATESOURCE)$/*.* $(MSIURETEMPLATEDIR)
276	$(GNUCOPY) $(MSISDKOOTEMPLATESOURCE)$/*.* $(MSISDKOOTEMPLATEDIR)
277	$(GNUCOPY) $(MSIOFFICETEMPLATESOURCE)$/Binary$/*.* $(MSIOFFICETEMPLATEDIR)$/Binary
278	$(GNUCOPY) $(MSILANGPACKTEMPLATESOURCE)$/Binary$/*.* $(MSILANGPACKTEMPLATEDIR)$/Binary
279	$(GNUCOPY) $(MSIURETEMPLATESOURCE)$/Binary$/*.* $(MSIURETEMPLATEDIR)$/Binary
280	$(GNUCOPY) $(MSISDKOOTEMPLATESOURCE)$/Binary$/*.* $(MSISDKOOTEMPLATEDIR)$/Binary
281	$(RM) $(MSIOFFICETEMPLATEDIR)$/Binary$/Image.bmp
282	$(RM) $(MSILANGPACKTEMPLATEDIR)$/Binary$/Image.bmp
283	$(RM) $(MSIURETEMPLATEDIR)$/Binary$/Image.bmp
284	$(RM) $(MSISDKOOTEMPLATEDIR)$/Binary$/Image.bmp
285	$(COPY) $(PRJ)$/res$/nologoinstall.bmp $(MSIOFFICETEMPLATEDIR)$/Binary$/Image.bmp
286	$(COPY) $(PRJ)$/res$/nologoinstall.bmp $(MSILANGPACKTEMPLATEDIR)$/Binary$/Image.bmp
287	$(COPY) $(PRJ)$/res$/nologoinstall.bmp $(MSIURETEMPLATEDIR)$/Binary$/Image.bmp
288	$(COPY) $(PRJ)$/res$/nologoinstall.bmp $(MSISDKOOTEMPLATEDIR)$/Binary$/Image.bmp
289
290
291