1 # vim:set ts=8 sw=8 sts=8 et:
2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
15 # The Original Code is mozilla.org code.
17 # The Initial Developer of the Original Code is
18 # Netscape Communications.
19 # Portions created by the Initial Developer are Copyright (C) 2001
20 # the Initial Developer. All Rights Reserved.
23 # Brian Ryner <bryner@brianryner.com>
24 # Jonathan Wilson <jonwil@tpgi.com.au>
25 # Dan Mosedale <dmose@mozilla.org>
26 # Darin Fisher <darin@meer.net>
27 # Benjamin Smedberg <benjamin@smedbergs.us>
29 # Alternatively, the contents of this file may be used under the terms of
30 # either the GNU General Public License Version 2 or later (the "GPL"), or
31 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
32 # in which case the provisions of the GPL or the LGPL are applicable instead
33 # of those above. If you wish to allow use of your version of this file only
34 # under the terms of either the GPL or the LGPL, and not to allow others to
35 # use your version of this file under the terms of the MPL, indicate your
36 # decision by deleting the provisions above and replace them with the notice
37 # and other provisions required by the GPL or the LGPL. If you do not delete
38 # the provisions above, a recipient may use your version of this file under
39 # the terms of any one of the MPL, the GPL or the LGPL.
41 # ***** END LICENSE BLOCK *****
44 topsrcdir
= @top_srcdir@
48 include $(DEPTH
)/config
/autoconf.mk
52 PREF_JS_EXPORTS
= $(srcdir)/xulrunner.js
53 GARBAGE
+= $(addprefix $(DIST
)/bin
/defaults
/pref
/,xulrunner.js
)
55 DEFINES
+= -DAB_CD
=$(AB_CD
)
57 ifeq ($(USE_SHORT_LIBNAME
), 1)
58 PROGRAM
= xulrunner
$(BIN_SUFFIX
)
60 ifeq ($(OS_ARCH
), BeOS
)
61 PROGRAM
= xulrunner
$(BIN_SUFFIX
)
63 PROGRAM
= xulrunner-bin
$(BIN_SUFFIX
)
67 DEFINES
+= -DXULRUNNER_PROGNAME
=\"xulrunner
\"
70 DEFINES
+= -DMOZ_JAVAXPCOM
73 ifdef TARGET_XPCOM_ABI
74 DEFINES
+= -DTARGET_XPCOM_ABI
=\"$(TARGET_XPCOM_ABI
)\"
85 CPPSRCS
= nsXULRunnerApp.
cpp
87 ifneq (,$(filter WINNT WINCE
,$(OS_ARCH
)))
88 CPPSRCS
+= nsRegisterGREWin.
cpp
90 ifneq (,$(filter OS2 Darwin
,$(OS_ARCH
)))
91 CPPSRCS
+= nsRegisterGREVoid.
cpp
93 CPPSRCS
+= nsRegisterGREUnix.
cpp
98 -I
$(topsrcdir
)/toolkit
/xre \
99 -I
$(topsrcdir
)/toolkit
/profile
/src \
102 ifneq (,$(filter mac cocoa
,$(MOZ_WIDGET_TOOLKIT
)))
103 TK_LIBS
:= -framework Cocoa
$(TK_LIBS
)
106 ifndef MOZ_ENABLE_LIBXUL
107 ifneq (,$(filter mac cocoa
,$(MOZ_WIDGET_TOOLKIT
)))
108 LIBS
+= $(DIST
)/bin
/XUL
110 EXTRA_DSO_LIBS
+= xul
117 $(DIST
)/lib
/$(LIB_PREFIX
)xpcomglue_s.
$(LIB_SUFFIX
) \
123 # Add explicit X11 dependency when building against X11 toolkits
124 ifneq (,$(filter gtk gtk2 xlib
,$(MOZ_WIDGET_TOOLKIT
)))
125 LIBS
+= $(XLDFLAGS
) $(XLIBS
)
132 ifndef MOZ_WINCONSOLE
139 DEFINES
+= -DMOZ_WINCONSOLE
=$(MOZ_WINCONSOLE
)
141 # This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
142 # shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
145 include $(topsrcdir
)/config
/config.mk
148 # Always enter a Windows program through wmain, whether or not we're
149 # a console application.
151 WIN32_EXE_LDFLAGS
+= -ENTRY
:mainWCRTStartup
153 WIN32_EXE_LDFLAGS
+= -ENTRY
:wmainCRTStartup
157 ifeq ($(OS_ARCH
),WINNT
)
158 OS_LIBS
+= $(call EXPAND_LIBNAME
,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool
)
159 RCINCLUDE
= splash.rc
161 RCFLAGS
+= -DMOZ_XULRUNNER
-I
$(srcdir)
163 RCFLAGS
+= -DMOZ_XULRUNNER
--include-dir
$(srcdir)
170 ifeq ($(OS_ARCH
),BeOS
)
174 ifeq ($(OS_ARCH
),OS2
)
175 RESFILE
=splashos2.res
176 RCFLAGS
+= -DMOZ_XULRUNNER
180 RCFLAGS
+= -DXULRUNNER_ICO
=\"$(DIST
)/branding
/xulrunner.ico
\" -DDOCUMENT_ICO
=\"$(DIST
)/branding
/document.ico
\"
183 LIBS
+= $(JEMALLOC_LIBS
)
185 include $(topsrcdir
)/config
/rules.mk
187 DEFINES
+= -DXULRUNNER_ICO
=\"$(DIST
)/branding
/xulrunner.ico
\" -DDOCUMENT_ICO
=\"$(DIST
)/branding
/document.ico
\"
189 ifeq ($(MOZ_WIDGET_TOOLKIT
),photon
)
193 ifeq ($(OS_ARCH
),WINNT
)
195 # Control the default heap size.
196 # This is the heap returned by GetProcessHeap().
197 # As we use the CRT heap, the default size is too large and wastes VM.
199 # The default heap size is 1MB on Win32.
200 # The heap will grow if need be.
202 # Set it to 256k. See bug 127069.
205 LDFLAGS
+= /HEAP
:0x40000
209 ifneq (,$(filter-out OS2 WINCE WINNT Darwin BeOS
,$(OS_ARCH
)))
211 xulrunner
:: mozilla.in
$(GLOBAL_DEPS
)
212 cat
$< | sed
-e
"s|%MOZAPPDIR%|$(mozappdir)|" \
213 -e
"s|%MOZ_USER_DIR%|.mozilla/xulrunner|" \
214 -e
"s|%MREDIR%|$(mredir)|" > $@
218 $(INSTALL
) $< $(DIST
)/bin
221 $(SYSINSTALL
) $< $(DESTDIR
)$(bindir)
226 ifneq (,$(filter gtk gtk2
,$(MOZ_WIDGET_TOOLKIT
)))
229 $(DIST
)/branding
/mozicon50.xpm \
230 $(DIST
)/branding
/mozicon16.xpm \
231 $(DIST
)/branding
/document.png \
235 $(INSTALL
) $(IFLAGS1
) $^
$(DIST
)/bin
/icons
238 $(SYSINSTALL
) $(IFLAGS1
) $(ICON_FILES
) $(DESTDIR
)$(mozappdir
)/icons
241 ifeq ($(MOZ_WIDGET_TOOLKIT
),gtk2
)
243 $(INSTALL
) $(IFLAGS1
) $(DIST
)/branding
/default16.png
$(DIST
)/bin
/chrome
/icons
/default
244 $(INSTALL
) $(IFLAGS1
) $(DIST
)/branding
/default32.png
$(DIST
)/bin
/chrome
/icons
/default
245 $(INSTALL
) $(IFLAGS1
) $(DIST
)/branding
/default48.png
$(DIST
)/bin
/chrome
/icons
/default
248 # XXX applications would need to supply this file
249 #export:: brand.dtd.in
250 # $(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $^ > brand.dtd
253 $(NSINSTALL
) -D
$(DIST
)/branding
254 ifeq ($(OS_ARCH
),WINNT
)
255 cp
$(srcdir)/xulrunner.ico
$(DIST
)/branding
/xulrunner.ico
256 cp
$(srcdir)/xulrunner.ico
$(DIST
)/branding
/app.ico
257 cp
$(srcdir)/document.ico
$(DIST
)/branding
/document.ico
259 ifneq (,$(filter gtk gtk2
,$(MOZ_WIDGET_TOOLKIT
)))
260 cp
$(srcdir)/mozicon16.xpm
$(DIST
)/branding
/mozicon16.xpm
261 cp
$(srcdir)/mozicon50.xpm
$(DIST
)/branding
/mozicon50.xpm
262 cp
$(srcdir)/document.png
$(DIST
)/branding
/document.png
264 ifeq ($(MOZ_WIDGET_TOOLKIT
),gtk2
)
265 cp
$(srcdir)/default16.png
$(DIST
)/branding
/default16.png
266 cp
$(srcdir)/default32.png
$(DIST
)/branding
/default32.png
267 cp
$(srcdir)/default48.png
$(DIST
)/branding
/default48.png
269 ifeq ($(OS_ARCH
),OS2
)
270 cp
$(srcdir)/xulrunner-os2.ico
$(DIST
)/branding
/xulrunner.ico
271 cp
$(srcdir)/xulrunner-os2.ico
$(DIST
)/branding
/app.ico
272 cp
$(srcdir)/document-os2.ico
$(DIST
)/branding
/document.ico
276 touch
$(DIST
)/bin
/.autoreg
278 ifneq (,$(filter mac cocoa
,$(MOZ_WIDGET_TOOLKIT
)))
281 FRAMEWORK_VERSION
= $(MOZILLA_VERSION
)
284 mkdir
-p
$(DIST
)/$(FRAMEWORK_NAME
).framework
/Versions
/$(FRAMEWORK_VERSION
)/Resources
285 $(NSINSTALL
) $(srcdir)/macbuild
/InfoPlist.strings
$(DIST
)/$(FRAMEWORK_NAME
).framework
/Versions
/$(FRAMEWORK_VERSION
)/Resources
286 sed
-e
"s/APP_VERSION/$(APP_VERSION)/" $(srcdir)/macbuild
/Info.plist.in
> $(DIST
)/$(FRAMEWORK_NAME
).framework
/Versions
/$(FRAMEWORK_VERSION
)/Info.plist
287 rsync
-a
$(DIST
)/bin
/ $(DIST
)/$(FRAMEWORK_NAME
).framework
/Versions
/$(FRAMEWORK_VERSION
) --exclude mangle
--exclude shlibsign
288 rm -f
$(DIST
)/$(FRAMEWORK_NAME
).framework
/Versions
/Current \
289 $(DIST
)/$(FRAMEWORK_NAME
).framework
/libxpcom.dylib \
290 $(DIST
)/$(FRAMEWORK_NAME
).framework
/XUL \
291 $(DIST
)/$(FRAMEWORK_NAME
).framework
/xulrunner-bin
292 ln
-s
$(FRAMEWORK_VERSION
) $(DIST
)/$(FRAMEWORK_NAME
).framework
/Versions
/Current
293 ln
-s Versions
/Current
/libxpcom.dylib
$(DIST
)/$(FRAMEWORK_NAME
).framework
/libxpcom.dylib
294 ln
-s Versions
/Current
/XUL
$(DIST
)/$(FRAMEWORK_NAME
).framework
/XUL
295 ln
-s Versions
/Current
/xulrunner-bin
$(DIST
)/$(FRAMEWORK_NAME
).framework
/xulrunner-bin
298 rm -rf
$(DIST
)/$(FRAMEWORK_NAME
).framework
301 README_FILE
= $(topsrcdir
)/README.txt
304 $(INSTALL
) $(IFLAGS1
) $(README_FILE
) $(DIST
)/bin
305 $(INSTALL
) $(IFLAGS1
) $(topsrcdir
)/LICENSE
$(DIST
)/bin