update dev300-m58
[ooovba.git] / moz / extractfiles.mk
blobdfb14afa8a3e565e151c7db3cd4a80bcc120babf
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: extractfiles.mk,v $
11 # $Revision: 1.13 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 MOZTARGET=$(OS)$(COM)$(CPU)
33 MOZ_DIST_DIR=$(MISC)$/build$/mozilla$/$(BUILD_DIR)$/dist
34 MOZ_BIN_DIR=$(MOZ_DIST_DIR)$/bin
35 RUNTIME_DIR=$(MISC)$/$(MOZTARGET)runtime
36 LIB_DIR=$(LB)
37 INCLUDE_DIR=$(INCCOM)
41 #If we build the NSS module then we do not need the old nss libs from here
42 .IF "$(ENABLE_NSS_MODULE)"=="YES"
45 .IF "$(OS)" == "SOLARIS"
46 .IF "$(CPU)" == "S" #32bit
47 FREEBL_LIB=freebl_32fpu_3 freebl_32int64_3 freebl_32int_3
48 .ELIF "$(CPU)" == "U" #64bit unxsolu4
49 FREEBL_LIB=freebl_64int_3 freebl_64fpu_3
50 .ELSE
51 FREEBL_LIB=freebl3
52 .ENDIF #"$(CPU)" == "S"
54 .ELSE # "$(OS)" == "SOLARIS"
55 FREEBL_LIB=freebl3
56 .ENDIF # "$(OS)" == "SOLARIS"
59 NSS_MODULE_RUNTIME_LIST:= \
60 $(FREEBL_LIB) \
61 nspr4 \
62 nss3 \
63 nssckbi \
64 nssdbm3 \
65 nssutil3 \
66 plc4 \
67 plds4 \
68 smime3 \
69 softokn3 \
70 sqlite3 \
71 ssl3
73 BIN_RUNTIMELIST= \
74 xpcom \
75 xpcom_core \
76 xpcom_compat
77 .ELSE
79 .IF "$(GUI)" == "WNT"
80 FREEBL_LIB=freebl3
81 .ELSE # "$(GUI)" == "WNT"
82 .IF "$(OS)$(CPUNAME)" == "SOLARISSPARC"
83 FREEBL_LIB=freebl_32fpu_3
84 .ELSE # "$(OS)$(CPUNAME)" == "SOLARISSPARC"
85 FREEBL_LIB=freebl3
86 .ENDIF # "$(OS)$(CPUNAME)" == "SOLARISSPARC"
87 .ENDIF # "$(GUI)" == "WNT"
90 BIN_RUNTIMELIST= \
91 nspr4 \
92 plc4 \
93 plds4 \
94 xpcom \
95 xpcom_core \
96 xpcom_compat \
97 nss3 \
98 ssl3 \
99 softokn3 \
100 smime3 \
101 $(FREEBL_LIB)
102 .ENDIF # "$(ENABLE_NSS_MODULE)"=="YES"
104 .IF "$(GUI)"=="WNT"
105 BIN_RUNTIMELIST+= \
106 js3250 \
107 mozz \
108 msgbsutl \
109 nsldap32v50 \
110 nsldappr32v50
111 .ELSE #"$(GUI)"=="WNT"
112 BIN_RUNTIMELIST+= \
113 mozjs \
114 mozz \
115 msgbaseutil \
116 ldap50 \
117 prldap50
118 .ENDIF
120 COMPONENT_RUNTIMELIST= \
121 addrbook \
122 mork \
123 mozldap \
124 necko \
125 profile \
126 xpcom_compat_c \
127 rdf \
128 uconv \
129 vcard \
130 i18n \
131 pipnss
133 .IF "$(GUI)"=="WNT"
134 COMPONENT_RUNTIMELIST+= \
135 xppref32 \
136 xpc3250
137 .ELSE #"$(GUI)"=="WNT"
138 COMPONENT_RUNTIMELIST+= \
139 pref \
140 xpconnect
141 .ENDIF
143 COMREGISTRY_FILELIST= \
144 necko_dns.xpt \
145 xpcom_base.xpt \
146 xpcom_obsolete.xpt \
147 xpcom_components.xpt \
148 xpcom_ds.xpt \
149 xpcom_io.xpt \
150 xpcom_xpti.xpt \
151 addrbook.xpt \
152 mozldap.xpt \
153 pref.xpt
155 .IF "$(GUI)"=="WNT"
156 COMREGISTRY_FILELIST+= xpcom_thread.xpt
157 .ELSE #"$(GUI)"=="WNT"
158 COMREGISTRY_FILELIST+= xpcom_threads.xpt
159 .ENDIF
161 DEFAULTS_RUNTIMELIST= \
162 defaults$/pref$/browser-prefs.js \
163 defaults$/pref$/mailnews.js \
164 defaults$/pref$/mdn.js \
165 defaults$/pref$/smime.js \
166 defaults$/autoconfig$/platform.js \
167 defaults$/autoconfig$/prefcalls.js \
168 greprefs$/all.js \
169 greprefs$/security-prefs.js
171 .IF "$(ENABLE_NSS_MODULE)"=="YES"
172 #These headers come from the separate NSS module if enabled
173 NSS_INCLUDE_LIST= nspr nss
175 .IF "$(GUI)"=="WNT"
176 .IF "$(COM)"=="GCC"
179 LIBLIST= \
180 libembed_base_s.a \
181 libmozreg_s.a \
182 libnslber32v50.a \
183 libnsldap32v50.a \
184 libxpcom_core.dll.a \
185 libxpcom.dll.a
187 .ELSE #"$(COM)"=="GCC"
189 LIBLIST= \
190 embed_base_s.lib \
191 mozreg_s.lib \
192 nslber32v50.lib \
193 nsldap32v50.lib \
194 xpcom_core.lib \
195 xpcom.lib
197 .ENDIF #"$(COM)"=="GCC"
199 .ELSE #"$(GUI)"=="WNT"
201 LIBLIST= \
202 libembed_base_s.a \
203 libmozreg_s.a \
204 liblber50.a \
205 libxpcom_core$(DLLPOST) \
206 libxpcom$(DLLPOST) \
207 libmsgbaseutil$(DLLPOST) \
208 libldap50$(DLLPOST) \
210 .ENDIF
212 .ELSE # .IF"$(ENABLE_NSS_MODULE)"=="YES"
214 .IF "$(GUI)"=="WNT"
215 .IF "$(COM)"=="GCC"
217 LIBLIST= \
218 libembed_base_s.a \
219 libmozreg_s.a \
220 libnslber32v50.a \
221 libnsldap32v50.a \
222 libnspr4.a \
223 libxpcom_core.dll.a \
224 libxpcom.dll.a \
225 libnss3.a \
226 libsmime3.a
228 .ELSE
230 LIBLIST= \
231 embed_base_s.lib \
232 mozreg_s.lib \
233 nslber32v50.lib \
234 nsldap32v50.lib \
235 nspr4.lib \
236 xpcom_core.lib \
237 xpcom.lib \
238 plc4.lib \
239 plds4.lib \
240 nss3.lib \
241 ssl3.lib \
242 smime3.lib
244 .ENDIF
246 .ELSE #"$(GUI)"=="WNT"
248 LIBLIST= \
249 libembed_base_s.a \
250 libmozreg_s.a \
251 liblber50.a \
252 libnspr4$(DLLPOST) \
253 libxpcom_core$(DLLPOST) \
254 libxpcom$(DLLPOST) \
255 libmsgbaseutil$(DLLPOST) \
256 libldap50$(DLLPOST) \
257 libsoftokn3$(DLLPOST) \
258 libplc4$(DLLPOST) \
259 libplds4$(DLLPOST) \
260 libnss3$(DLLPOST) \
261 libssl3$(DLLPOST) \
262 libsmime3$(DLLPOST)
264 .ENDIF
265 .ENDIF # .IF "$(ENABLE_NSS_MODULE)"=="YES"
267 INCLUDE_PATH=$(MOZ_DIST_DIR)$/include$/
268 PUBLIC_PATH=$(MOZ_DIST_DIR)$/public$/
271 .IF "$(GUI)"=="WNT"
272 REG_SUBFIX= .exe
273 .ELSE #"$(GUI)"=="WNT"
274 REG_SUBFIX=
275 .ENDIF
277 # --- Targets ------------------------------------------------------
279 extract_mozab_files: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) \
280 make_temp_dir \
281 $(MISC)$/build$/so_moz_runtime_files \
282 $(MISC)$/build$/so_moz_include_files \
283 $(MISC)$/build$/so_moz_lib_files
285 make_temp_dir:
286 @@-$(MKDIR) $(RUNTIME_DIR)
287 @@-$(MKDIR) $(RUNTIME_DIR)$/components
288 @@-$(MKDIR) $(RUNTIME_DIR)$/defaults
289 @@-$(MKDIR) $(RUNTIME_DIR)$/defaults$/pref
290 @@-$(MKDIR) $(LIB_DIR)
291 @@-$(MKDIR) $(INCLUDE_DIR)
292 .IF "$(OS)"=="SOLARIS"
293 @@-$(MKDIR) $(RUNTIME_DIR)$/res
294 .ENDIF
296 $(OUT)$/bin$/mozruntime.zip: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
297 noop
299 $(MISC)$/build$/so_moz_runtime_files: $(OUT)$/bin$/mozruntime.zip
300 # copy files in BIN_RUNTIMELIST
301 $(foreach,file,$(BIN_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/$(DLLPRE)$(file)$(DLLPOST) \
302 $(RUNTIME_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \
303 echo >& $(NULLDEV)
304 .IF "$(GUI)" == "UNX"
305 $(foreach,file,$(BIN_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/$(DLLPRE)$(file)$(DLLPOST) \
306 $(LIB_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \
307 echo >& $(NULLDEV)
308 .IF "$(ENABLE_NSS_MODULE)" == "YES"
309 # We add the libraries from the separate nss module
310 $(foreach,file,$(NSS_MODULE_RUNTIME_LIST) $(COPY) $(SOLARLIBDIR)$/$(DLLPRE)$(file)$(DLLPOST) \
311 $(RUNTIME_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \
312 echo >& $(NULLDEV)
313 .ENDIF
314 .ELSE # .IF "$(GUI)" == "UNX"
315 .IF "$(ENABLE_NSS_MODULE)" == "YES"
316 # We add the libraries from the separate nss module
317 $(foreach,file,$(NSS_MODULE_RUNTIME_LIST) $(COPY) $(SOLARBINDIR)$/$(DLLPRE)$(file)$(DLLPOST) \
318 $(RUNTIME_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \
319 echo >& $(NULLDEV)
320 .ENDIF
321 .ENDIF # .IF "$(GUI)" == "UNX"
324 # copy files in RES_FILELIST
325 .IF "$(OS)"=="SOLARIS"
326 @$(COPY) $(MOZ_BIN_DIR)$/res$/charsetalias.properties $(RUNTIME_DIR)$/res$/charsetalias.properties
327 .ELSE
328 @echo No Res Files to copy.
329 .ENDIF
331 # copy files in COMPONENT_RUNTIMELIST
332 $(foreach,file,$(COMPONENT_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/components$/$(DLLPRE)$(file)$(DLLPOST) \
333 $(RUNTIME_DIR)$/components$/$(DLLPRE)$(file)$(DLLPOST) &&) \
334 echo >& $(NULLDEV)
336 # copy files in COMREGISTRY_FILELIST
337 $(foreach,file,$(COMREGISTRY_FILELIST) $(COPY) $(MOZ_BIN_DIR)$/components$/$(file) \
338 $(RUNTIME_DIR)$/components$/$(file) &&) \
339 echo >& $(NULLDEV)
341 # copy files in DEFAULTS_RUNTIMELIST
342 @@-$(MKDIR) $(RUNTIME_DIR)$/defaults$/pref
343 @@-$(MKDIR) $(RUNTIME_DIR)$/defaults$/autoconfig
344 @@-$(MKDIR) $(RUNTIME_DIR)$/greprefs
345 $(foreach,file,$(DEFAULTS_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/$(file) $(RUNTIME_DIR)$/$(file) &&) \
346 echo >& $(NULLDEV)
348 .IF "$(GUI)"=="UNX"
349 .IF "$(OS)"!="MACOSX"
350 cd $(RUNTIME_DIR) && strip *$(DLLPOST)
351 cd $(RUNTIME_DIR)$/components && strip *$(DLLPOST)
352 .ENDIF
353 .ENDIF
354 .IF "$(OS)"=="MACOSX"
355 $(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl extshl OOO \
356 $(RUNTIME_DIR)$/*$(DLLPOST)
357 # A crude hack to adapt all the install names in the components subdir:
358 $(foreach,file,$(shell ls $(RUNTIME_DIR)$/components$/*$(DLLPOST)) \
359 install_name_tool \
360 -change @executable_path/libldap50.dylib \
361 @loader_path/../libldap50.dylib \
362 -change @executable_path/libmozjs.dylib @loader_path/../libmozjs.dylib \
363 -change @executable_path/libmozz.dylib @loader_path/../libmozz.dylib \
364 -change @executable_path/libmsgbaseutil.dylib \
365 @loader_path/../libmsgbaseutil.dylib \
366 -change @executable_path/libnspr4.dylib @loader_path/../libnspr4.dylib \
367 -change @executable_path/libnss3.dylib @loader_path/../libnss3.dylib \
368 -change @executable_path/libplc4.dylib @loader_path/../libplc4.dylib \
369 -change @executable_path/libplds4.dylib @loader_path/../libplds4.dylib \
370 -change @executable_path/libprldap50.dylib \
371 @loader_path/../libprldap50.dylib \
372 -change @executable_path/libsmime3.dylib \
373 @loader_path/../libsmime3.dylib \
374 -change @executable_path/libsoftokn3.dylib \
375 @loader_path/../libsoftokn3.dylib \
376 -change @executable_path/libssl3.dylib @loader_path/../libssl3.dylib \
377 -change @executable_path/libxpcom.dylib @loader_path/../libxpcom.dylib \
378 -change @executable_path/libxpcom_compat.dylib \
379 @loader_path/../libxpcom_compat.dylib \
380 $(file) &&) true
381 .ENDIF
383 # zip runtime files to mozruntime.zip
384 cd $(RUNTIME_DIR) && zip -r ..$/..$/bin$/mozruntime.zip *
386 $(TOUCH) $@
388 $(INCCOM)$/nsBuildID.h: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
389 @-echo "You can delete $(INCCOM) to force it copy all include files again."
392 $(MISC)$/build$/so_moz_include_files: $(INCCOM)$/nsBuildID.h
393 .IF "$(USE_SHELL)"=="4nt"
394 $(COPY) /QSZ $(INCLUDE_PATH)* $(INCLUDE_DIR)
395 $(COPY) /QSZ $(PUBLIC_PATH)* $(INCLUDE_DIR)
396 .ELSE
397 .IF "$(OS)"!="SOLARIS"
398 $(GNUCOPY) -pRL $(INCLUDE_PATH)* $(INCLUDE_DIR)
399 $(GNUCOPY) -pRL $(PUBLIC_PATH)* $(INCLUDE_DIR)
400 .ELSE # "$(OS)"!="SOLARIS"
401 $(COPY) -pr $(INCLUDE_PATH)* $(INCLUDE_DIR)
402 $(COPY) -pr $(PUBLIC_PATH)* $(INCLUDE_DIR)
403 .ENDIF # "$(OS)"!="SOLARIS"
404 .ENDIF
406 .IF "$(GUI)"=="UNX"
407 chmod -R 775 $(INCCOM)
408 .ENDIF
409 $(TOUCH) $@
410 .IF "$(ENABLE_NSS_MODULE)"=="YES"
411 +$(foreach,dir,$(NSS_INCLUDE_LIST) $(RENAME:s/+//) $(INCLUDE_DIR)$/$(dir) \
412 $(INCLUDE_DIR)$/$(dir)_remove_me &&) \
413 echo >& $(NULLDEV)
414 $(foreach,dir,$(NSS_INCLUDE_LIST) rm -r -f $(INCLUDE_DIR)$/$(dir)_remove_me &&) \
415 echo >& $(NULLDEV)
416 .ENDIF
418 # On UNX the rules for so_moz_runtime_files copy files into the same directory
419 # used here (LIB_DIR), and on MACOSX all those files together need to be
420 # processed here, hence the dependency on so_moz_runtime_files:
421 $(MISC)$/build$/so_moz_lib_files: $(foreach,file,$(LIBLIST) $(LIB_DIR)$/$(file)) $(MISC)$/build$/so_moz_runtime_files
422 echo $(foreach,file,$(LIBLIST) $(MOZ_DIST_DIR)$/lib$/$(file))
423 $(foreach,file,$(LIBLIST) $(COPY) $(MOZ_DIST_DIR)$/lib$/$(file) \
424 $(LIB_DIR)$/$(file) &&) \
425 echo >& $(NULLDEV)
426 .IF "$(OS)"=="MACOSX"
427 $(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl extshl OOO \
428 $(LIB_DIR)$/*$(DLLPOST)
429 .ENDIF
430 .IF "$(GUI)"=="UNX"
431 chmod -R 775 $(LB)
432 .ENDIF
433 $(TOUCH) $@
435 $(BIN_RUNTIMELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
436 @$(COPY) $(MOZ_BIN_DIR)$/$(DLLPRE)$@$(DLLPOST) $(RUNTIME_DIR)$/$(DLLPRE)$@$(DLLPOST)
438 $(COMPONENT_RUNTIMELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
439 @$(COPY) $(MOZ_BIN_DIR)$/components$/$(DLLPRE)$@$(DLLPOST) $(RUNTIME_DIR)$/components$/$(DLLPRE)$@$(DLLPOST)
441 $(COMREGISTRY_FILELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
442 @$(COPY) $(MOZ_BIN_DIR)$/components$/$@ $(RUNTIME_DIR)$/components$/$@
444 $(DEFAULTS_RUNTIMELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
445 @$(COPY) $(MOZ_BIN_DIR)$/$@ $(RUNTIME_DIR)$/$@
447 RES_FILELIST: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
448 .IF "$(OS)"=="SOLARIS"
449 @$(COPY) $(MOZ_BIN_DIR)$/res$/charsetalias.properties $(RUNTIME_DIR)$/res$/charsetalias.properties
450 .ELSE
451 @echo No Res Files to copy.
452 .ENDIF
454 $(LIB_DIR)$/%: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
455 noop
457 $(MISC)$/CREATETARBALL: extract_mozab_files
458 @@-$(MKDIR) $(OUT)$/zipped
459 $(COPY) $(BIN)$/mozruntime.zip $(OUT)$/zipped$/$(MOZTARGET)runtime.zip
460 .IF "$(GUI)"=="UNX"
461 .IF "$(OS)"!="MACOSX"
462 cd $(LB) && strip *$(DLLPOST)
463 .ENDIF
464 .ENDIF
465 cd $(LB) && zip -r ..$/zipped$/$(MOZTARGET)lib.zip *
466 cd $(INCCOM) && zip -r ..$/zipped$/$(MOZTARGET)inc.zip *