source: trunk/third/mozilla/xpfe/bootstrap/Makefile.in @ 19530

Revision 19530, 9.8 KB checked in by rbasch, 21 years ago (diff)
Merge with mozilla 1.4.
Line 
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
22DEPTH           = ../..
23topsrcdir       = @top_srcdir@
24srcdir          = @srcdir@
25VPATH           = @srcdir@
26
27include $(DEPTH)/config/autoconf.mk
28
29# This code removes the console from release builds
30# (unless you've set MOZ_WINCONSOLE=1).
31ifndef MOZ_WINCONSOLE
32ifdef MOZ_DEBUG
33MOZ_WINCONSOLE=1
34else
35MOZ_WINCONSOLE=0
36endif
37endif
38
39
40ifeq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
41ifndef BUILD_STATIC_LIBS
42ifndef MOZ_TIMELINE
43GRE_BUILD       = 1;
44endif
45endif
46endif
47
48ifdef GRE_BUILD
49DEFINES         += -DXPCOM_GLUE
50endif
51
52MODULE          = apprunner
53REQUIRES        = 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
78REQUIRES        += jprof
79ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
80REQUIRES        += \
81                  intl \
82                  profile \
83                  $(NULL)
84DIRS            += os2turbo
85endif
86ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
87REQUIRES        += intl profile appcomps
88endif
89
90ifdef NS_TRACE_MALLOC
91REQUIRES        += tracemalloc
92endif
93
94include $(topsrcdir)/config/config.mk
95
96ifeq ($(USE_SHORT_LIBNAME),1)
97PROGRAM         = mozilla$(BIN_SUFFIX)
98else
99PROGRAM         = mozilla-bin$(BIN_SUFFIX)
100endif
101
102# Force applications to be built non-statically
103# when building the mozcomps meta component
104ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
105BUILD_STATIC_LIBS=
106BUILD_SHARED_LIBS=1
107endif
108
109CPPSRCS         = \
110                nsAppRunner.cpp \
111                nsWindowCreator.cpp \
112                showOSAlert.cpp \
113                $(NULL)
114
115
116ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
117STACKWALK_SRC_LCSRCS =               \
118                nsStackFrameUnix.cpp \
119                nsStackFrameUnix.h   \
120                $(NULL)
121
122STACKWALK_CPPSRCS := $(addprefix $(topsrcdir)/xpcom/base/, $(STACKWALK_SRC_LCSRCS))
123
124CPPSRCS         += nsSigHandlers.cpp nsStackFrameUnix.cpp
125endif
126
127LIBS    = $(EXTRA_DSO_LDOPTS) \
128          $(EXTRA_DSO_LIBS) \
129          $(NULL)
130
131
132ifndef BUILD_STATIC_LIBS
133
134ifdef NS_TRACE_MALLOC
135EXTRA_DSO_LIBS  += tracemalloc
136endif
137
138else
139include $(topsrcdir)/config/static-config.mk
140
141EXTRA_DEPS      += \
142        $(STATIC_EXTRA_DEPS) \
143        $(NULL)
144DEFINES         += $(STATIC_DEFINES)
145CPPSRCS         += $(STATIC_CPPSRCS)
146ifneq ($(OS_ARCH),WINNT)
147EXTRA_DSO_LDOPTS+= -L$(DEPTH)/dist/lib/components
148endif # !WINNT
149EXTRA_DSO_LIBS  += $(STATIC_EXTRA_DSO_LIBS)
150REQUIRES        += $(STATIC_REQUIRES)
151LIBS            += $(STATIC_EXTRA_LIBS)
152
153endif
154
155# If you change anything that mozilla links to, please talk to dougt@netscape.com
156ifdef GRE_BUILD
157LIBS            += \
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)
163else
164LIBS            += $(XPCOM_LIBS)
165endif
166
167LIBS            += \
168                $(MOZ_JS_LIBS) \
169                $(NSPR_LIBS) \
170                $(NULL)
171
172ifdef MOZ_JPROF
173LIBS         += -ljprof
174endif
175
176ifdef GC_LEAK_DETECTOR
177LIBS += -lboehm
178endif
179
180ifdef MOZ_DEMANGLE_SYMBOLS
181LIBS += -liberty
182endif
183
184ifeq ($(MOZ_WIDGET_TOOLKIT),beos)
185BEOS_PROGRAM_RESOURCE = $(srcdir)/apprunner-beos.rsrc
186CPPSRCS += nsNativeAppSupportBeOS.cpp
187CPPSRCS += nsNativeAppSupportBase.cpp
188endif
189
190ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
191CPPSRCS += nsNativeAppSupportPh.cpp
192LIBS += -lphexlib -lph
193endif
194
195ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
196CPPSRCS += nsNativeAppSupportOS2.cpp
197CPPSRCS += nsNativeAppSupportBase.cpp
198RESFILE = splashos2.res
199endif
200
201ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
202CPPSRCS += nsNativeAppSupportMac.cpp
203CPPSRCS += nsNativeAppSupportBase.cpp
204LIBS    += $(TK_LIBS)
205endif
206
207ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
208SPLASH_XPM = $(srcdir)/splash.xpm
209CPPSRCS += nsNativeAppSupportGtk.cpp \
210           nsNativeAppSupportBase.cpp
211DEFINES += -DSPLASH_XPM=\"$(SPLASH_XPM)\"
212LIBS += $(MOZ_GTK_LDFLAGS)
213endif
214
215ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
216SPLASH_XPM = $(srcdir)/splash.xpm
217CPPSRCS += nsNativeAppSupportGtk.cpp \
218           nsNativeAppSupportBase.cpp
219DEFINES += -DSPLASH_XPM=\"$(SPLASH_XPM)\"
220LIBS += $(MOZ_GTK2_LIBS)
221endif
222
223ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
224RCINCLUDE = splash.rc
225CPPSRCS += nsNativeAppSupportWin.cpp nsNativeAppSupportBase.cpp
226OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool gdi32)
227endif
228
229ifneq (,$(filter windows os2 gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
230ifneq (,$(filter windows os2,$(MOZ_WIDGET_TOOLKIT)))
231ICON_SUFFIX=.ico
232else
233ICON_SUFFIX=.xpm
234endif
235
236ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
237ICON_DIR=gtk
238else
239ICON_DIR=$(MOZ_WIDGET_TOOLKIT)
240endif
241
242DESKTOP_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
262ifeq ($(ICON_DIR),gtk)
263DESKTOP_ICONS_SMALL=$(patsubst %,%16,$(DESKTOP_ICONS))
264endif
265
266DESKTOP_ICON_FILES = $(addsuffix $(ICON_SUFFIX), $(DESKTOP_ICONS) $(DESKTOP_ICONS_SMALL))
267
268GARBAGE += $(addprefix $(DIST)/bin/chrome/icons/default/,$(DESKTOP_ICON_FILES))
269
270libs:: $(addprefix icons/$(ICON_DIR)/,$(DESKTOP_ICON_FILES))
271        $(INSTALL) $^ $(DIST)/bin/chrome/icons/default
272
273install:: $(addprefix icons/$(ICON_DIR)/,$(DESKTOP_ICON_FILES))
274        $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/chrome/icons/default
275endif
276
277ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
278CMMSRCS += nsNativeAppSupportForCocoa.mm
279LIBS += -framework Cocoa $(TK_LIBS)
280endif
281
282ifeq ($(OS_ARCH),OS2)
283ifdef BUILD_STATIC_LIBS
284EXE_DEF_FILE = mozilla.def
285ifeq ($(MOZ_OS2_TOOLS),VACPP)
286OS_LIBS += libuls.lib libconv.lib
287else
288OS_LIBS += -llibuni -luconv
289endif
290endif
291endif
292
293SRCS_IN_OBJDIR=1
294
295ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
296GARBAGE         += $(STACKWALK_SRC_LCSRCS) $(wildcard *.$(OBJ_SUFFIX))
297endif
298
299include $(topsrcdir)/config/rules.mk
300
301ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
302export:: $(STACKWALK_CPPSRCS)
303        $(INSTALL) $^ .
304endif
305
306ifdef BUILD_STATIC_LIBS
307include $(topsrcdir)/config/static-rules.mk
308endif
309
310ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
311$(PROGRAM): $(SPLASH_XPM)
312endif
313
314ifeq ($(OS_ARCH),Darwin)
315EXTRA_DSO_LDOPTS := $(subst -dynamiclib -install_name @executable_path/\$@ -compatibility_version 1 -current_version 1,-execute,$(EXTRA_DSO_LDOPTS))
316endif
317
318ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
319ifdef BUILD_STATIC_LIBS
320LIBS    += -framework QuickTime
321endif
322
323endif
324
325ifeq ($(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#
336ifndef GNU_CC
337LDFLAGS += /HEAP:0x40000
338endif
339endif
340
341CXXFLAGS        += $(MOZ_TOOLKIT_REGISTRY_CFLAGS)
342
343LOCAL_INCLUDES  = -I$(srcdir) -I.
344
345ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
346mozilla.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
350libs:: mozilla.1
351        $(INSTALL) $< $(DIST)/man/man1
352
353install:: mozilla.1
354        $(SYSINSTALL) $(IFLAGS1) $< $(DESTDIR)$(mandir)/man1
355
356MOZILLA_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
364libs:: $(MOZILLA_SCRIPT)
365        $(INSTALL) $< $(DIST)/bin
366
367install:: $(MOZILLA_SCRIPT)
368        $(SYSINSTALL) $(IFLAGS2) $< $(DESTDIR)$(bindir)
369
370GARBAGE += mozilla.1 $(MOZILLA_SCRIPT)
371
372endif
373
374ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
375libs:: $(srcdir)/splash.bmp
376        $(INSTALL) $< $(DIST)/bin
377endif
378
379ifeq ($(OS_ARCH),OS2)
380ifeq ($(MOZ_OS2_TOOLS),VACPP)
381LDFLAGS += /NOE
382else
383LDFLAGS += -Zlinker /NOE
384endif
385ifdef 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
394endif
395endif
396
397ifeq ($(MOZ_REORDER),1)
398
399LDSCRIPT = ldscript
400LDFLAGS += -Wl,-T,$(LDSCRIPT)
401GARBAGE += $(LDSCRIPT)
402ORDERFILE = $(srcdir)/mozilla-bin.order
403
404$(PROGRAM) : $(LDSCRIPT) $(ORDERFILE)
405
406$(LDSCRIPT): $(ORDERFILE)
407        $(PERL) $(topsrcdir)/config/mklinkscript.pl -o $@ $<
408
409endif
410
411libs::
412        touch $(DIST)/bin/.autoreg
413
414ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
415
416INCLUDES += -I$(srcdir)/../appshell/src -I$(srcdir)/appleevents
417
418ifdef MOZ_DEBUG
419APP_NAME = MozillaDebug
420else
421APP_NAME = Mozilla
422endif
423
424libs:: $(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
435clean clobber::
436        rm -rf $(DIST)/$(APP_NAME).app
437endif
438
439echo_objs:
440        @echo $(OBJS)
441
442README_FILE = $(topsrcdir)/README.txt
443
444libs::
445        $(INSTALL) $(README_FILE) $(DIST)/bin
446        $(INSTALL) $(topsrcdir)/LICENSE $(DIST)/bin
447
Note: See TracBrowser for help on using the repository browser.