1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: extractfiles.mk,v $
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
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
52 .ENDIF
#"$(CPU)" == "S"
54 .ELSE
# "$(OS)" == "SOLARIS"
56 .ENDIF
# "$(OS)" == "SOLARIS"
59 NSS_MODULE_RUNTIME_LIST
:= \
81 .ELSE
# "$(GUI)" == "WNT"
82 .IF
"$(OS)$(CPUNAME)" == "SOLARISSPARC"
83 FREEBL_LIB
=freebl_32fpu_3
84 .ELSE
# "$(OS)$(CPUNAME)" == "SOLARISSPARC"
86 .ENDIF
# "$(OS)$(CPUNAME)" == "SOLARISSPARC"
87 .ENDIF
# "$(GUI)" == "WNT"
102 .ENDIF
# "$(ENABLE_NSS_MODULE)"=="YES"
111 .ELSE
#"$(GUI)"=="WNT"
120 COMPONENT_RUNTIMELIST
= \
134 COMPONENT_RUNTIMELIST
+= \
137 .ELSE
#"$(GUI)"=="WNT"
138 COMPONENT_RUNTIMELIST
+= \
143 COMREGISTRY_FILELIST
= \
147 xpcom_components.xpt \
156 COMREGISTRY_FILELIST
+= xpcom_thread.xpt
157 .ELSE
#"$(GUI)"=="WNT"
158 COMREGISTRY_FILELIST
+= xpcom_threads.xpt
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 \
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
184 libxpcom_core.dll.a \
187 .ELSE
#"$(COM)"=="GCC"
197 .ENDIF
#"$(COM)"=="GCC"
199 .ELSE
#"$(GUI)"=="WNT"
205 libxpcom_core
$(DLLPOST
) \
207 libmsgbaseutil
$(DLLPOST
) \
208 libldap50
$(DLLPOST
) \
212 .ELSE
# .IF"$(ENABLE_NSS_MODULE)"=="YES"
223 libxpcom_core.dll.a \
246 .ELSE
#"$(GUI)"=="WNT"
253 libxpcom_core
$(DLLPOST
) \
255 libmsgbaseutil
$(DLLPOST
) \
256 libldap50
$(DLLPOST
) \
257 libsoftokn3
$(DLLPOST
) \
265 .ENDIF
# .IF "$(ENABLE_NSS_MODULE)"=="YES"
267 INCLUDE_PATH
=$(MOZ_DIST_DIR
)$/include$/
268 PUBLIC_PATH
=$(MOZ_DIST_DIR
)$/public
$/
273 .ELSE
#"$(GUI)"=="WNT"
277 # --- Targets ------------------------------------------------------
279 extract_mozab_files
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
) \
281 $(MISC
)$/build
$/so_moz_runtime_files \
282 $(MISC
)$/build
$/so_moz_include_files \
283 $(MISC
)$/build
$/so_moz_lib_files
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
296 $(OUT
)$/bin
$/mozruntime.zip
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
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
) &&) \
304 .IF
"$(GUI)" == "UNX"
305 $(foreach,file
,$(BIN_RUNTIMELIST
) $(COPY
) $(MOZ_BIN_DIR
)$/$(DLLPRE
)$(file
)$(DLLPOST
) \
306 $(LIB_DIR
)$/$(DLLPRE
)$(file
)$(DLLPOST
) &&) \
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
) &&) \
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
) &&) \
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
328 @echo No Res Files to copy.
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
) &&) \
336 # copy files in COMREGISTRY_FILELIST
337 $(foreach,file
,$(COMREGISTRY_FILELIST
) $(COPY
) $(MOZ_BIN_DIR
)$/components
$/$(file
) \
338 $(RUNTIME_DIR
)$/components
$/$(file
) &&) \
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
) &&) \
349 .IF
"$(OS)"!="MACOSX"
350 cd
$(RUNTIME_DIR
) && strip *$(DLLPOST
)
351 cd
$(RUNTIME_DIR
)$/components
&& strip *$(DLLPOST
)
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
)) \
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 \
383 # zip runtime files to mozruntime.zip
384 cd
$(RUNTIME_DIR
) && zip
-r ..
$/..
$/bin
$/mozruntime.zip
*
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
)
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"
407 chmod
-R
775 $(INCCOM
)
410 .IF
"$(ENABLE_NSS_MODULE)"=="YES"
411 +$(foreach,dir,$(NSS_INCLUDE_LIST
) $(RENAME
:s
/+//) $(INCLUDE_DIR
)$/$(dir) \
412 $(INCLUDE_DIR
)$/$(dir)_remove_me
&&) \
414 $(foreach,dir,$(NSS_INCLUDE_LIST
) rm -r
-f
$(INCLUDE_DIR
)$/$(dir)_remove_me
&&) \
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
) &&) \
426 .IF
"$(OS)"=="MACOSX"
427 $(PERL
) $(SOLARENV
)$/bin
$/macosx-change-install-names.pl extshl OOO \
428 $(LIB_DIR
)$/*$(DLLPOST
)
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
451 @echo No Res Files to copy.
454 $(LIB_DIR
)$/%: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
457 $(MISC
)$/CREATETARBALL
: extract_mozab_files
458 @@
-$(MKDIR
) $(OUT
)$/zipped
459 $(COPY
) $(BIN
)$/mozruntime.zip
$(OUT
)$/zipped
$/$(MOZTARGET
)runtime.zip
461 .IF
"$(OS)"!="MACOSX"
462 cd
$(LB
) && strip *$(DLLPOST
)
465 cd
$(LB
) && zip
-r ..
$/zipped
$/$(MOZTARGET
)lib.zip
*
466 cd
$(INCCOM
) && zip
-r ..
$/zipped
$/$(MOZTARGET
)inc.zip
*