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 | MODULE = apprunner |
---|
40 | REQUIRES = xpcom \ |
---|
41 | xpconnect \ |
---|
42 | string \ |
---|
43 | webbrwsr \ |
---|
44 | widget \ |
---|
45 | dom \ |
---|
46 | necko \ |
---|
47 | pref \ |
---|
48 | appshell \ |
---|
49 | gfx \ |
---|
50 | chrome \ |
---|
51 | xpinstall \ |
---|
52 | uriloader \ |
---|
53 | view \ |
---|
54 | windowwatcher \ |
---|
55 | embed_base \ |
---|
56 | embedcomponents \ |
---|
57 | mpfilelocprovider \ |
---|
58 | browser \ |
---|
59 | docshell \ |
---|
60 | uconv \ |
---|
61 | locale \ |
---|
62 | xremoteservice \ |
---|
63 | profile \ |
---|
64 | $(NULL) |
---|
65 | # for jprof |
---|
66 | REQUIRES += jprof |
---|
67 | ifeq ($(MOZ_WIDGET_TOOLKIT),os2) |
---|
68 | REQUIRES += \ |
---|
69 | intl \ |
---|
70 | profile \ |
---|
71 | $(NULL) |
---|
72 | endif |
---|
73 | ifeq ($(MOZ_WIDGET_TOOLKIT),windows) |
---|
74 | REQUIRES += intl profile appcomps |
---|
75 | endif |
---|
76 | |
---|
77 | include $(topsrcdir)/config/config.mk |
---|
78 | |
---|
79 | ifeq ($(USE_SHORT_LIBNAME),1) |
---|
80 | PROGRAM = mozilla$(BIN_SUFFIX) |
---|
81 | else |
---|
82 | PROGRAM = mozilla-bin$(BIN_SUFFIX) |
---|
83 | endif |
---|
84 | |
---|
85 | CPPSRCS = \ |
---|
86 | nsAppRunner.cpp \ |
---|
87 | nsWindowCreator.cpp \ |
---|
88 | showOSAlert.cpp \ |
---|
89 | $(NULL) |
---|
90 | |
---|
91 | ifneq ($(OS_ARCH),WINNT) |
---|
92 | CPPSRCS += nsSigHandlers.cpp |
---|
93 | endif |
---|
94 | |
---|
95 | XP_LIBS = \ |
---|
96 | $(EXTRA_DSO_LDOPTS) \ |
---|
97 | $(EXTRA_DSO_LIBS) \ |
---|
98 | $(NULL) |
---|
99 | |
---|
100 | ifndef BUILD_STATIC_LIBS |
---|
101 | |
---|
102 | EXTRA_DSO_LIBS += gkgfx mpfilelocprovider_s |
---|
103 | ifdef MOZ_OJI |
---|
104 | ifeq ($(OS_ARCH),WINNT) |
---|
105 | EXTRA_DSO_LIBS += jsj$(MOZ_BITS)$(VERSION_NUMBER) |
---|
106 | else |
---|
107 | EXTRA_DSO_LIBS += jsj |
---|
108 | endif |
---|
109 | endif |
---|
110 | |
---|
111 | else |
---|
112 | include $(topsrcdir)/config/static-config.mk |
---|
113 | |
---|
114 | EXTRA_DEPS += \ |
---|
115 | $(STATIC_EXTRA_DEPS) \ |
---|
116 | $(NULL) |
---|
117 | DEFINES += $(STATIC_DEFINES) |
---|
118 | CPPSRCS += $(STATIC_CPPSRCS) |
---|
119 | EXTRA_DSO_LDOPTS+= -L$(DEPTH)/dist/lib/components |
---|
120 | EXTRA_DSO_LIBS += $(STATIC_EXTRA_DSO_LIBS) |
---|
121 | REQUIRES += $(STATIC_REQUIRES) |
---|
122 | XP_LIBS += $(STATIC_EXTRA_LIBS) |
---|
123 | |
---|
124 | endif |
---|
125 | |
---|
126 | XP_LIBS += \ |
---|
127 | $(MOZ_JS_LIBS) \ |
---|
128 | $(XPCOM_LIBS) \ |
---|
129 | $(NSPR_LIBS) \ |
---|
130 | $(NULL) |
---|
131 | |
---|
132 | ifdef NS_TRACE_MALLOC |
---|
133 | DEFINES += -DNS_TRACE_MALLOC |
---|
134 | endif |
---|
135 | |
---|
136 | ifdef MOZ_JPROF |
---|
137 | XP_LIBS += -ljprof |
---|
138 | endif |
---|
139 | |
---|
140 | LIBS = $(XP_LIBS) |
---|
141 | |
---|
142 | ifdef GC_LEAK_DETECTOR |
---|
143 | LIBS += -lboehm |
---|
144 | endif |
---|
145 | |
---|
146 | ifeq ($(MOZ_WIDGET_TOOLKIT),beos) |
---|
147 | BEOS_PROGRAM_RESOURCE = $(srcdir)/apprunner-beos.rsrc |
---|
148 | CPPSRCS += nsNativeAppSupportBeOS.cpp |
---|
149 | CPPSRCS += nsNativeAppSupportBase.cpp |
---|
150 | endif |
---|
151 | |
---|
152 | ifeq ($(MOZ_WIDGET_TOOLKIT),photon) |
---|
153 | CPPSRCS += nsNativeAppSupportPh.cpp |
---|
154 | LIBS += -lphexlib -lph |
---|
155 | endif |
---|
156 | |
---|
157 | ifeq ($(MOZ_WIDGET_TOOLKIT),os2) |
---|
158 | CPPSRCS += nsNativeAppSupportOS2.cpp |
---|
159 | CPPSRCS += nsNativeAppSupportBase.cpp |
---|
160 | RESFILE = splashos2.res |
---|
161 | endif |
---|
162 | |
---|
163 | ifeq ($(MOZ_WIDGET_TOOLKIT),mac) |
---|
164 | LIBS += $(TK_LIBS) |
---|
165 | endif |
---|
166 | |
---|
167 | ifeq ($(MOZ_WIDGET_TOOLKIT),gtk) |
---|
168 | SPLASH_XPM = $(srcdir)/splash.xpm |
---|
169 | CPPSRCS += nsNativeAppSupportGtk.cpp \ |
---|
170 | nsNativeAppSupportBase.cpp |
---|
171 | DEFINES += -DSPLASH_XPM=\"$(SPLASH_XPM)\" |
---|
172 | LIBS += $(MOZ_GTK_LDFLAGS) |
---|
173 | endif |
---|
174 | |
---|
175 | ifeq ($(MOZ_WIDGET_TOOLKIT),windows) |
---|
176 | RCINCLUDE = splash.rc |
---|
177 | CPPSRCS += nsNativeAppSupportWin.cpp nsNativeAppSupportBase.cpp |
---|
178 | OS_LIBS += comctl32.lib comdlg32.lib uuid.lib shell32.lib ole32.lib oleaut32.lib version.lib winspool.lib |
---|
179 | endif |
---|
180 | |
---|
181 | ifneq (,$(filter windows os2 gtk gtk2,$(MOZ_WIDGET_TOOLKIT))) |
---|
182 | ifneq (,$(filter windows os2,$(MOZ_WIDGET_TOOLKIT))) |
---|
183 | ICON_SUFFIX=.ico |
---|
184 | else |
---|
185 | ICON_SUFFIX=.xpm |
---|
186 | endif |
---|
187 | |
---|
188 | ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) |
---|
189 | ICON_DIR=gtk |
---|
190 | else |
---|
191 | ICON_DIR=$(MOZ_WIDGET_TOOLKIT) |
---|
192 | endif |
---|
193 | |
---|
194 | DESKTOP_ICONS = \ |
---|
195 | abcardWindow \ |
---|
196 | addressbookWindow \ |
---|
197 | bmPropsWindow \ |
---|
198 | bookmark-window \ |
---|
199 | calendar-window \ |
---|
200 | chatzilla-window \ |
---|
201 | downloadManager \ |
---|
202 | editorWindow \ |
---|
203 | findBookmarkWindow \ |
---|
204 | findHistoryWindow \ |
---|
205 | history-window \ |
---|
206 | jsconsoleWindow \ |
---|
207 | main-window \ |
---|
208 | messengerWindow \ |
---|
209 | msgcomposeWindow \ |
---|
210 | venkman-window \ |
---|
211 | winInspectorMain \ |
---|
212 | $(NULL) |
---|
213 | |
---|
214 | ifeq ($(ICON_DIR),gtk) |
---|
215 | DESKTOP_ICONS_SMALL=$(patsubst %,%16,$(DESKTOP_ICONS)) |
---|
216 | endif |
---|
217 | |
---|
218 | DESKTOP_ICON_FILES = $(addsuffix $(ICON_SUFFIX), $(DESKTOP_ICONS) $(DESKTOP_ICONS_SMALL)) |
---|
219 | |
---|
220 | GARBAGE += $(addprefix $(DIST)/bin/chrome/icons/default/,$(DESKTOP_ICON_FILES)) |
---|
221 | |
---|
222 | libs:: $(addprefix icons/$(ICON_DIR)/,$(DESKTOP_ICON_FILES)) |
---|
223 | $(INSTALL) $^ $(DIST)/bin/chrome/icons/default |
---|
224 | |
---|
225 | install:: $(addprefix icons/$(ICON_DIR)/,$(DESKTOP_ICON_FILES)) |
---|
226 | $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/chrome/icons/default |
---|
227 | endif |
---|
228 | |
---|
229 | ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) |
---|
230 | CMMSRCS += nsNativeAppSupportForCocoa.mm |
---|
231 | LDFLAGS += \ |
---|
232 | -framework Cocoa \ |
---|
233 | $(NULL) |
---|
234 | endif |
---|
235 | |
---|
236 | ifeq ($(OS_ARCH),OS2) |
---|
237 | ifdef BUILD_STATIC_LIBS |
---|
238 | EXE_DEF_FILE = mozilla.def |
---|
239 | endif |
---|
240 | endif |
---|
241 | |
---|
242 | include $(topsrcdir)/config/rules.mk |
---|
243 | |
---|
244 | ifdef BUILD_STATIC_LIBS |
---|
245 | include $(topsrcdir)/config/static-rules.mk |
---|
246 | endif |
---|
247 | |
---|
248 | ifeq ($(MOZ_WIDGET_TOOLKIT),gtk) |
---|
249 | $(PROGRAM): $(SPLASH_XPM) |
---|
250 | endif |
---|
251 | |
---|
252 | ifeq ($(OS_ARCH),Darwin) |
---|
253 | EXTRA_DSO_LDOPTS := $(subst -dynamiclib -install_name @executable_path/\$@ -compatibility_version 1 -current_version 1,-execute,$(EXTRA_DSO_LDOPTS)) |
---|
254 | |
---|
255 | ifdef BUILD_STATIC_LIBS |
---|
256 | LDFLAGS += -framework QuickTime $(TK_LIBS) |
---|
257 | endif |
---|
258 | |
---|
259 | endif |
---|
260 | |
---|
261 | ifeq ($(OS_ARCH),WINNT) |
---|
262 | # |
---|
263 | # Control the default heap size. |
---|
264 | # This is the heap returned by GetProcessHeap(). |
---|
265 | # As we use the CRT heap, the default size is too large and wastes VM. |
---|
266 | # |
---|
267 | # The default heap size is 1MB on Win32. |
---|
268 | # The heap will grow if need be. |
---|
269 | # |
---|
270 | # Set it to 256k. See bug 127069. |
---|
271 | # |
---|
272 | LDFLAGS += /HEAP:0x40000 |
---|
273 | endif |
---|
274 | |
---|
275 | CXXFLAGS += $(MOZ_TOOLKIT_REGISTRY_CFLAGS) |
---|
276 | |
---|
277 | LOCAL_INCLUDES = -I$(srcdir) |
---|
278 | |
---|
279 | ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH))) |
---|
280 | mozilla.1: mozilla.man.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk |
---|
281 | @sed -e "s|\@bindir\@|${bindir}|" -e "s|\@libdir\@|${libdir}|" \ |
---|
282 | -e "s|\@mozilla_version\@|${MOZILLA_VERSION}|" < $< > $@ |
---|
283 | |
---|
284 | libs:: mozilla.1 |
---|
285 | $(INSTALL) $< $(DIST)/man/man1 |
---|
286 | |
---|
287 | install:: mozilla.1 |
---|
288 | $(SYSINSTALL) $(IFLAGS1) $< $(DESTDIR)$(mandir)/man1 |
---|
289 | |
---|
290 | MOZILLA_SCRIPT=mozilla |
---|
291 | |
---|
292 | $(MOZILLA_SCRIPT):: mozilla.athena.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk |
---|
293 | cat $< | sed -e "s|%MOZAPPDIR%|$(mozappdir)|" \ |
---|
294 | -e "s|%MREDIR%|$(mredir)|" \ |
---|
295 | -e "s|mozilla-bin|$(PROGRAM)|g" > $@ |
---|
296 | chmod +x $@ |
---|
297 | |
---|
298 | libs:: $(MOZILLA_SCRIPT) |
---|
299 | $(INSTALL) $< $(DIST)/bin |
---|
300 | |
---|
301 | install:: $(MOZILLA_SCRIPT) |
---|
302 | $(SYSINSTALL) $(IFLAGS2) $< $(DESTDIR)$(bindir) |
---|
303 | |
---|
304 | GARBAGE += mozilla.1 $(MOZILLA_SCRIPT) |
---|
305 | |
---|
306 | endif |
---|
307 | |
---|
308 | ifeq ($(MOZ_WIDGET_TOOLKIT),photon) |
---|
309 | libs:: $(srcdir)/splash.bmp |
---|
310 | $(INSTALL) $< $(DIST)/bin |
---|
311 | endif |
---|
312 | |
---|
313 | ifeq ($(OS_ARCH),OS2) |
---|
314 | ifdef BUILD_STATIC_LIBS |
---|
315 | $(EXE_DEF_FILE): |
---|
316 | rm -f $@ |
---|
317 | @echo NAME mozilla >$(EXE_DEF_FILE) |
---|
318 | @echo IMPORTS >>$(EXE_DEF_FILE) |
---|
319 | @echo WinQueryProperty = PMMERGE.5450 >>$(EXE_DEF_FILE) |
---|
320 | @echo WinRemoveProperty = PMMERGE.5451 >>$(EXE_DEF_FILE) |
---|
321 | @echo WinSetProperty = PMMERGE.5452 >>$(EXE_DEF_FILE) |
---|
322 | @echo DaxOpenSave = PMCTLS.295 >>$(EXE_DEF_FILE) |
---|
323 | endif |
---|
324 | endif |
---|
325 | |
---|
326 | ifeq ($(MOZ_REORDER),1) |
---|
327 | |
---|
328 | LDSCRIPT = ldscript |
---|
329 | LDFLAGS += -Wl,-T,$(LDSCRIPT) |
---|
330 | GARBAGE += $(LDSCRIPT) |
---|
331 | ORDERFILE = $(srcdir)/mozilla-bin.order |
---|
332 | |
---|
333 | $(PROGRAM) : $(LDSCRIPT) $(ORDERFILE) |
---|
334 | |
---|
335 | $(LDSCRIPT): $(ORDERFILE) |
---|
336 | $(PERL) $(topsrcdir)/config/mklinkscript.pl -o $@ $< |
---|
337 | |
---|
338 | endif |
---|
339 | |
---|
340 | ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) |
---|
341 | |
---|
342 | ifdef MOZ_DEBUG |
---|
343 | APP_NAME = MozillaDebug |
---|
344 | else |
---|
345 | APP_NAME = Mozilla |
---|
346 | endif |
---|
347 | |
---|
348 | libs:: $(PROGRAM) |
---|
349 | rm -rf $(DIST)/$(APP_NAME).app |
---|
350 | mkdir $(DIST)/$(APP_NAME).app |
---|
351 | cp -R $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app |
---|
352 | cp -RL $(DIST)/bin $(DIST)/$(APP_NAME).app/Contents/MacOS |
---|
353 | cp -RL $(srcdir)/macbuild/mach.icns $(DIST)/$(APP_NAME).app/Contents/Resources/mach.icns |
---|
354 | echo APPLMOZZ > $(DIST)/$(APP_NAME).app/Contents/PkgInfo |
---|
355 | endif |
---|
356 | |
---|
357 | libs:: |
---|
358 | touch $(DIST)/bin/.autoreg |
---|
359 | |
---|
360 | echo_objs: |
---|
361 | @echo $(OBJS) |
---|
362 | |
---|
363 | README_FILE = $(topsrcdir)/README.txt |
---|
364 | |
---|
365 | libs:: |
---|
366 | $(INSTALL) $(README_FILE) $(DIST)/bin |
---|
367 | $(INSTALL) $(topsrcdir)/LICENSE $(DIST)/bin |
---|