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