1 | # |
---|
2 | # The contents of this file are subject to the Netscape Public |
---|
3 | # License Version 1.1 (the "License"); you may not use this file |
---|
4 | # except in compliance with the License. You may obtain a copy of |
---|
5 | # the License at http://www.mozilla.org/NPL/ |
---|
6 | # |
---|
7 | # Software distributed under the License is distributed on an "AS |
---|
8 | # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
---|
9 | # implied. See the License for the specific language governing |
---|
10 | # rights and limitations under the License. |
---|
11 | # |
---|
12 | # The Original Code is mozilla.org code. |
---|
13 | # |
---|
14 | # The Initial Developer of the Original Code is Netscape |
---|
15 | # Communications Corporation. Portions created by Netscape are |
---|
16 | # Copyright (C) 1998 Netscape Communications Corporation. All |
---|
17 | # Rights Reserved. |
---|
18 | # |
---|
19 | # Contributor(s): |
---|
20 | # |
---|
21 | |
---|
22 | DEPTH = ../.. |
---|
23 | topsrcdir = @top_srcdir@ |
---|
24 | srcdir = @srcdir@ |
---|
25 | VPATH = @srcdir@ |
---|
26 | |
---|
27 | include $(DEPTH)/config/autoconf.mk |
---|
28 | |
---|
29 | # This code removes the console from release builds |
---|
30 | # (unless you've set MOZ_WINCONSOLE=1). |
---|
31 | ifndef MOZ_WINCONSOLE |
---|
32 | ifdef MOZ_DEBUG |
---|
33 | MOZ_WINCONSOLE=1 |
---|
34 | else |
---|
35 | MOZ_WINCONSOLE=0 |
---|
36 | endif |
---|
37 | endif |
---|
38 | |
---|
39 | |
---|
40 | ifeq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) |
---|
41 | ifndef BUILD_STATIC_LIBS |
---|
42 | ifndef MOZ_TIMELINE |
---|
43 | GRE_BUILD = 1; |
---|
44 | endif |
---|
45 | endif |
---|
46 | endif |
---|
47 | |
---|
48 | ifdef GRE_BUILD |
---|
49 | DEFINES += -DXPCOM_GLUE |
---|
50 | endif |
---|
51 | |
---|
52 | MODULE = apprunner |
---|
53 | REQUIRES = xpcom \ |
---|
54 | xpconnect \ |
---|
55 | string \ |
---|
56 | webbrwsr \ |
---|
57 | widget \ |
---|
58 | dom \ |
---|
59 | necko \ |
---|
60 | pref \ |
---|
61 | appshell \ |
---|
62 | gfx \ |
---|
63 | chrome \ |
---|
64 | xpinstall \ |
---|
65 | uriloader \ |
---|
66 | view \ |
---|
67 | windowwatcher \ |
---|
68 | embed_base \ |
---|
69 | embedcomponents \ |
---|
70 | browser \ |
---|
71 | docshell \ |
---|
72 | uconv \ |
---|
73 | locale \ |
---|
74 | xremoteservice \ |
---|
75 | profile \ |
---|
76 | $(NULL) |
---|
77 | # for jprof |
---|
78 | REQUIRES += jprof |
---|
79 | ifeq ($(MOZ_WIDGET_TOOLKIT),os2) |
---|
80 | REQUIRES += \ |
---|
81 | intl \ |
---|
82 | profile \ |
---|
83 | $(NULL) |
---|
84 | DIRS += os2turbo |
---|
85 | endif |
---|
86 | ifeq ($(MOZ_WIDGET_TOOLKIT),windows) |
---|
87 | REQUIRES += intl profile appcomps |
---|
88 | endif |
---|
89 | |
---|
90 | ifdef NS_TRACE_MALLOC |
---|
91 | REQUIRES += tracemalloc |
---|
92 | endif |
---|
93 | |
---|
94 | include $(topsrcdir)/config/config.mk |
---|
95 | |
---|
96 | ifeq ($(USE_SHORT_LIBNAME),1) |
---|
97 | PROGRAM = mozilla$(BIN_SUFFIX) |
---|
98 | else |
---|
99 | PROGRAM = mozilla-bin$(BIN_SUFFIX) |
---|
100 | endif |
---|
101 | |
---|
102 | # Force applications to be built non-statically |
---|
103 | # when building the mozcomps meta component |
---|
104 | ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS))) |
---|
105 | BUILD_STATIC_LIBS= |
---|
106 | BUILD_SHARED_LIBS=1 |
---|
107 | endif |
---|
108 | |
---|
109 | CPPSRCS = \ |
---|
110 | nsAppRunner.cpp \ |
---|
111 | nsWindowCreator.cpp \ |
---|
112 | showOSAlert.cpp \ |
---|
113 | $(NULL) |
---|
114 | |
---|
115 | |
---|
116 | ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH))) |
---|
117 | STACKWALK_SRC_LCSRCS = \ |
---|
118 | nsStackFrameUnix.cpp \ |
---|
119 | nsStackFrameUnix.h \ |
---|
120 | $(NULL) |
---|
121 | |
---|
122 | STACKWALK_CPPSRCS := $(addprefix $(topsrcdir)/xpcom/base/, $(STACKWALK_SRC_LCSRCS)) |
---|
123 | |
---|
124 | CPPSRCS += nsSigHandlers.cpp nsStackFrameUnix.cpp |
---|
125 | endif |
---|
126 | |
---|
127 | LIBS = $(EXTRA_DSO_LDOPTS) \ |
---|
128 | $(EXTRA_DSO_LIBS) \ |
---|
129 | $(NULL) |
---|
130 | |
---|
131 | |
---|
132 | ifndef BUILD_STATIC_LIBS |
---|
133 | |
---|
134 | ifdef NS_TRACE_MALLOC |
---|
135 | EXTRA_DSO_LIBS += tracemalloc |
---|
136 | endif |
---|
137 | |
---|
138 | else |
---|
139 | include $(topsrcdir)/config/static-config.mk |
---|
140 | |
---|
141 | EXTRA_DEPS += \ |
---|
142 | $(STATIC_EXTRA_DEPS) \ |
---|
143 | $(NULL) |
---|
144 | DEFINES += $(STATIC_DEFINES) |
---|
145 | CPPSRCS += $(STATIC_CPPSRCS) |
---|
146 | ifneq ($(OS_ARCH),WINNT) |
---|
147 | EXTRA_DSO_LDOPTS+= -L$(DEPTH)/dist/lib/components |
---|
148 | endif # !WINNT |
---|
149 | EXTRA_DSO_LIBS += $(STATIC_EXTRA_DSO_LIBS) |
---|
150 | REQUIRES += $(STATIC_REQUIRES) |
---|
151 | LIBS += $(STATIC_EXTRA_LIBS) |
---|
152 | |
---|
153 | endif |
---|
154 | |
---|
155 | # If you change anything that mozilla links to, please talk to dougt@netscape.com |
---|
156 | ifdef GRE_BUILD |
---|
157 | LIBS += \ |
---|
158 | $(DIST)/lib/$(LIB_PREFIX)string_s.$(LIB_SUFFIX) \ |
---|
159 | $(DIST)/lib/$(LIB_PREFIX)string_obsolete_s.$(LIB_SUFFIX) \ |
---|
160 | $(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \ |
---|
161 | $(DIST)/lib/$(LIB_PREFIX)embedstring_s.$(LIB_SUFFIX) \ |
---|
162 | $(NULL) |
---|
163 | else |
---|
164 | LIBS += $(XPCOM_LIBS) |
---|
165 | endif |
---|
166 | |
---|
167 | LIBS += \ |
---|
168 | $(MOZ_JS_LIBS) \ |
---|
169 | $(NSPR_LIBS) \ |
---|
170 | $(NULL) |
---|
171 | |
---|
172 | ifdef MOZ_JPROF |
---|
173 | LIBS += -ljprof |
---|
174 | endif |
---|
175 | |
---|
176 | ifdef GC_LEAK_DETECTOR |
---|
177 | LIBS += -lboehm |
---|
178 | endif |
---|
179 | |
---|
180 | ifdef MOZ_DEMANGLE_SYMBOLS |
---|
181 | LIBS += -liberty |
---|
182 | endif |
---|
183 | |
---|
184 | ifeq ($(MOZ_WIDGET_TOOLKIT),beos) |
---|
185 | BEOS_PROGRAM_RESOURCE = $(srcdir)/apprunner-beos.rsrc |
---|
186 | CPPSRCS += nsNativeAppSupportBeOS.cpp |
---|
187 | CPPSRCS += nsNativeAppSupportBase.cpp |
---|
188 | endif |
---|
189 | |
---|
190 | ifeq ($(MOZ_WIDGET_TOOLKIT),photon) |
---|
191 | CPPSRCS += nsNativeAppSupportPh.cpp |
---|
192 | LIBS += -lphexlib -lph |
---|
193 | endif |
---|
194 | |
---|
195 | ifeq ($(MOZ_WIDGET_TOOLKIT),os2) |
---|
196 | CPPSRCS += nsNativeAppSupportOS2.cpp |
---|
197 | CPPSRCS += nsNativeAppSupportBase.cpp |
---|
198 | RESFILE = splashos2.res |
---|
199 | endif |
---|
200 | |
---|
201 | ifeq ($(MOZ_WIDGET_TOOLKIT),mac) |
---|
202 | CPPSRCS += nsNativeAppSupportMac.cpp |
---|
203 | CPPSRCS += nsNativeAppSupportBase.cpp |
---|
204 | LIBS += $(TK_LIBS) |
---|
205 | endif |
---|
206 | |
---|
207 | ifeq ($(MOZ_WIDGET_TOOLKIT),gtk) |
---|
208 | SPLASH_XPM = $(srcdir)/splash.xpm |
---|
209 | CPPSRCS += nsNativeAppSupportGtk.cpp \ |
---|
210 | nsNativeAppSupportBase.cpp |
---|
211 | DEFINES += -DSPLASH_XPM=\"$(SPLASH_XPM)\" |
---|
212 | LIBS += $(MOZ_GTK_LDFLAGS) |
---|
213 | endif |
---|
214 | |
---|
215 | ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) |
---|
216 | SPLASH_XPM = $(srcdir)/splash.xpm |
---|
217 | CPPSRCS += nsNativeAppSupportGtk.cpp \ |
---|
218 | nsNativeAppSupportBase.cpp |
---|
219 | DEFINES += -DSPLASH_XPM=\"$(SPLASH_XPM)\" |
---|
220 | LIBS += $(MOZ_GTK2_LIBS) |
---|
221 | endif |
---|
222 | |
---|
223 | ifeq ($(MOZ_WIDGET_TOOLKIT),windows) |
---|
224 | RCINCLUDE = splash.rc |
---|
225 | CPPSRCS += nsNativeAppSupportWin.cpp nsNativeAppSupportBase.cpp |
---|
226 | OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool gdi32) |
---|
227 | endif |
---|
228 | |
---|
229 | ifneq (,$(filter windows os2 gtk gtk2,$(MOZ_WIDGET_TOOLKIT))) |
---|
230 | ifneq (,$(filter windows os2,$(MOZ_WIDGET_TOOLKIT))) |
---|
231 | ICON_SUFFIX=.ico |
---|
232 | else |
---|
233 | ICON_SUFFIX=.xpm |
---|
234 | endif |
---|
235 | |
---|
236 | ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) |
---|
237 | ICON_DIR=gtk |
---|
238 | else |
---|
239 | ICON_DIR=$(MOZ_WIDGET_TOOLKIT) |
---|
240 | endif |
---|
241 | |
---|
242 | DESKTOP_ICONS = \ |
---|
243 | abcardWindow \ |
---|
244 | addressbookWindow \ |
---|
245 | bmPropsWindow \ |
---|
246 | bookmark-window \ |
---|
247 | calendar-window \ |
---|
248 | chatzilla-window \ |
---|
249 | downloadManager \ |
---|
250 | editorWindow \ |
---|
251 | findBookmarkWindow \ |
---|
252 | findHistoryWindow \ |
---|
253 | history-window \ |
---|
254 | jsconsoleWindow \ |
---|
255 | main-window \ |
---|
256 | messengerWindow \ |
---|
257 | msgcomposeWindow \ |
---|
258 | venkman-window \ |
---|
259 | winInspectorMain \ |
---|
260 | $(NULL) |
---|
261 | |
---|
262 | ifeq ($(ICON_DIR),gtk) |
---|
263 | DESKTOP_ICONS_SMALL=$(patsubst %,%16,$(DESKTOP_ICONS)) |
---|
264 | endif |
---|
265 | |
---|
266 | DESKTOP_ICON_FILES = $(addsuffix $(ICON_SUFFIX), $(DESKTOP_ICONS) $(DESKTOP_ICONS_SMALL)) |
---|
267 | |
---|
268 | GARBAGE += $(addprefix $(DIST)/bin/chrome/icons/default/,$(DESKTOP_ICON_FILES)) |
---|
269 | |
---|
270 | libs:: $(addprefix icons/$(ICON_DIR)/,$(DESKTOP_ICON_FILES)) |
---|
271 | $(INSTALL) $^ $(DIST)/bin/chrome/icons/default |
---|
272 | |
---|
273 | install:: $(addprefix icons/$(ICON_DIR)/,$(DESKTOP_ICON_FILES)) |
---|
274 | $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/chrome/icons/default |
---|
275 | endif |
---|
276 | |
---|
277 | ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) |
---|
278 | CMMSRCS += nsNativeAppSupportForCocoa.mm |
---|
279 | LIBS += -framework Cocoa $(TK_LIBS) |
---|
280 | endif |
---|
281 | |
---|
282 | ifeq ($(OS_ARCH),OS2) |
---|
283 | ifdef BUILD_STATIC_LIBS |
---|
284 | EXE_DEF_FILE = mozilla.def |
---|
285 | ifeq ($(MOZ_OS2_TOOLS),VACPP) |
---|
286 | OS_LIBS += libuls.lib libconv.lib |
---|
287 | else |
---|
288 | OS_LIBS += -llibuni -luconv |
---|
289 | endif |
---|
290 | endif |
---|
291 | endif |
---|
292 | |
---|
293 | SRCS_IN_OBJDIR=1 |
---|
294 | |
---|
295 | ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH))) |
---|
296 | GARBAGE += $(STACKWALK_SRC_LCSRCS) $(wildcard *.$(OBJ_SUFFIX)) |
---|
297 | endif |
---|
298 | |
---|
299 | include $(topsrcdir)/config/rules.mk |
---|
300 | |
---|
301 | ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH))) |
---|
302 | export:: $(STACKWALK_CPPSRCS) |
---|
303 | $(INSTALL) $^ . |
---|
304 | endif |
---|
305 | |
---|
306 | ifdef BUILD_STATIC_LIBS |
---|
307 | include $(topsrcdir)/config/static-rules.mk |
---|
308 | endif |
---|
309 | |
---|
310 | ifeq ($(MOZ_WIDGET_TOOLKIT),gtk) |
---|
311 | $(PROGRAM): $(SPLASH_XPM) |
---|
312 | endif |
---|
313 | |
---|
314 | ifeq ($(OS_ARCH),Darwin) |
---|
315 | EXTRA_DSO_LDOPTS := $(subst -dynamiclib -install_name @executable_path/\$@ -compatibility_version 1 -current_version 1,-execute,$(EXTRA_DSO_LDOPTS)) |
---|
316 | endif |
---|
317 | |
---|
318 | ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) |
---|
319 | ifdef BUILD_STATIC_LIBS |
---|
320 | LIBS += -framework QuickTime |
---|
321 | endif |
---|
322 | |
---|
323 | endif |
---|
324 | |
---|
325 | ifeq ($(OS_ARCH),WINNT) |
---|
326 | # |
---|
327 | # Control the default heap size. |
---|
328 | # This is the heap returned by GetProcessHeap(). |
---|
329 | # As we use the CRT heap, the default size is too large and wastes VM. |
---|
330 | # |
---|
331 | # The default heap size is 1MB on Win32. |
---|
332 | # The heap will grow if need be. |
---|
333 | # |
---|
334 | # Set it to 256k. See bug 127069. |
---|
335 | # |
---|
336 | ifndef GNU_CC |
---|
337 | LDFLAGS += /HEAP:0x40000 |
---|
338 | endif |
---|
339 | endif |
---|
340 | |
---|
341 | CXXFLAGS += $(MOZ_TOOLKIT_REGISTRY_CFLAGS) |
---|
342 | |
---|
343 | LOCAL_INCLUDES = -I$(srcdir) -I. |
---|
344 | |
---|
345 | ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH))) |
---|
346 | mozilla.1: mozilla.man.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk |
---|
347 | @sed -e "s|\@bindir\@|${bindir}|" -e "s|\@libdir\@|${libdir}|" \ |
---|
348 | -e "s|\@mozilla_version\@|${MOZILLA_VERSION}|" < $< > $@ |
---|
349 | |
---|
350 | libs:: mozilla.1 |
---|
351 | $(INSTALL) $< $(DIST)/man/man1 |
---|
352 | |
---|
353 | install:: mozilla.1 |
---|
354 | $(SYSINSTALL) $(IFLAGS1) $< $(DESTDIR)$(mandir)/man1 |
---|
355 | |
---|
356 | MOZILLA_SCRIPT=mozilla |
---|
357 | |
---|
358 | $(MOZILLA_SCRIPT):: mozilla.athena.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk |
---|
359 | cat $< | sed -e "s|%MOZAPPDIR%|$(mozappdir)|" \ |
---|
360 | -e "s|%MREDIR%|$(mredir)|" \ |
---|
361 | -e "s|mozilla-bin|$(PROGRAM)|g" > $@ |
---|
362 | chmod +x $@ |
---|
363 | |
---|
364 | libs:: $(MOZILLA_SCRIPT) |
---|
365 | $(INSTALL) $< $(DIST)/bin |
---|
366 | |
---|
367 | install:: $(MOZILLA_SCRIPT) |
---|
368 | $(SYSINSTALL) $(IFLAGS2) $< $(DESTDIR)$(bindir) |
---|
369 | |
---|
370 | GARBAGE += mozilla.1 $(MOZILLA_SCRIPT) |
---|
371 | |
---|
372 | endif |
---|
373 | |
---|
374 | ifeq ($(MOZ_WIDGET_TOOLKIT),photon) |
---|
375 | libs:: $(srcdir)/splash.bmp |
---|
376 | $(INSTALL) $< $(DIST)/bin |
---|
377 | endif |
---|
378 | |
---|
379 | ifeq ($(OS_ARCH),OS2) |
---|
380 | ifeq ($(MOZ_OS2_TOOLS),VACPP) |
---|
381 | LDFLAGS += /NOE |
---|
382 | else |
---|
383 | LDFLAGS += -Zlinker /NOE |
---|
384 | endif |
---|
385 | ifdef BUILD_STATIC_LIBS |
---|
386 | $(EXE_DEF_FILE): |
---|
387 | rm -f $@ |
---|
388 | @echo NAME mozilla >$(EXE_DEF_FILE) |
---|
389 | @echo IMPORTS >>$(EXE_DEF_FILE) |
---|
390 | @echo WinQueryProperty = PMMERGE.5450 >>$(EXE_DEF_FILE) |
---|
391 | @echo WinRemoveProperty = PMMERGE.5451 >>$(EXE_DEF_FILE) |
---|
392 | @echo WinSetProperty = PMMERGE.5452 >>$(EXE_DEF_FILE) |
---|
393 | |
---|
394 | endif |
---|
395 | endif |
---|
396 | |
---|
397 | ifeq ($(MOZ_REORDER),1) |
---|
398 | |
---|
399 | LDSCRIPT = ldscript |
---|
400 | LDFLAGS += -Wl,-T,$(LDSCRIPT) |
---|
401 | GARBAGE += $(LDSCRIPT) |
---|
402 | ORDERFILE = $(srcdir)/mozilla-bin.order |
---|
403 | |
---|
404 | $(PROGRAM) : $(LDSCRIPT) $(ORDERFILE) |
---|
405 | |
---|
406 | $(LDSCRIPT): $(ORDERFILE) |
---|
407 | $(PERL) $(topsrcdir)/config/mklinkscript.pl -o $@ $< |
---|
408 | |
---|
409 | endif |
---|
410 | |
---|
411 | libs:: |
---|
412 | touch $(DIST)/bin/.autoreg |
---|
413 | |
---|
414 | ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) |
---|
415 | |
---|
416 | INCLUDES += -I$(srcdir)/../appshell/src -I$(srcdir)/appleevents |
---|
417 | |
---|
418 | ifdef MOZ_DEBUG |
---|
419 | APP_NAME = MozillaDebug |
---|
420 | else |
---|
421 | APP_NAME = Mozilla |
---|
422 | endif |
---|
423 | |
---|
424 | libs:: $(PROGRAM) |
---|
425 | mkdir -p $(DIST)/$(APP_NAME).app/Contents/MacOS |
---|
426 | rsync -a $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app |
---|
427 | rsync -a $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/MacOS |
---|
428 | rm -f $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM) |
---|
429 | rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS |
---|
430 | mkdir -p $(DIST)/$(APP_NAME).app/Contents/Plug-Ins |
---|
431 | cp -R $(DIST)/package/PrintPDE.plugin $(DIST)/$(APP_NAME).app/Contents/Plug-Ins/ |
---|
432 | cp -RL $(DIST)/package/mozillaSuite.rsrc $(DIST)/$(APP_NAME).app/Contents/Resources/$(PROGRAM).rsrc |
---|
433 | echo -n APPLMOZZ > $(DIST)/$(APP_NAME).app/Contents/PkgInfo |
---|
434 | |
---|
435 | clean clobber:: |
---|
436 | rm -rf $(DIST)/$(APP_NAME).app |
---|
437 | endif |
---|
438 | |
---|
439 | echo_objs: |
---|
440 | @echo $(OBJS) |
---|
441 | |
---|
442 | README_FILE = $(topsrcdir)/README.txt |
---|
443 | |
---|
444 | libs:: |
---|
445 | $(INSTALL) $(README_FILE) $(DIST)/bin |
---|
446 | $(INSTALL) $(topsrcdir)/LICENSE $(DIST)/bin |
---|
447 | |
---|