Bug 424363 - Customize Toolbar ? Restore Default Set uses gtk-refresh instead of...
[wine-gecko.git] / xulrunner / app / Makefile.in
blob50ddfdc5ec1e54bb4f321f5f3313cbb3b5adac6a
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
13 # License.
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.
22 # Contributor(s):
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 *****
43 DEPTH = ../..
44 topsrcdir = @top_srcdir@
45 srcdir = @srcdir@
46 VPATH = @srcdir@
48 include $(DEPTH)/config/autoconf.mk
50 DIRS = profile
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)
59 else
60 ifeq ($(OS_ARCH), BeOS)
61 PROGRAM = xulrunner$(BIN_SUFFIX)
62 else
63 PROGRAM = xulrunner-bin$(BIN_SUFFIX)
64 endif
65 endif
67 DEFINES += -DXULRUNNER_PROGNAME=\"xulrunner\"
69 ifdef MOZ_JAVAXPCOM
70 DEFINES += -DMOZ_JAVAXPCOM
71 endif
73 ifdef TARGET_XPCOM_ABI
74 DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
75 endif
77 REQUIRES = \
78 xpcom \
79 string \
80 appshell \
81 xulapp \
82 xulrunner \
83 $(NULL)
85 CPPSRCS = nsXULRunnerApp.cpp
87 ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
88 CPPSRCS += nsRegisterGREWin.cpp
89 else
90 ifneq (,$(filter OS2 Darwin,$(OS_ARCH)))
91 CPPSRCS += nsRegisterGREVoid.cpp
92 else
93 CPPSRCS += nsRegisterGREUnix.cpp
94 endif
95 endif
97 LOCAL_INCLUDES += \
98 -I$(topsrcdir)/toolkit/xre \
99 -I$(topsrcdir)/toolkit/profile/src \
100 $(NULL)
102 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
103 TK_LIBS := -framework Cocoa $(TK_LIBS)
104 endif
106 ifndef MOZ_ENABLE_LIBXUL
107 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
108 LIBS += $(DIST)/bin/XUL
109 else
110 EXTRA_DSO_LIBS += xul
111 endif
112 endif
114 LIBS += \
115 $(EXTRA_DSO_LIBS) \
116 $(MOZ_JS_LIBS) \
117 $(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
118 $(XPCOM_LIBS) \
119 $(NSPR_LIBS) \
120 $(TK_LIBS) \
121 $(NULL)
123 # Add explicit X11 dependency when building against X11 toolkits
124 ifneq (,$(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)))
125 LIBS += $(XLDFLAGS) $(XLIBS)
126 endif
128 ifdef MOZ_JPROF
129 LIBS += -ljprof
130 endif
132 ifndef MOZ_WINCONSOLE
133 ifdef MOZ_DEBUG
134 MOZ_WINCONSOLE = 1
135 else
136 MOZ_WINCONSOLE = 0
137 endif
138 endif
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.
143 NSDISTMODE = copy
145 include $(topsrcdir)/config/config.mk
147 ifdef _MSC_VER
148 # Always enter a Windows program through wmain, whether or not we're
149 # a console application.
150 ifdef WINCE
151 WIN32_EXE_LDFLAGS += -ENTRY:mainWCRTStartup
152 else
153 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
154 endif
155 endif
157 ifeq ($(OS_ARCH),WINNT)
158 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
159 RCINCLUDE = splash.rc
160 ifndef GNU_CC
161 RCFLAGS += -DMOZ_XULRUNNER -I$(srcdir)
162 else
163 RCFLAGS += -DMOZ_XULRUNNER --include-dir $(srcdir)
164 endif
165 ifdef DEBUG
166 RCFLAGS += -DDEBUG
167 endif
168 endif
170 ifeq ($(OS_ARCH),BeOS)
171 OS_LIBS += -ltracker
172 endif
174 ifeq ($(OS_ARCH),OS2)
175 RESFILE=splashos2.res
176 RCFLAGS += -DMOZ_XULRUNNER
177 ifdef DEBUG
178 RCFLAGS += -DDEBUG
179 endif
180 RCFLAGS += -DXULRUNNER_ICO=\"$(DIST)/branding/xulrunner.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\"
181 endif
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)
190 LIBS += -lphexlib
191 endif
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.
204 ifndef GNU_CC
205 LDFLAGS += /HEAP:0x40000
206 endif
207 endif
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)|" > $@
215 chmod +x $@
217 libs:: xulrunner
218 $(INSTALL) $< $(DIST)/bin
220 install:: xulrunner
221 $(SYSINSTALL) $< $(DESTDIR)$(bindir)
223 GARBAGE += xulrunner
224 endif
226 ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
228 ICON_FILES = \
229 $(DIST)/branding/mozicon50.xpm \
230 $(DIST)/branding/mozicon16.xpm \
231 $(DIST)/branding/document.png \
232 $(NULL)
234 libs:: $(ICON_FILES)
235 $(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/icons
237 install::
238 $(SYSINSTALL) $(IFLAGS1) $(ICON_FILES) $(DESTDIR)$(mozappdir)/icons
239 endif
241 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
242 libs::
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
246 endif
248 # XXX applications would need to supply this file
249 #export:: brand.dtd.in
250 # $(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $^ > brand.dtd
252 export::
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
258 endif
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
263 endif
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
268 endif
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
273 endif
275 libs::
276 touch $(DIST)/bin/.autoreg
278 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
280 FRAMEWORK_NAME = XUL
281 FRAMEWORK_VERSION = $(MOZILLA_VERSION)
283 libs:: $(PROGRAM)
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
297 clean clobber::
298 rm -rf $(DIST)/$(FRAMEWORK_NAME).framework
299 endif
301 README_FILE = $(topsrcdir)/README.txt
303 libs::
304 $(INSTALL) $(IFLAGS1) $(README_FILE) $(DIST)/bin
305 $(INSTALL) $(IFLAGS1) $(topsrcdir)/LICENSE $(DIST)/bin