fix toolbar import
[ooovba.git] / moz / extractfiles.mk
blob241b8ac25b7e6bb0ab5a3866e683a65900a32f3f
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$/dist
34 MOZ_BIN_DIR=$(MOZ_DIST_DIR)$/bin
35 RUNTIME_DIR=$(MISC)$/$(MOZTARGET)runtime
36 LIB_DIR=$(LB)
37 INCLUDE_DIR=$(INCCOM)
39 BIN_RUNTIMELIST= \
40 nspr4 \
41 plc4 \
42 plds4 \
43 xpcom \
44 xpcom_core \
45 xpcom_compat \
46 nss3 \
47 ssl3 \
48 softokn3 \
49 smime3
51 .IF "$(GUI)"=="WNT"
52 BIN_RUNTIMELIST+= \
53 js3250 \
54 mozz \
55 msgbsutl \
56 nsldap32v50 \
57 nsldappr32v50
58 .ELSE #"$(GUI)"=="WNT"
59 BIN_RUNTIMELIST+= \
60 mozjs \
61 mozz \
62 msgbaseutil \
63 ldap50 \
64 prldap50
65 .ENDIF
67 COMPONENT_RUNTIMELIST= \
68 addrbook \
69 mork \
70 mozldap \
71 necko \
72 profile \
73 xpcom_compat_c \
74 rdf \
75 uconv \
76 vcard \
77 i18n \
78 pipnss
80 .IF "$(GUI)"=="WNT"
81 COMPONENT_RUNTIMELIST+= \
82 xppref32 \
83 xpc3250
84 .ELSE #"$(GUI)"=="WNT"
85 COMPONENT_RUNTIMELIST+= \
86 pref \
87 xpconnect
88 .ENDIF
90 COMREGISTRY_FILELIST= \
91 necko_dns.xpt \
92 xpcom_base.xpt \
93 xpcom_obsolete.xpt \
94 xpcom_components.xpt \
95 xpcom_ds.xpt \
96 xpcom_io.xpt \
97 xpcom_xpti.xpt \
98 addrbook.xpt \
99 mozldap.xpt \
100 pref.xpt
102 .IF "$(GUI)"=="WNT"
103 COMREGISTRY_FILELIST+= xpcom_thread.xpt
104 .ELSE #"$(GUI)"=="WNT"
105 COMREGISTRY_FILELIST+= xpcom_threads.xpt
106 .ENDIF
108 DEFAULTS_RUNTIMELIST= \
109 defaults$/pref$/browser-prefs.js \
110 defaults$/pref$/mailnews.js \
111 defaults$/pref$/mdn.js \
112 defaults$/pref$/smime.js \
113 defaults$/autoconfig$/platform.js \
114 defaults$/autoconfig$/prefcalls.js \
115 greprefs$/all.js \
116 greprefs$/security-prefs.js
118 .IF "$(GUI)"=="WNT"
119 .IF "$(COM)"=="GCC"
120 LIBLIST= \
121 libembed_base_s.a \
122 libmozreg_s.a \
123 libnslber32v50.a \
124 libnsldap32v50.a \
125 libnspr4.a \
126 libxpcom_core.dll.a \
127 libxpcom.dll.a \
128 libnss3.a \
129 libsmime3.a
130 .ELSE
131 LIBLIST= \
132 embed_base_s.lib \
133 mozreg_s.lib \
134 nslber32v50.lib \
135 nsldap32v50.lib \
136 nspr4.lib \
137 xpcom_core.lib \
138 xpcom.lib \
139 plc4.lib \
140 plds4.lib \
141 nss3.lib \
142 ssl3.lib \
143 smime3.lib
144 .ENDIF
145 .ELSE #"$(GUI)"=="WNT"
146 LIBLIST= \
147 libembed_base_s.a \
148 libmozreg_s.a \
149 liblber50.a \
150 libnspr4$(DLLPOST) \
151 libxpcom_core$(DLLPOST) \
152 libxpcom$(DLLPOST) \
153 libmsgbaseutil$(DLLPOST) \
154 libldap50$(DLLPOST) \
155 libsoftokn3$(DLLPOST) \
156 libplc4$(DLLPOST) \
157 libplds4$(DLLPOST) \
158 libnss3$(DLLPOST) \
159 libssl3$(DLLPOST) \
160 libsmime3$(DLLPOST)
161 .ENDIF
163 INCLUDE_PATH=$(MOZ_DIST_DIR)$/include$/
164 PUBLIC_PATH=$(MOZ_DIST_DIR)$/public$/
167 .IF "$(GUI)"=="WNT"
168 REG_SUBFIX= .exe
169 .ELSE #"$(GUI)"=="WNT"
170 REG_SUBFIX=
171 .ENDIF
173 # --- Targets ------------------------------------------------------
175 extract_mozab_files: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) \
176 make_temp_dir \
177 $(MISC)$/build$/so_moz_runtime_files \
178 $(MISC)$/build$/so_moz_include_files \
179 $(MISC)$/build$/so_moz_lib_files
181 make_temp_dir:
182 @@-$(MKDIR) $(RUNTIME_DIR)
183 @@-$(MKDIR) $(RUNTIME_DIR)$/components
184 @@-$(MKDIR) $(RUNTIME_DIR)$/defaults
185 @@-$(MKDIR) $(RUNTIME_DIR)$/defaults$/pref
186 @@-$(MKDIR) $(LIB_DIR)
187 @@-$(MKDIR) $(INCLUDE_DIR)
188 .IF "$(OS)"=="SOLARIS"
189 @@-$(MKDIR) $(RUNTIME_DIR)$/res
190 .ENDIF
192 $(OUT)$/bin$/mozruntime.zip: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
193 noop
195 $(MISC)$/build$/so_moz_runtime_files: $(OUT)$/bin$/mozruntime.zip
196 # copy files in BIN_RUNTIMELIST
197 $(foreach,file,$(BIN_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/$(DLLPRE)$(file)$(DLLPOST) \
198 $(RUNTIME_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \
199 echo >& $(NULLDEV)
200 .IF "$(GUI)" == "UNX"
201 $(foreach,file,$(BIN_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/$(DLLPRE)$(file)$(DLLPOST) \
202 $(LIB_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \
203 echo >& $(NULLDEV)
204 .ENDIF
206 # copy files in RES_FILELIST
207 .IF "$(OS)"=="SOLARIS"
208 @$(COPY) $(MOZ_BIN_DIR)$/res$/charsetalias.properties $(RUNTIME_DIR)$/res$/charsetalias.properties
209 .ELSE
210 @echo No Res Files to copy.
211 .ENDIF
213 # copy files in COMPONENT_RUNTIMELIST
214 $(foreach,file,$(COMPONENT_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/components$/$(DLLPRE)$(file)$(DLLPOST) \
215 $(RUNTIME_DIR)$/components$/$(DLLPRE)$(file)$(DLLPOST) &&) \
216 echo >& $(NULLDEV)
218 # copy files in COMREGISTRY_FILELIST
219 $(foreach,file,$(COMREGISTRY_FILELIST) $(COPY) $(MOZ_BIN_DIR)$/components$/$(file) \
220 $(RUNTIME_DIR)$/components$/$(file) &&) \
221 echo >& $(NULLDEV)
223 # copy files in DEFAULTS_RUNTIMELIST
224 @@-$(MKDIR) $(RUNTIME_DIR)$/defaults$/pref
225 @@-$(MKDIR) $(RUNTIME_DIR)$/defaults$/autoconfig
226 @@-$(MKDIR) $(RUNTIME_DIR)$/greprefs
227 $(foreach,file,$(DEFAULTS_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/$(file) $(RUNTIME_DIR)$/$(file) &&) \
228 echo >& $(NULLDEV)
229 # copy regxpcom
230 @$(COPY) $(MOZ_BIN_DIR)$/regxpcom$(REG_SUBFIX) $(RUNTIME_DIR)$/regxpcom$(REG_SUBFIX)
232 .IF "$(GUI)"=="UNX"
233 .IF "$(OS)"!="MACOSX"
234 cd $(RUNTIME_DIR) && strip *$(DLLPOST)
235 cd $(RUNTIME_DIR)$/components && strip *$(DLLPOST)
236 .ENDIF
237 .ENDIF
238 .IF "$(OS)"=="MACOSX"
239 $(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl extshl OOO \
240 $(RUNTIME_DIR)$/*$(DLLPOST)
241 # A crude hack to adapt all the install names in the components subdir:
242 $(foreach,file,$(shell ls $(RUNTIME_DIR)$/components$/*$(DLLPOST)) \
243 install_name_tool \
244 -change @executable_path/libldap50.dylib \
245 @loader_path/../libldap50.dylib \
246 -change @executable_path/libmozjs.dylib @loader_path/../libmozjs.dylib \
247 -change @executable_path/libmozz.dylib @loader_path/../libmozz.dylib \
248 -change @executable_path/libmsgbaseutil.dylib \
249 @loader_path/../libmsgbaseutil.dylib \
250 -change @executable_path/libnspr4.dylib @loader_path/../libnspr4.dylib \
251 -change @executable_path/libnss3.dylib @loader_path/../libnss3.dylib \
252 -change @executable_path/libplc4.dylib @loader_path/../libplc4.dylib \
253 -change @executable_path/libplds4.dylib @loader_path/../libplds4.dylib \
254 -change @executable_path/libprldap50.dylib \
255 @loader_path/../libprldap50.dylib \
256 -change @executable_path/libsmime3.dylib \
257 @loader_path/../libsmime3.dylib \
258 -change @executable_path/libsoftokn3.dylib \
259 @loader_path/../libsoftokn3.dylib \
260 -change @executable_path/libssl3.dylib @loader_path/../libssl3.dylib \
261 -change @executable_path/libxpcom.dylib @loader_path/../libxpcom.dylib \
262 -change @executable_path/libxpcom_compat.dylib \
263 @loader_path/../libxpcom_compat.dylib \
264 $(file) &&) true
265 .ENDIF
267 # zip runtime files to mozruntime.zip
268 .IF "$(OS)"=="MACOSX" || "$(OS)"=="LINUX"
269 cd $(RUNTIME_DIR) && sh ..$/..$/..$/$(MOZ_BIN_DIR)$/run-mozilla.sh .$/regxpcom$(REG_SUBFIX)
270 .ELSE
271 .IF "$(OS)"!="WNT"
272 cd $(RUNTIME_DIR) && .$/regxpcom$(REG_SUBFIX)
273 $(COPY) $(RUNTIME_DIR)$/components$/xpti.dat $(RUNTIME_DIR)$/components$/xptitemp.dat
274 .ENDIF
275 .ENDIF
276 $(RM) $(RUNTIME_DIR)$/regxpcom$(REG_SUBFIX)
277 cd $(RUNTIME_DIR) && zip -r ..$/..$/bin$/mozruntime.zip *
279 $(TOUCH) $@
281 $(INCCOM)$/nsBuildID.h: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
282 @-echo "You can delete $(INCCOM) to force it copy all include files again."
284 $(MISC)$/build$/so_moz_include_files: $(INCCOM)$/nsBuildID.h
285 .IF "$(USE_SHELL)"=="4nt"
286 $(COPY) /QSZ $(INCLUDE_PATH)* $(INCLUDE_DIR)
287 $(COPY) /QSZ $(PUBLIC_PATH)* $(INCLUDE_DIR)
288 .ELSE
289 .IF "$(OS)"!="SOLARIS"
290 $(GNUCOPY) -pRL $(INCLUDE_PATH)* $(INCLUDE_DIR)
291 $(GNUCOPY) -pRL $(PUBLIC_PATH)* $(INCLUDE_DIR)
292 .ELSE # "$(OS)"!="SOLARIS"
293 $(COPY) -pr $(INCLUDE_PATH)* $(INCLUDE_DIR)
294 $(COPY) -pr $(PUBLIC_PATH)* $(INCLUDE_DIR)
295 .ENDIF # "$(OS)"!="SOLARIS"
296 .ENDIF
298 .IF "$(GUI)"=="UNX"
299 chmod -R 775 $(INCCOM)
300 .ENDIF
301 $(TOUCH) $@
303 # On UNX the rules for so_moz_runtime_files copy files into the same directory
304 # used here (LIB_DIR), and on MACOSX all those files together need to be
305 # processed here, hence the dependency on so_moz_runtime_files:
306 $(MISC)$/build$/so_moz_lib_files: $(foreach,file,$(LIBLIST) $(LIB_DIR)$/$(file)) $(MISC)$/build$/so_moz_runtime_files
307 echo $(foreach,file,$(LIBLIST) $(MOZ_DIST_DIR)$/lib$/$(file))
308 $(foreach,file,$(LIBLIST) $(COPY) $(MOZ_DIST_DIR)$/lib$/$(file) \
309 $(LIB_DIR)$/$(file) &&) \
310 echo >& $(NULLDEV)
311 .IF "$(OS)"=="MACOSX"
312 $(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl extshl OOO \
313 $(LIB_DIR)$/*$(DLLPOST)
314 .ENDIF
315 .IF "$(GUI)"=="UNX"
316 chmod -R 775 $(LB)
317 .ENDIF
318 $(TOUCH) $@
320 $(BIN_RUNTIMELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
321 @$(COPY) $(MOZ_BIN_DIR)$/$(DLLPRE)$@$(DLLPOST) $(RUNTIME_DIR)$/$(DLLPRE)$@$(DLLPOST)
323 $(COMPONENT_RUNTIMELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
324 @$(COPY) $(MOZ_BIN_DIR)$/components$/$(DLLPRE)$@$(DLLPOST) $(RUNTIME_DIR)$/components$/$(DLLPRE)$@$(DLLPOST)
326 $(COMREGISTRY_FILELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
327 @$(COPY) $(MOZ_BIN_DIR)$/components$/$@ $(RUNTIME_DIR)$/components$/$@
329 $(DEFAULTS_RUNTIMELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
330 @$(COPY) $(MOZ_BIN_DIR)$/$@ $(RUNTIME_DIR)$/$@
332 RES_FILELIST: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
333 .IF "$(OS)"=="SOLARIS"
334 @$(COPY) $(MOZ_BIN_DIR)$/res$/charsetalias.properties $(RUNTIME_DIR)$/res$/charsetalias.properties
335 .ELSE
336 @echo No Res Files to copy.
337 .ENDIF
340 $(LIB_DIR)$/%: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
341 noop
343 $(MISC)$/CREATETARBALL: extract_mozab_files
344 @@-$(MKDIR) $(OUT)$/zipped
345 $(COPY) $(BIN)$/mozruntime.zip $(OUT)$/zipped$/$(MOZTARGET)runtime.zip
346 .IF "$(GUI)"=="UNX"
347 .IF "$(OS)"!="MACOSX"
348 cd $(LB) && strip *$(DLLPOST)
349 .ENDIF
350 .ENDIF
351 cd $(LB) && zip -r ..$/zipped$/$(MOZTARGET)lib.zip *
352 cd $(INCCOM) && zip -r ..$/zipped$/$(MOZTARGET)inc.zip *