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
"$(ENABLE_NSS_MODULE)"=="YES"
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
# "$(ENABLE_NSS_MODULE)"=="YES"
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
"$(ENABLE_NSS_MODULE)"=="YES"
168 #These headers come from the separate NSS module if enabled
169 NSS_INCLUDE_LIST
= nspr nss
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"$(ENABLE_NSS_MODULE)"=="YES"
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 "$(ENABLE_NSS_MODULE)"=="YES"
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 @@
-$(MKDIR
) $(RUNTIME_DIR
)
283 @@
-$(MKDIR
) $(RUNTIME_DIR
)$/components
284 @@
-$(MKDIR
) $(RUNTIME_DIR
)$/defaults
285 @@
-$(MKDIR
) $(RUNTIME_DIR
)$/defaults
$/pref
286 @@
-$(MKDIR
) $(LIB_DIR
)
287 @@
-$(MKDIR
) $(INCLUDE_DIR
)
288 .IF
"$(OS)"=="SOLARIS"
289 @@
-$(MKDIR
) $(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
"$(ENABLE_NSS_MODULE)" == "YES"
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
"$(ENABLE_NSS_MODULE)" == "YES"
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"
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 install names in the components subdir:
354 $(foreach,file
,$(shell ls
$(RUNTIME_DIR
)$/components
$/*$(DLLPOST
)) \
356 -change @executable_path
/libldap50.dylib \
357 @loader_path
/..
/libldap50.dylib \
358 -change @executable_path
/libmozjs.dylib @loader_path
/..
/libmozjs.dylib \
359 -change @executable_path
/libmozz.dylib @loader_path
/..
/libmozz.dylib \
360 -change @executable_path
/libmsgbaseutil.dylib \
361 @loader_path
/..
/libmsgbaseutil.dylib \
362 -change @executable_path
/libnspr4.dylib @loader_path
/..
/libnspr4.dylib \
363 -change @executable_path
/libnss3.dylib @loader_path
/..
/libnss3.dylib \
364 -change @executable_path
/libplc4.dylib @loader_path
/..
/libplc4.dylib \
365 -change @executable_path
/libplds4.dylib @loader_path
/..
/libplds4.dylib \
366 -change @executable_path
/libprldap50.dylib \
367 @loader_path
/..
/libprldap50.dylib \
368 -change @executable_path
/libsmime3.dylib \
369 @loader_path
/..
/libsmime3.dylib \
370 -change @executable_path
/libsoftokn3.dylib \
371 @loader_path
/..
/libsoftokn3.dylib \
372 -change @executable_path
/libssl3.dylib @loader_path
/..
/libssl3.dylib \
373 -change @executable_path
/libxpcom.dylib @loader_path
/..
/libxpcom.dylib \
374 -change @executable_path
/libxpcom_compat.dylib \
375 @loader_path
/..
/libxpcom_compat.dylib \
379 # zip runtime files to mozruntime.zip
380 cd
$(RUNTIME_DIR
) && zip
-r ..
$/..
$/bin
$/mozruntime.zip
*
384 $(INCCOM
)$/nsBuildID.h
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
385 @
-echo
"You can delete $(INCCOM) to force it copy all include files again."
388 $(MISC
)$/build
$/so_moz_include_files
: $(INCCOM
)$/nsBuildID.h
389 .IF
"$(OS)"!="SOLARIS"
390 $(GNUCOPY
) -pRL
$(INCLUDE_PATH
)* $(INCLUDE_DIR
)
391 $(GNUCOPY
) -pRL
$(PUBLIC_PATH
)* $(INCLUDE_DIR
)
392 .ELSE
# "$(OS)"!="SOLARIS"
393 $(COPY
) -pr
$(INCLUDE_PATH
)* $(INCLUDE_DIR
)
394 $(COPY
) -pr
$(PUBLIC_PATH
)* $(INCLUDE_DIR
)
395 .ENDIF
# "$(OS)"!="SOLARIS"
398 chmod
-R
775 $(INCCOM
)
401 .IF
"$(ENABLE_NSS_MODULE)"=="YES"
402 +$(foreach,dir,$(NSS_INCLUDE_LIST
) $(RENAME
:s
/+//) $(INCLUDE_DIR
)$/$(dir) $(INCLUDE_DIR
)$/$(dir)_remove_me
&&) echo
>& $(NULLDEV
)
403 $(foreach,dir,$(NSS_INCLUDE_LIST
) rm -rf
$(INCLUDE_DIR
)$/$(dir)_remove_me
&&) echo
>& $(NULLDEV
)
404 -$(MKDIR
) $(OUT
)$/inc.nss
405 cd
$(OUT
)$/inc.nss
&& $(foreach,dir,$(NSS_INCLUDE_LIST
) $(GNUCOPY
) -pRL
$(SOLARINCDIR
)$/mozilla
/$(dir) .
&&) echo
>& $(NULLDEV
)
408 # On UNX the rules for so_moz_runtime_files copy files into the same directory
409 # used here (LIB_DIR), and on MACOSX all those files together need to be
410 # processed here, hence the dependency on so_moz_runtime_files:
411 $(MISC
)$/build
$/so_moz_lib_files
: $(foreach,file
,$(LIBLIST
) $(LIB_DIR
)$/$(file
)) $(MISC
)$/build
$/so_moz_runtime_files
412 echo
$(foreach,file
,$(LIBLIST
) $(MOZ_DIST_DIR
)$/lib
$/$(file
))
413 $(foreach,file
,$(LIBLIST
) $(COPY
) $(MOZ_DIST_DIR
)$/lib
$/$(file
) \
414 $(LIB_DIR
)$/$(file
) &&) \
416 .IF
"$(OS)"=="MACOSX"
417 $(PERL
) $(SOLARENV
)$/bin
$/macosx-change-install-names.pl extshl OOO \
418 $(LIB_DIR
)$/*$(DLLPOST
)
425 $(BIN_RUNTIMELIST
): $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
426 @
$(COPY
) $(MOZ_BIN_DIR
)$/$(DLLPRE
)$@
$(DLLPOST
) $(RUNTIME_DIR
)$/$(DLLPRE
)$@
$(DLLPOST
)
428 $(COMPONENT_RUNTIMELIST
): $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
429 @
$(COPY
) $(MOZ_BIN_DIR
)$/components
$/$(DLLPRE
)$@
$(DLLPOST
) $(RUNTIME_DIR
)$/components
$/$(DLLPRE
)$@
$(DLLPOST
)
431 $(COMREGISTRY_FILELIST
): $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
432 @
$(COPY
) $(MOZ_BIN_DIR
)$/components
$/$@
$(RUNTIME_DIR
)$/components
$/$@
434 $(DEFAULTS_RUNTIMELIST
): $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
435 @
$(COPY
) $(MOZ_BIN_DIR
)$/$@
$(RUNTIME_DIR
)$/$@
437 RES_FILELIST
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
438 .IF
"$(OS)"=="SOLARIS"
439 @
$(COPY
) $(MOZ_BIN_DIR
)$/res
$/charsetalias.properties
$(RUNTIME_DIR
)$/res
$/charsetalias.properties
441 @echo No Res Files to copy.
444 $(LIB_DIR
)$/%: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
447 $(MISC
)$/CREATETARBALL
: extract_mozab_files
448 @@
-$(MKDIR
) $(OUT
)$/zipped
449 $(COPY
) $(BIN
)$/mozruntime.zip
$(OUT
)$/zipped
$/$(MOZTARGET
)runtime.zip
451 .IF
"$(OS)"!="MACOSX"
452 cd
$(LB
) && strip *$(DLLPOST
)
455 cd
$(LB
) && zip
-r ..
$/zipped
$/$(MOZTARGET
)lib.zip
*
456 cd
$(INCCOM
) && zip
-r ..
$/zipped
$/$(MOZTARGET
)inc.zip
*
457 .IF
"$(ENABLE_NSS_MODULE)"=="YES"
458 cd
$(OUT
)$/inc.nss
&& zip
-r ..
$/zipped
$/$(MOZTARGET
)inc.zip
*