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# watch for the path delimiter
32.IF "$(GUI)"=="WNT"
33PYTHONPATH:=$(PWD)$/$(BIN);$(SOLARLIBDIR);$(SOLARLIBDIR)$/python;$(SOLARLIBDIR)$/python$/lib-dynload
34.ELSE			# "$(GUI)"=="WNT"
35PYTHONPATH:=$(PWD)$/$(BIN):$(SOLARLIBDIR):$(SOLARLIBDIR)$/python:$(SOLARLIBDIR)$/python$/lib-dynload
36.ENDIF			# "$(GUI)"=="WNT"
37.EXPORT: PYTHONPATH
38
39.IF "$(CWS_WORK_STAMP)"=="" || "$(UPDATER)"!=""
40ENABLE_DOWNLOADSETS*=TRUE
41.ENDIF			# "$(CWS_WORK_STAMP)"=="" || "$(UPDATER)"!=""
42.IF "$(FORCE_DOWNLOADSETS)"!=""
43ENABLE_DOWNLOADSETS=TRUE
44.ENDIF			# "$(FORCE_DOWNLOADSETS)"!=""
45
46.EXPORT: ENABLE_DOWNLOADSETS
47.EXPORT: LAST_MINOR
48.EXPORT: PRJ
49.EXPORT: PRJNAME
50
51.IF "$(OS)"=="LINUX"
52DONT_REMOVE_PACKAGE:=TRUE
53.EXPORT: DONT_REMOVE_PACKAGE
54.ENDIF          # "$(OS)"=="LINUX"
55
56.INCLUDE .IGNORE: $(SRC_ROOT)$/cwsname.mk
57
58SHARED_COM_SDK_PATH*:=.
59
60INSTALLDIR=$(OUT)
61
62.INCLUDE: target.mk
63
64# The help target belongs after the inclusion of target.mk to not become the default target.
65help .PHONY :
66	@echo "known targets:"
67	@echo "    openoffice             builds the default installation packages for the platform"
68	@echo "    aoo_srcrelease         packs the source release package"
69	@echo "    updatepack"
70	@echo "    openofficedev          devloper snapshot"
71	@echo "    openofficewithjre"
72	@echo "    ooolanguagepack"
73	@echo "    ooodevlanguagepack"
74	@echo "    sdkoo"
75	@echo "    sdkoodev"
76	@echo
77	@echo "Most targets (all except aoo_srcrelease and updatepack) accept suffixes"
78	@echo "    add _<language> to build a target for one language only"
79	@echo "        the default set of languages is alllangiso=$(alllangiso)"
80	@echo "    add .<package_format> to build a target for one package format only"
81	@echo "        the default set of package formats is archive and PKGFORMAT=$(PKGFORMAT)"
82
83
84LOCALPYFILES= \
85    $(BIN)$/uno.py \
86	$(BIN)$/unohelper.py \
87	$(BIN)$/pythonloader.py \
88	$(BIN)$/pythonscript.py \
89	$(BIN)$/officehelper.py \
90	$(BIN)$/mailmerge.py
91
92xxxx:
93    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
94
95.IF "$(GUI)"!="WNT" && "$(EPM)"=="NO" && "$(USE_PACKAGER)"==""
96ALLTAR  : $(LOCALPYFILES)
97	@echo "No EPM: do no packaging at this stage"
98.ELSE			# "$(GUI)"!="WNT" && "$(EPM)"=="NO" && "$(USE_PACKAGER)"==""
99.IF "$(UPDATER)"=="" || "$(USE_PACKAGER)"==""
100.IF "$(BUILD_TYPE)"=="$(BUILD_TYPE:s/ODK//)"
101ALLTAR : openoffice
102.ELSE
103ALLTAR : openoffice sdkoo_en-US
104.ENDIF
105.ELSE			# "$(UPDATER)"=="" || "$(USE_PACKAGER)"==""
106ALLTAR : updatepack
107.ENDIF			# "$(UPDATER)"=="" || "$(USE_PACKAGER)"==""
108.ENDIF			# "$(GUI)"!="WNT" && "$(EPM)"=="NO" && "$(USE_PACKAGER)"==""
109
110.IF "$(FORCE2ARCHIVE)" == "TRUE"
111PKGFORMAT = archive
112.END
113
114.IF "$(MAKETARGETS:e)"!=""
115PKGFORMAT+=$(MAKETARGETS:e:s/.//)
116.ENDIF			# "$(MAKETARGETS:e)"!=""
117
118# Independent of PKGFORMAT, always build a default-language openoffice product
119# also in archive format, so that tests that require an OOo installation (like
120# smoketestoo_native) have one available:
121openoffice_$(defaultlangiso) : $$@.archive
122
123.IF "$(VERBOSE)"=="TRUE"
124VERBOSESWITCH=-verbose
125.ELIF "$(VERBOSE)"=="FALSE"
126VERBOSESWITCH=-quiet
127.ENDIF
128
129.IF "$(VERBOSE_INSTALLER)"=="TRUE"
130VERBOSESWITCH+=-log
131.ENDIF
132
133# New target to prepare a source release
134SRC_RELEASE_OUT_DIR=$(shell cd $(OUT) && pwd)$/AOO_SRC_Release
135
136aoo_srcrelease: $(SOLARENV)$/bin$/srcrelease.xml
137	@-$(MKDIR) $(OUT)$/AOO_SRC_Release
138	$(ANT) -f $(SOLARENV)$/bin$/srcrelease.xml -q -Dbasedir=$(SOURCE_ROOT_DIR) -Dout.dir=$(SRC_RELEASE_OUT_DIR)
139
140updatepack:
141	$(PERL) -w $(SOLARENV)$/bin$/packager.pl
142
143.IF "$(alllangiso)"!=""
144
145openoffice: $(foreach,i,$(alllangiso) openoffice_$i)
146
147openofficedev: $(foreach,i,$(alllangiso) openofficedev_$i)
148
149openofficewithjre: $(foreach,i,$(alllangiso) openofficewithjre_$i)
150
151ooolanguagepack : $(foreach,i,$(alllangiso) ooolanguagepack_$i)
152
153ooodevlanguagepack: $(foreach,i,$(alllangiso) ooodevlanguagepack_$i)
154
155sdkoo: $(foreach,i,$(alllangiso) sdkoo_$i)
156
157sdkoodev: $(foreach,i,$(alllangiso) sdkoodev_$i)
158
159MSIOFFICETEMPLATESOURCE=$(PRJ)$/inc_openoffice$/windows$/msi_templates
160MSILANGPACKTEMPLATESOURCE=$(PRJ)$/inc_ooolangpack$/windows$/msi_templates
161MSISDKOOTEMPLATESOURCE=$(PRJ)$/inc_sdkoo$/windows$/msi_templates
162
163NOLOGOSPLASH:=$(BIN)$/intro.zip
164DEVNOLOGOSPLASH:=$(BIN)$/dev$/intro.zip
165MSIOFFICETEMPLATEDIR=$(MISC)$/openoffice$/msi_templates
166MSILANGPACKTEMPLATEDIR=$(MISC)$/ooolangpack$/msi_templates
167MSISDKOOTEMPLATEDIR=$(MISC)$/sdkoo$/msi_templates
168
169ADDDEPS=$(NOLOGOSPLASH) $(DEVNOLOGOSPLASH)
170
171.IF "$(OS)" == "WNT"
172ADDDEPS+=msitemplates
173.ENDIF
174
175$(foreach,i,$(alllangiso) openoffice_$i) : $(ADDDEPS)
176openoffice_$(defaultlangiso).archive : $(ADDDEPS)
177
178$(foreach,i,$(alllangiso) openofficedev_$i) : $(ADDDEPS)
179
180$(foreach,i,$(alllangiso) openofficewithjre_$i) : $(ADDDEPS)
181
182$(foreach,i,$(alllangiso) ooolanguagepack_$i) : $(ADDDEPS)
183
184$(foreach,i,$(alllangiso) ooodevlanguagepack_$i) : $(ADDDEPS)
185
186$(foreach,i,$(alllangiso) sdkoo_$i) : $(ADDDEPS)
187
188$(foreach,i,$(alllangiso) sdkoodev_$i) : $(ADDDEPS)
189
190.IF "$(MAKETARGETS)"!=""
191$(MAKETARGETS) : $(ADDDEPS)
192.ENDIF			# "$(MAKETARGETS)"!=""
193
194$(foreach,i,$(alllangiso) openoffice_$i) : $$@{$(PKGFORMAT:^".")}
195.IF "$(MAKETARGETS)"!=""
196.IF "$(MAKETARGETS:e)"=="" && "$(MAKETARGETS:s/_//)"!="$(MAKETARGETS)"
197$(MAKETARGETS) : $$@{$(PKGFORMAT:^".")}
198$(MAKETARGETS){$(PKGFORMAT:^".")} : $(ADDDEPS)
199.ENDIF			# "$(MAKETARGETS:e)"=="" && "$(MAKETARGETS:s/_//)"!="$(MAKETARGETS)"
200.ENDIF			# "$(MAKETARGETS)"!=""
201
202
203# This macro makes calling the make_installer.pl script a bit easier.
204# Just add -p and -msitemplate switches.
205MAKE_INSTALLER_COMMAND=					\
206	@$(PERL) -w $(SOLARENV)$/bin$/make_installer.pl 	\
207		-f $(PRJ)$/util$/openoffice.lst 	\
208		-l $(subst,$(@:s/_/ /:1)_, $(@:b)) 	\
209		-u $(OUT) 				\
210		-buildid $(BUILD) 			\
211		-msilanguage $(MISC)$/win_ulffiles	\
212		-format $(@:e:s/.//) 			\
213		$(VERBOSESWITCH)
214
215# This macro makes calling gen_update_info.pl a bit easier
216# Just add --product switches, and xml input file and redirect output.
217GEN_UPDATE_INFO_COMMAND=					\
218	@$(PERL) -w $(SOLARENV)$/bin$/gen_update_info.pl		\
219		--buildid $(BUILD)				\
220		--arch "$(RTL_ARCH)"				\
221		--os "$(RTL_OS)"				\
222		--lstfile $(PRJ)$/util$/openoffice.lst		\
223		--languages $(subst,$(@:s/_/ /:1)_, $(@:b))
224
225openoffice_%{$(PKGFORMAT:^".")} :
226	$(MAKE_INSTALLER_COMMAND) 		\
227		-p Apache_OpenOffice		\
228		-msitemplate $(MSIOFFICETEMPLATEDIR)
229	$(GEN_UPDATE_INFO_COMMAND)		\
230		--product Apache_OpenOffice	\
231		$(PRJ)$/util$/update.xml	\
232		> $(MISC)/$(@:b)_$(RTL_OS)_$(RTL_ARCH)$(@:e).update.xml
233
234openoffice_%{.archive} :
235	$(MAKE_INSTALLER_COMMAND) 		\
236		-p Apache_OpenOffice		\
237		-msitemplate $(MSIOFFICETEMPLATEDIR)
238	$(GEN_UPDATE_INFO_COMMAND)		\
239		--product Apache_OpenOffice	\
240		$(PRJ)$/util$/update.xml	\
241		> $(MISC)/$(@:b)_$(RTL_OS)_$(RTL_ARCH)$(@:e).update.xml
242
243$(foreach,i,$(alllangiso) openofficewithjre_$i) : $$@{$(PKGFORMAT:^".")}
244openofficewithjre_%{$(PKGFORMAT:^".")} :
245	$(MAKE_INSTALLER_COMMAND) -p Apache_OpenOffice_wJRE -msitemplate $(MSIOFFICETEMPLATEDIR)
246
247$(foreach,i,$(alllangiso) openofficedev_$i) : $$@{$(PKGFORMAT:^".")}
248openofficedev_%{$(PKGFORMAT:^".")} :
249	$(MAKE_INSTALLER_COMMAND)		\
250		-p Apache_OpenOffice_Dev	\
251		-msitemplate $(MSIOFFICETEMPLATEDIR)
252	$(GEN_UPDATE_INFO_COMMAND)			\
253		--product Apache_OpenOffice_Dev 	\
254		$(PRJ)$/util$/update.xml 		\
255		> $(MISC)/$(@:b)_$(RTL_OS)_$(RTL_ARCH)$(@:e).update.xml
256
257$(foreach,i,$(alllangiso) ooolanguagepack_$i) : $$@{$(PKGFORMAT:^".")}
258ooolanguagepack_%{$(PKGFORMAT:^".")} :
259	$(MAKE_INSTALLER_COMMAND)			\
260		-p Apache_OpenOffice			\
261		-msitemplate $(MSILANGPACKTEMPLATEDIR)	\
262		-languagepack
263
264$(foreach,i,$(alllangiso) ooodevlanguagepack_$i) : $$@{$(PKGFORMAT:^".")}
265ooodevlanguagepack_%{$(PKGFORMAT:^".")} :
266	$(MAKE_INSTALLER_COMMAND) -p Apache_OpenOffice_Dev -msitemplate $(MSILANGPACKTEMPLATEDIR) -languagepack
267
268$(foreach,i,$(alllangiso) sdkoo_$i) : $$@{$(PKGFORMAT:^".")}
269sdkoo_%{$(PKGFORMAT:^".")} :
270	$(MAKE_INSTALLER_COMMAND) -p Apache_OpenOffice_SDK -msitemplate $(MSISDKOOTEMPLATEDIR) -dontstrip
271
272$(foreach,i,$(alllangiso) sdkoodev_$i) : $$@{$(PKGFORMAT:^".")}
273sdkoodev_%{$(PKGFORMAT:^".")} :
274	$(MAKE_INSTALLER_COMMAND) -p Apache_OpenOffice_Dev_SDK -msitemplate $(MSISDKOOTEMPLATEDIR) -dontstrip
275
276.IF "$(MAKETARGETS)"!=""
277.IF "$(MAKETARGETS:e)"=="" && "$(MAKETARGETS:s/_//)"!="$(MAKETARGETS)"
278$(MAKETARGETS) : $$@{$(PKGFORMAT:^".")}
279$(MAKETARGETS){$(PKGFORMAT:^".")} : $(ADDDEPS)
280.ENDIF			# "$(MAKETARGETS:e)"=="" && "$(MAKETARGETS:s/_//)"!="$(MAKETARGETS)"
281.ENDIF			# "$(MAKETARGETS)"!=""
282
283.ELSE			# "$(alllangiso)"!=""
284openoffice:
285	@echo cannot pack nothing...
286
287.ENDIF			# "$(alllangiso)"!=""
288
289.IF "$(LOCALPYFILES)"!=""
290$(foreach,i,$(alllangiso) openoffice_$i{$(PKGFORMAT:^".") .archive} openofficewithjre_$i{$(PKGFORMAT:^".")} openofficedev_$i{$(PKGFORMAT:^".")} sdkoo_$i{$(PKGFORMAT:^".")}) updatepack : $(LOCALPYFILES)
291.ENDIF			# "$(LOCALPYFILES)"!=""
292
293$(BIN)$/%.py : $(SOLARSHAREDBIN)$/pyuno$/%.py
294	@$(COPY) $< $@
295
296#$(BIN)$/intro.zip : $(SOLARCOMMONPCKDIR)$/openoffice_nologo$/intro.zip
297$(BIN)$/intro.zip : $(SOLARCOMMONPCKDIR)$/intro.zip
298	$(COPY) $< $@
299
300#$(BIN)$/dev$/intro.zip : $(SOLARCOMMONPCKDIR)$/openoffice_dev_nologo$/intro.zip
301$(BIN)$/dev$/intro.zip : $(SOLARCOMMONPCKDIR)$/openoffice_dev$/intro.zip
302	@-$(MKDIR) $(@:d)
303	$(COPY) $< $@
304
305msitemplates .PHONY: msi_template_files msi_langpack_template_files msi_sdk_template_files
306
307MSI_OFFICE_TEMPLATE_FILES=		\
308	ActionTe.idt			\
309	AdminExe.idt			\
310	AdminUIS.idt			\
311	AdvtExec.idt			\
312	AppSearc.idt			\
313	Binary.idt			\
314	CheckBox.idt			\
315	Control.idt			\
316	ControlC.idt			\
317	ControlE.idt			\
318	CustomAc.idt			\
319	Dialog.idt			\
320	Error.idt			\
321	EventMap.idt			\
322	InstallE.idt			\
323	InstallU.idt			\
324	LaunchCo.idt			\
325	ListBox.idt			\
326	Property.idt			\
327	RadioBut.idt			\
328	RegLocat.idt			\
329	Signatur.idt			\
330	TextStyl.idt			\
331	UIText.idt			\
332	_Validat.idt			\
333	codes.txt			\
334	codes_broo.txt			\
335	codes_broodev.txt		\
336	codes_ooodev.txt		\
337	components.txt			\
338	upgradecode_remove_ooo.txt	\
339	Binary/Banner.bmp		\
340	Binary/Image.bmp		\
341	Binary/caution.ico		\
342	Binary/dontinstall.ico		\
343	Binary/install.ico		\
344	Binary/installfirstuse.ico	\
345	Binary/installpartial.ico	\
346	Binary/installstatemenu.ico	\
347	Binary/networkinstall.ico	\
348	Binary/newfolder.ico		\
349	Binary/openfolder.ico		\
350	Binary/setup.ico		\
351	Binary/setupcomplete.ico	\
352	Binary/setuppartial.ico		\
353	Binary/setuprepair.ico		\
354	Binary/trashcan.ico		\
355	Binary/up.ico
356
357MSI_LANGPACK_TEMPLATE_FILES=		\
358	ActionTe.idt			\
359	AdminExe.idt			\
360	AdminUIS.idt			\
361	AdvtExec.idt			\
362	Binary.idt			\
363	CheckBox.idt			\
364	Control.idt			\
365	ControlC.idt			\
366	ControlE.idt			\
367	CustomAc.idt			\
368	Dialog.idt			\
369	Error.idt			\
370	EventMap.idt			\
371	InstallE.idt			\
372	InstallU.idt			\
373	LaunchCo.idt			\
374	ListBox.idt			\
375	Property.idt			\
376	RadioBut.idt			\
377	TextStyl.idt			\
378	UIText.idt			\
379	_Validat.idt			\
380	bro_patchcodes.txt		\
381	brodev_patchcodes.txt		\
382	codes.txt			\
383	codes_broo.txt			\
384	codes_ooodev.txt		\
385	components.txt			\
386	ooo_patchcodes.txt		\
387	ooodev_patchcodes.txt		\
388	Binary/Banner.bmp
389
390MSI_SDK_TEMPLATE_FILES=			\
391	ActionTe.idt			\
392	AdminExe.idt			\
393	AdminUIS.idt			\
394	AdvtExec.idt			\
395	AppSearc.idt			\
396	Binary.idt			\
397	CheckBox.idt			\
398	Control.idt			\
399	ControlC.idt			\
400	ControlE.idt			\
401	CustomAc.idt			\
402	Dialog.idt			\
403	Error.idt			\
404	EventMap.idt			\
405	InstallE.idt			\
406	InstallU.idt			\
407	LaunchCo.idt			\
408	ListBox.idt			\
409	Property.idt			\
410	RadioBut.idt			\
411	RegLocat.idt			\
412	Signatur.idt			\
413	TextStyl.idt			\
414	UIText.idt			\
415	_Validat.idt			\
416	codes.txt			\
417	components.txt			\
418	Binary/Banner.bmp		\
419	Binary/Image.bmp		\
420	Binary/caution.ico		\
421	Binary/dontinstall.ico		\
422	Binary/install.ico		\
423	Binary/installfirstuse.ico	\
424	Binary/installpartial.ico	\
425	Binary/installstatemenu.ico	\
426	Binary/networkinstall.ico	\
427	Binary/newfolder.ico		\
428	Binary/openfolder.ico		\
429	Binary/setup.ico		\
430	Binary/setupcomplete.ico	\
431	Binary/setuppartial.ico		\
432	Binary/setuprepair.ico		\
433	Binary/trashcan.ico		\
434	Binary/up.ico
435
436msi_template_files .PHONY:					\
437	$(MSIOFFICETEMPLATEDIR)					\
438	$(MSIOFFICETEMPLATEDIR)$/Binary 			\
439	$(MSIOFFICETEMPLATEDIR)$/{$(MSI_OFFICE_TEMPLATE_FILES)}
440$(MSIOFFICETEMPLATEDIR) $(MSIOFFICETEMPLATEDIR)$/Binary :
441	-$(MKDIRHIER) $@
442$(MSIOFFICETEMPLATEDIR)$/% : $(MSIOFFICETEMPLATESOURCE)$/%
443	$(GNUCOPY) $< $@
444
445msi_langpack_template_files .PHONY :				\
446	$(MSILANGPACKTEMPLATEDIR)				\
447	$(MSILANGPACKTEMPLATEDIR)$/Binary			\
448	$(MSILANGPACKTEMPLATEDIR)$/{$(MSI_LANGPACK_TEMPLATE_FILES)}
449$(MSILANGPACKTEMPLATEDIR) $(MSILANGPACKTEMPLATEDIR)$/Binary  :
450	-$(MKDIRHIER) $@
451$(MSILANGPACKTEMPLATEDIR)$/% : $(MSILANGPACKTEMPLATESOURCE)$/%
452	$(GNUCOPY) $< $@
453
454
455msi_sdk_template_files .PHONY :					\
456	$(MSISDKOOTEMPLATEDIR)					\
457	$(MSISDKOOTEMPLATEDIR)$/Binary				\
458	$(MSISDKOOTEMPLATEDIR)$/{$(MSI_SDK_TEMPLATE_FILES)}
459$(MSISDKOOTEMPLATEDIR) $(MSISDKOOTEMPLATEDIR)$/Binary :
460	-$(MKDIRHIER) $@
461$(MSISDKOOTEMPLATEDIR)/% : $(MSISDKOOTEMPLATESOURCE)$/%
462	$(GNUCOPY) $< $@
463