1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
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.
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).
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.
26 #*************************************************************************
28 MOZTARGET
=$(OS
)$(COM
)$(CPU
)
29 MOZ_DIST_DIR
=$(MISC
)$/build
$/mozilla
$/$(BUILD_DIR
)$/dist
30 MOZ_BIN_DIR
=$(MOZ_DIST_DIR
)$/bin
31 RUNTIME_DIR
=$(MISC
)$/$(MOZTARGET
)runtime
37 #If we build the NSS module then we do not need the old nss libs from here
38 .IF
"$(SYSTEM_NSS)"=="NO"
41 .IF
"$(OS)" == "SOLARIS"
42 .IF
"$(CPU)" == "S" #32bit
43 FREEBL_LIB
=freebl_32fpu_3 freebl_32int64_3 freebl_32int_3
44 .ELIF
"$(CPU)" == "U" #64bit unxsolu4
45 FREEBL_LIB
=freebl_64int_3 freebl_64fpu_3
48 .ENDIF
#"$(CPU)" == "S"
50 .ELSE
# "$(OS)" == "SOLARIS"
52 .ENDIF
# "$(OS)" == "SOLARIS"
55 NSS_MODULE_RUNTIME_LIST
:= \
77 .ELSE
# "$(GUI)" == "WNT"
78 .IF
"$(OS)$(CPUNAME)" == "SOLARISSPARC"
79 FREEBL_LIB
=freebl_32fpu_3
80 .ELSE
# "$(OS)$(CPUNAME)" == "SOLARISSPARC"
82 .ENDIF
# "$(OS)$(CPUNAME)" == "SOLARISSPARC"
83 .ENDIF
# "$(GUI)" == "WNT"
98 .ENDIF
# "$(SYSTEM_NSS)"=="NO"
107 .ELSE
#"$(GUI)"=="WNT"
116 COMPONENT_RUNTIMELIST
= \
130 COMPONENT_RUNTIMELIST
+= \
133 .ELSE
#"$(GUI)"=="WNT"
134 COMPONENT_RUNTIMELIST
+= \
139 COMREGISTRY_FILELIST
= \
143 xpcom_components.xpt \
152 COMREGISTRY_FILELIST
+= xpcom_thread.xpt
153 .ELSE
#"$(GUI)"=="WNT"
154 COMREGISTRY_FILELIST
+= xpcom_threads.xpt
157 DEFAULTS_RUNTIMELIST
= \
158 defaults
$/pref
$/browser-prefs.js \
159 defaults
$/pref
$/mailnews.js \
160 defaults
$/pref
$/mdn.js \
161 defaults
$/pref
$/smime.js \
162 defaults
$/autoconfig
$/platform.js \
163 defaults
$/autoconfig
$/prefcalls.js \
165 greprefs
$/security-prefs.js
167 .IF
"$(SYSTEM_NSS)"=="NO"
168 #These headers come from the separate NSS module if enabled
180 libxpcom_core.dll.a \
183 .ELSE
#"$(COM)"=="GCC"
193 .ENDIF
#"$(COM)"=="GCC"
195 .ELSE
#"$(GUI)"=="WNT"
201 libxpcom_core
$(DLLPOST
) \
203 libmsgbaseutil
$(DLLPOST
) \
204 libldap50
$(DLLPOST
) \
208 .ELSE
# .IF"$(SYSTEM_NSS)"=="NO"
219 libxpcom_core.dll.a \
242 .ELSE
#"$(GUI)"=="WNT"
249 libxpcom_core
$(DLLPOST
) \
251 libmsgbaseutil
$(DLLPOST
) \
252 libldap50
$(DLLPOST
) \
253 libsoftokn3
$(DLLPOST
) \
261 .ENDIF
# .IF "$(SYSTEM_NSS)"=="NO"
263 INCLUDE_PATH
=$(MOZ_DIST_DIR
)$/include$/
264 PUBLIC_PATH
=$(MOZ_DIST_DIR
)$/public
$/
269 .ELSE
#"$(GUI)"=="WNT"
273 # --- Targets ------------------------------------------------------
275 extract_mozab_files
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
) \
277 $(MISC
)$/build
$/so_moz_runtime_files \
278 $(MISC
)$/build
$/so_moz_include_files \
279 $(MISC
)$/build
$/so_moz_lib_files
282 @@
-$(MKDIRHIER
) $(RUNTIME_DIR
)
283 @@
-$(MKDIRHIER
) $(RUNTIME_DIR
)$/components
284 @@
-$(MKDIRHIER
) $(RUNTIME_DIR
)$/defaults
285 @@
-$(MKDIRHIER
) $(RUNTIME_DIR
)$/defaults
$/pref
286 @@
-$(MKDIRHIER
) $(LIB_DIR
)
287 @@
-$(MKDIRHIER
) $(INCLUDE_DIR
)
288 .IF
"$(OS)"=="SOLARIS"
289 @@
-$(MKDIRHIER
) $(RUNTIME_DIR
)$/res
292 $(OUT
)$/bin
$/mozruntime.zip
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
295 $(MISC
)$/build
$/so_moz_runtime_files
: $(OUT
)$/bin
$/mozruntime.zip
296 # copy files in BIN_RUNTIMELIST
297 $(foreach,file
,$(BIN_RUNTIMELIST
) $(COPY
) $(MOZ_BIN_DIR
)$/$(DLLPRE
)$(file
)$(DLLPOST
) \
298 $(RUNTIME_DIR
)$/$(DLLPRE
)$(file
)$(DLLPOST
) &&) \
300 .IF
"$(GUI)" == "UNX"
301 $(foreach,file
,$(BIN_RUNTIMELIST
) $(COPY
) $(MOZ_BIN_DIR
)$/$(DLLPRE
)$(file
)$(DLLPOST
) \
302 $(LIB_DIR
)$/$(DLLPRE
)$(file
)$(DLLPOST
) &&) \
304 .IF
"$(SYSTEM_NSS)" == "NO"
305 # We add the libraries from the separate nss module
306 $(foreach,file
,$(NSS_MODULE_RUNTIME_LIST
) $(COPY
) $(SOLARLIBDIR
)$/$(file
:d
:d
)/$(DLLPRE
)$(file
:f
)$(DLLPOST
) \
307 $(RUNTIME_DIR
)$/$(DLLPRE
)$(file
:f
)$(DLLPOST
) &&) \
310 .ELSE
# .IF "$(GUI)" == "UNX"
311 .IF
"$(SYSTEM_NSS)" == "NO"
312 # We add the libraries from the separate nss module
313 $(foreach,file
,$(NSS_MODULE_RUNTIME_LIST
) $(COPY
) $(SOLARBINDIR
)$/$(DLLPRE
)$(file
)$(DLLPOST
) \
314 $(RUNTIME_DIR
)$/$(DLLPRE
)$(file
)$(DLLPOST
) &&) \
317 .ENDIF
# .IF "$(GUI)" == "UNX"
320 # copy files in RES_FILELIST
321 .IF
"$(OS)"=="SOLARIS"
322 @
$(COPY
) $(MOZ_BIN_DIR
)$/res
$/charsetalias.properties
$(RUNTIME_DIR
)$/res
$/charsetalias.properties
324 @echo No Res Files to copy.
327 # copy files in COMPONENT_RUNTIMELIST
328 $(foreach,file
,$(COMPONENT_RUNTIMELIST
) $(COPY
) $(MOZ_BIN_DIR
)$/components
$/$(DLLPRE
)$(file
)$(DLLPOST
) \
329 $(RUNTIME_DIR
)$/components
$/$(DLLPRE
)$(file
)$(DLLPOST
) &&) \
332 # copy files in COMREGISTRY_FILELIST
333 $(foreach,file
,$(COMREGISTRY_FILELIST
) $(COPY
) $(MOZ_BIN_DIR
)$/components
$/$(file
) \
334 $(RUNTIME_DIR
)$/components
$/$(file
) &&) \
337 # copy files in DEFAULTS_RUNTIMELIST
338 @@
-$(MKDIR
) $(RUNTIME_DIR
)$/defaults
$/pref
339 @@
-$(MKDIR
) $(RUNTIME_DIR
)$/defaults
$/autoconfig
340 @@
-$(MKDIR
) $(RUNTIME_DIR
)$/greprefs
341 $(foreach,file
,$(DEFAULTS_RUNTIMELIST
) $(COPY
) $(MOZ_BIN_DIR
)$/$(file
) $(RUNTIME_DIR
)$/$(file
) &&) \
345 .IF
"$(OS)"!="MACOSX" && "$(OS)"!="AIX"
346 cd
$(RUNTIME_DIR
) && strip *$(DLLPOST
)
347 cd
$(RUNTIME_DIR
)$/components
&& strip *$(DLLPOST
)
350 .IF
"$(OS)"=="MACOSX"
351 $(PERL
) $(SOLARENV
)$/bin
$/macosx-change-install-names.pl extshl OOO \
352 $(RUNTIME_DIR
)$/*$(DLLPOST
)
353 # A crude hack to adapt all the absolute ("@executable_path") dependencies to
354 # relative ("@loader_path") ones:
355 $(foreach,file
,$(shell ls
$(RUNTIME_DIR
)$/components
$/*$(DLLPOST
)) \
357 -change @executable_path
/libnspr4.dylib @loader_path
/libnspr4.dylib \
358 -change @executable_path
/libplc4.dylib @loader_path
/libplc4.dylib \
359 -change @executable_path
/libplds4.dylib @loader_path
/libplds4.dylib \
361 $(foreach,file
,$(shell ls
$(RUNTIME_DIR
)$/components
$/*$(DLLPOST
)) \
363 -change @executable_path
/libldap50.dylib \
364 @loader_path
/..
/libldap50.dylib \
365 -change @executable_path
/libmozjs.dylib @loader_path
/..
/libmozjs.dylib \
366 -change @executable_path
/libmozz.dylib @loader_path
/..
/libmozz.dylib \
367 -change @executable_path
/libmsgbaseutil.dylib \
368 @loader_path
/..
/libmsgbaseutil.dylib \
369 -change @executable_path
/libnspr4.dylib @loader_path
/..
/libnspr4.dylib \
370 -change @executable_path
/libnss3.dylib @loader_path
/..
/libnss3.dylib \
371 -change @executable_path
/libplc4.dylib @loader_path
/..
/libplc4.dylib \
372 -change @executable_path
/libplds4.dylib @loader_path
/..
/libplds4.dylib \
373 -change @executable_path
/libprldap50.dylib \
374 @loader_path
/..
/libprldap50.dylib \
375 -change @executable_path
/libsmime3.dylib \
376 @loader_path
/..
/libsmime3.dylib \
377 -change @executable_path
/libsoftokn3.dylib \
378 @loader_path
/..
/libsoftokn3.dylib \
379 -change @executable_path
/libssl3.dylib @loader_path
/..
/libssl3.dylib \
380 -change @executable_path
/libxpcom.dylib @loader_path
/..
/libxpcom.dylib \
381 -change @executable_path
/libxpcom_compat.dylib \
382 @loader_path
/..
/libxpcom_compat.dylib \
383 -change @executable_path
/libxpcom_core.dylib \
384 @loader_path
/..
/libxpcom_core.dylib \
388 # zip runtime files to mozruntime.zip
389 cd
$(RUNTIME_DIR
) && zip
-r ..
$/..
$/bin
$/mozruntime.zip
*
393 $(INCCOM
)$/nsBuildID.h
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
394 @
-echo
"You can delete $(INCCOM) to force it copy all include files again."
397 $(MISC
)$/build
$/so_moz_include_files
: $(INCCOM
)$/nsBuildID.h
398 .IF
"$(OS)"!="SOLARIS"
399 $(GNUCOPY
) -pRL
$(INCLUDE_PATH
)* $(INCLUDE_DIR
)
400 $(GNUCOPY
) -pRL
$(PUBLIC_PATH
)* $(INCLUDE_DIR
)
401 .ELSE
# "$(OS)"!="SOLARIS"
402 $(COPY
) -pr
$(INCLUDE_PATH
)* $(INCLUDE_DIR
)
403 $(COPY
) -pr
$(PUBLIC_PATH
)* $(INCLUDE_DIR
)
404 .ENDIF
# "$(OS)"!="SOLARIS"
407 chmod
-R
775 $(INCCOM
)
410 .IF
"$(SYSTEM_NSS)"=="NO"
411 +$(foreach,dir,$(NSS_INCLUDE_LIST
) $(RENAME
:s
/+//) $(INCLUDE_DIR
)$/$(dir) $(INCLUDE_DIR
)$/$(dir)_remove_me
&&) echo
>& $(NULLDEV
)
412 $(foreach,dir,$(NSS_INCLUDE_LIST
) rm -rf
$(INCLUDE_DIR
)$/$(dir)_remove_me
&&) echo
>& $(NULLDEV
)
413 -$(MKDIR
) $(OUT
)$/inc.nss
414 cd
$(OUT
)$/inc.nss
&& $(foreach,dir,$(NSS_INCLUDE_LIST
) $(GNUCOPY
) -pRL
$(SOLARINCDIR
)$/mozilla
/$(dir) .
&&) echo
>& $(NULLDEV
)
417 # On UNX the rules for so_moz_runtime_files copy files into the same directory
418 # used here (LIB_DIR), and on MACOSX all those files together need to be
419 # processed here, hence the dependency on so_moz_runtime_files:
420 $(MISC
)$/build
$/so_moz_lib_files
: $(foreach,file
,$(LIBLIST
) $(LIB_DIR
)$/$(file
)) $(MISC
)$/build
$/so_moz_runtime_files
421 echo
$(foreach,file
,$(LIBLIST
) $(MOZ_DIST_DIR
)$/lib
$/$(file
))
422 $(foreach,file
,$(LIBLIST
) $(COPY
) $(MOZ_DIST_DIR
)$/lib
$/$(file
) \
423 $(LIB_DIR
)$/$(file
) &&) \
425 .IF
"$(OS)"=="MACOSX"
426 $(PERL
) $(SOLARENV
)$/bin
$/macosx-change-install-names.pl extshl OOO \
427 $(LIB_DIR
)$/*$(DLLPOST
)
434 $(BIN_RUNTIMELIST
): $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
435 @
$(COPY
) $(MOZ_BIN_DIR
)$/$(DLLPRE
)$@
$(DLLPOST
) $(RUNTIME_DIR
)$/$(DLLPRE
)$@
$(DLLPOST
)
437 $(COMPONENT_RUNTIMELIST
): $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
438 @
$(COPY
) $(MOZ_BIN_DIR
)$/components
$/$(DLLPRE
)$@
$(DLLPOST
) $(RUNTIME_DIR
)$/components
$/$(DLLPRE
)$@
$(DLLPOST
)
440 $(COMREGISTRY_FILELIST
): $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
441 @
$(COPY
) $(MOZ_BIN_DIR
)$/components
$/$@
$(RUNTIME_DIR
)$/components
$/$@
443 $(DEFAULTS_RUNTIMELIST
): $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
444 @
$(COPY
) $(MOZ_BIN_DIR
)$/$@
$(RUNTIME_DIR
)$/$@
446 RES_FILELIST
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
447 .IF
"$(OS)"=="SOLARIS"
448 @
$(COPY
) $(MOZ_BIN_DIR
)$/res
$/charsetalias.properties
$(RUNTIME_DIR
)$/res
$/charsetalias.properties
450 @echo No Res Files to copy.
453 $(LIB_DIR
)$/%: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
456 $(MISC
)$/CREATETARBALL
: extract_mozab_files
457 @@
-$(MKDIR
) $(OUT
)$/zipped
458 $(COPY
) $(BIN
)$/mozruntime.zip
$(OUT
)$/zipped
$/$(MOZTARGET
)runtime.zip
460 .IF
"$(OS)"!="MACOSX"
461 cd
$(LB
) && strip *$(DLLPOST
)
464 cd
$(LB
) && zip
-r ..
$/zipped
$/$(MOZTARGET
)lib.zip
*
465 cd
$(INCCOM
) && zip
-r ..
$/zipped
$/$(MOZTARGET
)inc.zip
*
466 .IF
"$(SYSTEM_NSS)"=="NO"
467 cd
$(OUT
)$/inc.nss
&& zip
-r ..
$/zipped
$/$(MOZTARGET
)inc.zip
*