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