1 # ***** BEGIN LICENSE BLOCK *****
2 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 # The contents of this file are subject to the Mozilla Public License Version
5 # 1.1 (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
7 # http://www.mozilla.org/MPL/
9 # Software distributed under the License is distributed on an "AS IS" basis,
10 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 # for the specific language governing rights and limitations under the
14 # The Original Code is mozilla.org code.
16 # The Initial Developer of the Original Code is
17 # Netscape Communications.
18 # Portions created by the Initial Developer are Copyright (C) 2001
19 # the Initial Developer. All Rights Reserved.
22 # Brian Ryner <bryner@brianryner.com>
23 # Jonathan Wilson <jonwil@tpgi.com.au>
24 # Dan Mosedale <dmose@mozilla.org>
25 # Benjamin Smedberg <benjamin@smedbergs.us>
26 # Laurent Jouanneau <laurent.jouanneau@disruptive-innovations.com>
28 # Alternatively, the contents of this file may be used under the terms of
29 # either the GNU General Public License Version 2 or later (the "GPL"), or
30 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 # in which case the provisions of the GPL or the LGPL are applicable instead
32 # of those above. If you wish to allow use of your version of this file only
33 # under the terms of either the GPL or the LGPL, and not to allow others to
34 # use your version of this file under the terms of the MPL, indicate your
35 # decision by deleting the provisions above and replace them with the notice
36 # and other provisions required by the GPL or the LGPL. If you do not delete
37 # the provisions above, a recipient may use your version of this file under
38 # the terms of any one of the MPL, the GPL or the LGPL.
40 # ***** END LICENSE BLOCK *****
43 topsrcdir = @top_srcdir@
47 include $(DEPTH)/config/autoconf.mk
49 PREF_JS_EXPORTS = $(srcdir)/profile/bluegriffon-prefs.js \
52 # hardcoded en-US for the moment
54 #AB_CD = $(MOZ_UI_LOCALE)
56 APP_UA_NAME = $(shell echo $(MOZ_APP_DISPLAYNAME) | sed -e's/[^A-Za-z]//g')
57 APP_BINARY = $(MOZ_APP_NAME)$(BIN_SUFFIX)
58 APP_VERSION = $(shell cat $(srcdir)/../config/version.txt)
60 DIST_FILES = application.ini
62 GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
63 GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
67 -DAPP_NAME=$(MOZ_APP_DISPLAYNAME) \
68 -DAPP_VERSION=$(APP_VERSION) \
69 -DAPP_UA_NAME="$(APP_UA_NAME)" \
70 -DGRE_BUILDID=$(GRE_BUILDID) \
71 -DGRE_MILESTONE=$(GRE_MILESTONE) \
72 -DMOZ_APP_NAME=$(MOZ_APP_NAME) \
76 LIBS += $(JEMALLOC_LIBS)
79 include $(topsrcdir)/config/rules.mk
82 # Build a binary bootstrapping with XRE_main
84 ifeq ($(USE_SHORT_LIBNAME), 1)
85 PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
87 PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
96 CPPSRCS = nsEditorApp.cpp
98 LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
100 ifdef BUILD_STATIC_LIBS
102 STATIC_COMPONENTS_LINKER_PATH = -LIBPATH:$(DEPTH)/staticlib
104 STATIC_COMPONENTS_LINKER_PATH = -L$(DEPTH)/staticlib
106 LIBS += $(MOZDEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
108 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
109 LIBS += $(DIST)/bin/XUL
111 EXTRA_DSO_LIBS += xul
115 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
116 TK_LIBS := -framework Cocoa $(TK_LIBS)
119 ifdef MOZ_ENABLE_LIBXUL
120 APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
122 MOZILLA_INTERNAL_API = 1
123 APP_XPCOM_LIBS = $(XPCOM_LIBS)
127 $(STATIC_COMPONENTS_LINKER_PATH) \
135 # Add explicit X11 dependency when building against X11 toolkits
136 ifneq (,$(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)))
137 LIBS += $(XLDFLAGS) $(XLIBS) $(ZLIB_LIBS)
144 ifndef MOZ_WINCONSOLE
154 include $(topsrcdir)/config/config.mk
157 # Always enter a Windows program through wmain, whether or not we're
158 # a console application.
159 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
162 ifndef BUILD_STATIC_LIBS
164 ifdef NS_TRACE_MALLOC
165 EXTRA_DSO_LIBS += tracemalloc
169 include $(topsrcdir)/config/static-config.mk
172 $(STATIC_EXTRA_DEPS) \
174 DEFINES += $(STATIC_DEFINES)
175 CPPSRCS += $(STATIC_CPPSRCS)
176 EXTRA_DSO_LIBS += $(STATIC_EXTRA_DSO_LIBS)
177 REQUIRES += $(STATIC_REQUIRES)
178 EXTRA_LIBS += $(STATIC_EXTRA_LIBS)
182 ifeq ($(OS_ARCH),WINNT)
183 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
184 OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
185 RCINCLUDE = splash.rc
187 RCFLAGS += -I$(srcdir)
189 RCFLAGS += --include-dir $(srcdir)
191 ifdef BUILD_STATIC_LIBS
192 RCFLAGS += -DMOZ_STATIC_BUILD
199 ifeq ($(OS_ARCH),BeOS)
200 #BEOS_PROGRAM_RESOURCE = $(srcdir)/apprunner-beos.rsrc
201 ifdef BUILD_STATIC_LIBS
202 OS_LIBS += -ltracker -lgame
206 #ifeq ($(OS_ARCH),OS2)
207 #RESFILE=splashos2.res
208 #ifdef BUILD_STATIC_LIBS
209 #EXE_DEF_FILE = bluegriffon.def
210 #RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include/widget
215 #RCFLAGS += -DCOMPOSER_ICO=\"$(srcdir)/icons/bluegriffon.ico\" -DDOCUMENT_ICO=\"$(srcdir)/icons/bluegriffon.ico\"
218 include $(topsrcdir)/config/rules.mk
221 DEFINES += -DCOMPOSER_ICO=\"$(srcdir)/icons/bluegriffon.ico\" -DDOCUMENT_ICO=\"$(srcdir)/icons/bluegriffon.ico\"
223 ifdef BUILD_STATIC_LIBS
224 include $(topsrcdir)/config/static-rules.mk
226 DEFINES += -DIMPL_XREAPI
229 ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
233 ifeq ($(OS_ARCH),WINNT)
235 # Control the default heap size.
236 # This is the heap returned by GetProcessHeap().
237 # As we use the CRT heap, the default size is too large and wastes VM.
239 # The default heap size is 1MB on Win32.
240 # The heap will grow if need be.
242 # Set it to 256k. See bug 127069.
245 LDFLAGS += /HEAP:0x40000
249 $(PROGRAM): $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
251 ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
253 $(MOZ_APP_NAME):: mozilla.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk
254 cat $< | sed -e "s|%MOZAPPDIR%|$(installdir)|" \
255 -e "s|%MREDIR%|$(mredir)|" \
256 -e "s|%MOZILLA-BIN%|$(PROGRAM)|g" \
257 -e "s|%MOZ_APP_DISPLAYNAME%|$(MOZ_APP_DISPLAYNAME)|" > $@
260 libs:: $(MOZ_APP_NAME)
261 $(INSTALL) $< $(DIST)/bin
263 install:: $(MOZ_APP_NAME)
264 $(SYSINSTALL) $< $(DESTDIR)$(bindir)
266 GARBAGE += $(MOZ_APP_NAME)
267 GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, bluegriffon-prefs.js)
271 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
272 ifdef BUILD_STATIC_LIBS
273 LIBS += -lcups -framework AddressBook
281 ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
283 $(srcdir)/icons/bluegriffon50.xpm \
284 $(srcdir)/icons/bluegriffon50.png \
285 $(srcdir)/icons/bluegriffon16.xpm \
286 $(srcdir)/icons/bluegriffon16.png \
289 $(INSTALL) $(ICON_FILES) $(DIST)/bin/icons/
292 $(SYSINSTALL) $(IFLAGS1) $(ICON_FILES) $(DESTDIR)$(mozappdir)/icons
295 ifneq (,$(filter windows os2,$(MOZ_WIDGET_TOOLKIT)))
296 #libs:: $(DESKTOP_ICONS)
297 # $(INSTALL) $^ $(DIST)/bin/chrome/icons/default
301 touch $(DIST)/bin/.autoreg
304 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
306 APP_NAME = $(MOZ_APP_DISPLAYNAME)
309 APP_NAME := $(APP_NAME)Debug
312 AB := $(firstword $(subst -, ,$(AB_CD)))
314 clean clobber repackage::
315 rm -rf $(DIST)/$(APP_NAME).app
323 libs repackage:: $(PROGRAM) application.ini
324 mkdir -p $(DIST)/$(APP_NAME).app/Contents/MacOS
325 rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj
326 mkdir -p $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
327 rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
328 sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist
329 sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj/InfoPlist.strings
330 rsync -a $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
331 $(RM) $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/mangle $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/shlibsign
333 cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(APP_NAME).app/Contents/MacOS/firefox-bin
335 rm -f $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
336 rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
338 mkdir -p $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
339 rsync -a --copy-unsafe-links $(LIBXUL_DIST)/package/PrintPDE.plugin $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
340 # -cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
341 cp -RL $(srcdir)/macbuild/Contents/Resources/bluegriffon.icns $(DIST)/$(APP_NAME).app/Contents/Resources/bluegriffon.icns
342 echo -n APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
343 # remove CVS dirs from packaged app
344 find $(DIST)/$(APP_NAME).app -type d -name "CVS" -prune -exec rm -rf {} \;
345 find $(DIST)/$(APP_NAME).app -type d -name ".svn" -prune -exec rm -rf {} \;
349 cp $(LIBXUL_DIST)/bin/xulrunner-stub$(BIN_SUFFIX) $(DIST)/bin/firefox$(BIN_SUFFIX)
354 ifeq ($(OS_ARCH),WINNT)
355 $(PERL) -pe 's/(?<!\r)\n/\r\n/g;' < $(topsrcdir)/LICENSE > $(DIST)/bin/LICENSE
357 $(INSTALL) $(topsrcdir)/LICENSE $(DIST)/bin
361 ifndef SKIP_COPY_XULRUNNER
363 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
364 rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(APP_NAME).app/Contents/Frameworks
366 $(NSINSTALL) -D $(DIST)/bin/xulrunner
367 (cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -)
369 endif # SKIP_COPY_XULRUNNER