2003-05-27 10:49:16 +04:00
|
|
|
# ***** BEGIN LICENSE BLOCK *****
|
|
|
|
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
#
|
|
|
|
# The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
# http://www.mozilla.org/MPL/
|
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
# for the specific language governing rights and limitations under the
|
|
|
|
# License.
|
|
|
|
#
|
|
|
|
# The Original Code is mozilla.org code.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is
|
|
|
|
# Netscape Communications.
|
|
|
|
# Portions created by the Initial Developer are Copyright (C) 2003
|
|
|
|
# the Initial Developer. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
2003-09-29 10:04:02 +04:00
|
|
|
# Brian Ryner <bryner@brianryner.com>
|
2007-06-28 18:28:39 +04:00
|
|
|
# Mark Mentovai <mark@moxienet.com>
|
|
|
|
# Smokey Ardisson <alqahira@ardisson.org>
|
2003-05-27 10:49:16 +04:00
|
|
|
#
|
|
|
|
# Alternatively, the contents of this file may be used under the terms of
|
|
|
|
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
# in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
# of those above. If you wish to allow use of your version of this file only
|
|
|
|
# under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
# use your version of this file under the terms of the MPL, indicate your
|
|
|
|
# decision by deleting the provisions above and replace them with the notice
|
|
|
|
# and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
# the provisions above, a recipient may use your version of this file under
|
|
|
|
# the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
#
|
|
|
|
# ***** END LICENSE BLOCK *****
|
|
|
|
|
|
|
|
DEPTH = ..
|
|
|
|
topsrcdir = @top_srcdir@
|
|
|
|
srcdir = @srcdir@
|
|
|
|
VPATH = @srcdir@
|
|
|
|
|
|
|
|
include $(DEPTH)/config/autoconf.mk
|
|
|
|
|
2005-12-02 08:20:36 +03:00
|
|
|
DIRS = \
|
2007-02-21 23:24:55 +03:00
|
|
|
flashblock \
|
2008-01-10 21:39:56 +03:00
|
|
|
idl \
|
2005-12-02 08:20:36 +03:00
|
|
|
$(NULL)
|
|
|
|
|
2005-08-18 17:11:46 +04:00
|
|
|
APP_NAME = Camino
|
|
|
|
|
2007-07-11 07:48:04 +04:00
|
|
|
PYTHON ?= python
|
2007-12-17 19:21:00 +03:00
|
|
|
RSYNC_ALL = rsync -aC --exclude .cvsignore --delete
|
2007-07-11 07:48:04 +04:00
|
|
|
|
2007-08-29 03:54:19 +04:00
|
|
|
CM_APP_VERSION_FILE = $(srcdir)/config/version.txt
|
|
|
|
CM_APP_VERSION := $(shell cat $(CM_APP_VERSION_FILE))
|
|
|
|
CM_COPYRIGHT_YEAR_FILE = $(srcdir)/config/year.txt
|
|
|
|
CM_COPYRIGHT_YEAR := $(shell cat $(CM_COPYRIGHT_YEAR_FILE))
|
2007-07-11 07:48:04 +04:00
|
|
|
FOX_APP_VERSION_FILE = $(topsrcdir)/browser/config/version.txt
|
2007-07-11 09:38:37 +04:00
|
|
|
FOX_APP_VERSION := $(shell cat $(FOX_APP_VERSION_FILE))
|
2007-07-11 07:48:04 +04:00
|
|
|
PLATFORM_VERSION_FILE = $(topsrcdir)/config/milestone.txt
|
2007-07-11 09:38:37 +04:00
|
|
|
PLATFORM_VERSION := $(shell egrep "^[^\#]+" $(PLATFORM_VERSION_FILE))
|
2007-07-11 07:48:04 +04:00
|
|
|
PLATFORM_BUILD_ID_FILE = generated/platform_build_id
|
2007-12-17 19:21:00 +03:00
|
|
|
PLATFORM_BUILD_ID := \
|
|
|
|
$(shell $(PYTHON) \
|
|
|
|
$(topsrcdir)/toolkit/xre/make-platformini.py --print-buildid)
|
2007-07-11 09:38:37 +04:00
|
|
|
PLATFORM_INI_FILE = ../toolkit/xre/platform.ini
|
2008-01-09 04:31:00 +03:00
|
|
|
|
|
|
|
# For Launch Services compatibility, CFBundleVersion can be at most three
|
|
|
|
# .-separated integers, aaaaaa.bb.cc, with a maximum of 429496.99.99. Use
|
|
|
|
# Camino's major and minor version number and the build date as the basis for
|
|
|
|
# CFBundleVersion. This transforms version a.b (and any alphas, betas,
|
|
|
|
# prereleases, and bug-fix versions) built on date 20yy.mm.dd into
|
|
|
|
# CFBundleVersion abyy.mm.dd. Only a and b from the version need to be
|
|
|
|
# significant, since any further updates (a.b.c) will necessarily be built on
|
|
|
|
# future dates, and will have larger CFBundleVersion values. This mapping
|
|
|
|
# assumes 0 <= b <= 9 and is not year 2100-compliant. There is currently no
|
|
|
|
# CM_APP_VERSION_CFBUNDLE_FILE to depend on; any rule that uses this value
|
|
|
|
# should depend on CM_APP_VERSION_FILE and PLATFORM_BUILD_ID_FILE.
|
|
|
|
CM_APP_VERSION_CFBUNDLE := $(shell echo $(CM_APP_VERSION)@$(PLATFORM_BUILD_ID) | \
|
|
|
|
sed -E -e 's/^([0-9]+)\.([0-9]).*@[02]0([0-9]{2})([0-9]{2})([0-9]{2})[0-9]{2}$$/\1\2\3.\4.\5/')
|
|
|
|
|
|
|
|
# Info.plist needs to have keys for some values removed, instead of placing
|
|
|
|
# empty values. Start out with a pattern that doesn't exist to give something
|
|
|
|
# to append "or" regex clauses to.
|
|
|
|
GREP_V_PATTERN = __dummy__
|
|
|
|
|
|
|
|
# If a CVS tag (or branch) can be determined, use it as the CVS tag name in
|
|
|
|
# Info.plist. If no tag can be found, set up to remove the relevant key from
|
|
|
|
# Info.plist.
|
|
|
|
CVS_TAG_FILE = generated/cvs_tag
|
|
|
|
CVS_TAG := $(shell if [ -d $(srcdir)/CVS ] ; then \
|
|
|
|
if [ -f $(srcdir)/CVS/Tag ] ; then \
|
2008-01-09 05:14:52 +03:00
|
|
|
sed -e 's/^D.*/HEAD/' -e 's/^[NT]//' $(srcdir)/CVS/Tag ; \
|
2008-01-09 04:31:00 +03:00
|
|
|
else \
|
|
|
|
echo HEAD ; \
|
|
|
|
fi \
|
|
|
|
fi)
|
|
|
|
ifdef CVS_TAG
|
|
|
|
SED_ARGS += -e "s/%CVS_TAG%/$(CVS_TAG)/"
|
|
|
|
else # CVS_TAG
|
|
|
|
# Add the extra dummy pattern to ensure that make can't add whitespace to the
|
|
|
|
# strings we care about.
|
|
|
|
GREP_V_PATTERN += \|MozillaCVSTag\|%CVS_TAG%\|__dummy__
|
|
|
|
endif # CVS_TAG
|
|
|
|
|
|
|
|
# If MOZ_CO_DATE is set, use it as the CVS time in Info.plist. If it doesn't
|
|
|
|
# exist, set up to remove the relevant key from Info.plist.
|
|
|
|
CVS_TIME_FILE = generated/cvs_time
|
|
|
|
ifdef MOZ_CO_DATE
|
|
|
|
CVS_TIME := $(shell $(PERL) $(srcdir)/config/mozcodate2iso8601 "$(MOZ_CO_DATE)")
|
|
|
|
ifndef CVS_TIME
|
|
|
|
# Fail if the MOZ_CO_DATE format ever changes.
|
|
|
|
CVS_TIME := $(error mozcodate2iso8601)
|
|
|
|
endif # !CVS_TIME
|
|
|
|
SED_ARGS += -e "s/%CVS_TIME%/$(CVS_TIME)/"
|
|
|
|
else # MOZ_CO_DATE
|
|
|
|
# Add the extra dummy pattern to ensure that make can't add whitespace to the
|
|
|
|
# strings we care about.
|
|
|
|
GREP_V_PATTERN += \|MozillaCVSTime\|%CVS_TIME%\|__dummy__
|
|
|
|
endif # MOZ_CO_DATE
|
|
|
|
|
2007-12-17 19:21:00 +03:00
|
|
|
STRINGS_FILES = \
|
|
|
|
resources/localized/English.lproj/CertificateDialogs.strings \
|
2007-10-23 06:44:30 +04:00
|
|
|
resources/localized/English.lproj/Localizable.strings \
|
|
|
|
PreferencePanes/Appearance/English.lproj/Localizable.strings \
|
|
|
|
PreferencePanes/Appearance/English.lproj/RegionNames.strings \
|
|
|
|
PreferencePanes/Downloads/English.lproj/Localizable.strings \
|
2007-12-15 00:50:11 +03:00
|
|
|
PreferencePanes/General/English.lproj/Localizable.strings \
|
2007-10-23 06:44:30 +04:00
|
|
|
PreferencePanes/History/English.lproj/Localizable.strings \
|
|
|
|
PreferencePanes/Privacy/English.lproj/Localizable.strings \
|
|
|
|
PreferencePanes/Security/English.lproj/Localizable.strings \
|
|
|
|
PreferencePanes/Tabs/English.lproj/Localizable.strings \
|
|
|
|
PreferencePanes/WebFeatures/English.lproj/Localizable.strings \
|
|
|
|
$(NULL)
|
|
|
|
GENERATED_STRINGS_FILES = $(patsubst %,generated/%,$(STRINGS_FILES))
|
2007-06-28 18:28:39 +04:00
|
|
|
|
2003-05-27 10:49:16 +04:00
|
|
|
ifdef MOZ_DEBUG
|
|
|
|
BUILDSTYLE = Development
|
|
|
|
else
|
|
|
|
BUILDSTYLE = Deployment
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef BUILD_STATIC_LIBS
|
|
|
|
TARGET = CaminoStatic
|
|
|
|
else
|
|
|
|
TARGET = Camino
|
|
|
|
endif
|
|
|
|
|
2007-12-17 19:21:00 +03:00
|
|
|
GARBAGE += \
|
|
|
|
$(PLATFORM_INI_FILE) \
|
|
|
|
$(DIST)/bin/platform.ini \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
GARBAGE_DIRS += \
|
|
|
|
build \
|
2007-07-14 10:03:23 +04:00
|
|
|
$(DIST)/$(APP_NAME).app \
|
|
|
|
embed-replacements.tmp \
|
|
|
|
generated \
|
2007-11-24 23:04:51 +03:00
|
|
|
sparkle/build \
|
2007-07-14 10:03:23 +04:00
|
|
|
$(NULL)
|
2004-12-28 22:17:01 +03:00
|
|
|
|
2003-05-27 10:49:16 +04:00
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
|
2005-06-02 03:56:54 +04:00
|
|
|
unexport CC CXX
|
|
|
|
|
2003-05-27 10:49:16 +04:00
|
|
|
ABS_topsrcdir := $(shell cd $(topsrcdir); pwd)
|
2005-05-09 17:48:19 +04:00
|
|
|
|
2003-05-27 10:49:16 +04:00
|
|
|
export::
|
2007-12-17 19:21:00 +03:00
|
|
|
mkdir -p wallet/tables
|
|
|
|
ln -fs $(ABS_topsrcdir)/extensions/wallet/src/*.tbl wallet/tables
|
2005-05-09 17:48:19 +04:00
|
|
|
ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
|
2007-12-17 19:21:00 +03:00
|
|
|
$(RSYNC_ALL) $(srcdir)/Camino.xcodeproj .
|
2003-05-27 10:49:16 +04:00
|
|
|
ln -fs $(srcdir)/src
|
|
|
|
ln -fs $(srcdir)/resources
|
2007-07-19 00:52:35 +04:00
|
|
|
ln -fs $(srcdir)/config
|
2007-11-24 23:04:51 +03:00
|
|
|
mkdir -p sparkle
|
|
|
|
rm -rf sparkle/Sparkle.xcodeproj
|
|
|
|
ln -fs $(ABS_topsrcdir)/camino/sparkle/* sparkle
|
|
|
|
rm -rf sparkle/Sparkle.xcodeproj
|
2007-12-17 19:21:00 +03:00
|
|
|
$(RSYNC_ALL) $(ABS_topsrcdir)/camino/sparkle/Sparkle.xcodeproj sparkle
|
2003-05-27 10:49:16 +04:00
|
|
|
ln -fs $(srcdir)/PreferencePanes
|
2005-01-16 23:33:48 +03:00
|
|
|
ln -fs $(srcdir)/Info-*.plist .
|
2003-05-27 10:49:16 +04:00
|
|
|
endif
|
|
|
|
|
2007-06-28 18:28:39 +04:00
|
|
|
generated:
|
|
|
|
mkdir -p $@
|
|
|
|
|
2007-12-17 19:21:00 +03:00
|
|
|
# Generate files which need to pull version numbers or dates from other files
|
|
|
|
# in the tree
|
|
|
|
generated/resources/application/all-camino.js: \
|
|
|
|
$(srcdir)/resources/application/all-camino.js.in \
|
|
|
|
$(FOX_APP_VERSION_FILE) \
|
|
|
|
$(CM_APP_VERSION_FILE) \
|
|
|
|
generated
|
2007-10-23 06:44:30 +04:00
|
|
|
mkdir -p $(dir $@)
|
2007-08-29 03:54:19 +04:00
|
|
|
sed -e "s/%FOX_APP_VERSION%/$(FOX_APP_VERSION)/" \
|
|
|
|
-e "s/%CM_APP_VERSION%/$(CM_APP_VERSION)/" $< > $@
|
|
|
|
|
2007-12-17 19:21:00 +03:00
|
|
|
generated/Info-Camino.plist: \
|
|
|
|
$(srcdir)/Info-Camino.plist.in \
|
|
|
|
$(CM_APP_VERSION_FILE) \
|
|
|
|
$(CM_COPYRIGHT_YEAR_FILE) \
|
2008-01-09 04:31:00 +03:00
|
|
|
$(PLATFORM_BUILD_ID_FILE) \
|
|
|
|
$(PLATFORM_VERSION_FILE) \
|
|
|
|
$(CVS_TAG_FILE) \
|
|
|
|
$(CVS_TIME_FILE) \
|
2007-12-17 19:21:00 +03:00
|
|
|
generated
|
2007-10-23 06:44:30 +04:00
|
|
|
mkdir -p $(dir $@)
|
2007-08-29 03:54:19 +04:00
|
|
|
sed -e "s/%CM_APP_VERSION%/$(CM_APP_VERSION)/" \
|
2008-01-09 04:31:00 +03:00
|
|
|
-e "s/%CM_APP_VERSION_CFBUNDLE%/$(CM_APP_VERSION_CFBUNDLE)/" \
|
|
|
|
-e "s/%CM_COPYRIGHT_YEAR%/$(CM_COPYRIGHT_YEAR)/" \
|
|
|
|
-e "s/%PLATFORM_BUILD_ID%/$(PLATFORM_BUILD_ID)/" \
|
|
|
|
-e "s/%PLATFORM_VERSION%/$(PLATFORM_VERSION)/" \
|
|
|
|
$(SED_ARGS) $< | \
|
|
|
|
grep -v "$(GREP_V_PATTERN)" > $@
|
2007-08-29 03:54:19 +04:00
|
|
|
|
2007-12-17 19:21:00 +03:00
|
|
|
generated/resources/localized/English.lproj/InfoPlist.strings: \
|
|
|
|
$(srcdir)/resources/localized/English.lproj/InfoPlist.strings.in \
|
|
|
|
$(CM_APP_VERSION_FILE) \
|
|
|
|
$(CM_COPYRIGHT_YEAR_FILE) \
|
|
|
|
generated
|
2007-10-23 06:44:30 +04:00
|
|
|
mkdir -p $(dir $@)
|
2007-08-29 03:54:19 +04:00
|
|
|
sed -e "s/%CM_APP_VERSION%/$(CM_APP_VERSION)/" \
|
|
|
|
-e "s/%CM_COPYRIGHT_YEAR%/$(CM_COPYRIGHT_YEAR)/" $< | \
|
|
|
|
iconv -f UTF-8 -t UTF-16 > $@
|
2007-07-11 07:48:04 +04:00
|
|
|
|
2007-12-17 19:21:00 +03:00
|
|
|
# Generate UTF-16 with BOM strings files from UTF-8 strings.in files. On Mac
|
|
|
|
# OS X, iconv seems always to output big-endian when asked for UTF-16 with a
|
|
|
|
# BOM, which is what AppleGlot seems to require.
|
|
|
|
$(GENERATED_STRINGS_FILES): \
|
|
|
|
generated/%.strings: $(srcdir)/%.strings.in \
|
|
|
|
generated
|
2007-10-23 06:44:30 +04:00
|
|
|
mkdir -p $(dir $@)
|
|
|
|
iconv -f UTF-8 -t UTF-16 $< > $@
|
|
|
|
|
2008-01-09 04:31:00 +03:00
|
|
|
# The "grep -lFx" construct in these rules will only touch the file if the
|
|
|
|
# contents are changing. The file's timestamp will be preserved when the
|
|
|
|
# contents aren't changing, reducing unnecessary build activity.
|
|
|
|
|
2008-01-09 05:00:24 +03:00
|
|
|
$(PLATFORM_BUILD_ID_FILE): FORCE generated
|
2007-07-11 07:48:04 +04:00
|
|
|
grep -lFx "$(PLATFORM_BUILD_ID)" $@ >& /dev/null || \
|
|
|
|
echo $(PLATFORM_BUILD_ID) > $@
|
|
|
|
|
2008-01-09 05:00:24 +03:00
|
|
|
$(CVS_TAG_FILE): FORCE generated
|
2008-01-09 04:31:00 +03:00
|
|
|
grep -lFx "$(CVS_TAG)" $@ >& /dev/null || \
|
|
|
|
echo $(CVS_TAG) > $@
|
|
|
|
|
2008-01-09 05:00:24 +03:00
|
|
|
$(CVS_TIME_FILE): FORCE generated
|
2008-01-09 04:31:00 +03:00
|
|
|
grep -lFx "$(CVS_TIME)" $@ >& /dev/null || \
|
|
|
|
echo $(CVS_TIME) > $@
|
|
|
|
|
2007-07-11 09:38:37 +04:00
|
|
|
# Put platform.ini into toolkit/xre and dist/bin, because that's where
|
|
|
|
# Tinderbox looks to figure out the build ID. It currently doesn't need
|
|
|
|
# to be distributed with the application.
|
2007-07-11 07:48:04 +04:00
|
|
|
$(PLATFORM_INI_FILE): $(PLATFORM_BUILD_ID_FILE) $(PLATFORM_VERSION_FILE)
|
2007-07-11 09:38:37 +04:00
|
|
|
mkdir -p `dirname $@`
|
2007-07-11 07:48:04 +04:00
|
|
|
echo [Build] > $@
|
|
|
|
echo BuildID=$(PLATFORM_BUILD_ID) >> $@
|
|
|
|
echo Milestone=$(PLATFORM_VERSION) >> $@
|
2007-07-11 09:38:37 +04:00
|
|
|
$(INSTALL) $@ $(DIST)/bin
|
2007-07-11 07:48:04 +04:00
|
|
|
|
2006-04-14 05:50:16 +04:00
|
|
|
# The embed-replacements rsync is done for both srcdir and objdir builds
|
|
|
|
# to avoid adding CVS stuff to embed.jar.
|
2007-12-17 19:21:00 +03:00
|
|
|
libs:: \
|
|
|
|
generated/resources/application/all-camino.js \
|
|
|
|
generated/Info-Camino.plist \
|
|
|
|
generated/resources/localized/English.lproj/InfoPlist.strings \
|
|
|
|
$(GENERATED_STRINGS_FILES) \
|
|
|
|
$(PLATFORM_INI_FILE)
|
|
|
|
$(RSYNC_ALL) $(srcdir)/embed-replacements/ embed-replacements.tmp
|
|
|
|
cd embed-replacements.tmp && \
|
|
|
|
$(ZIP) -r0DX ../../dist/Embed/chrome/embed.jar *
|
|
|
|
$(PBBUILD) -project Camino.xcodeproj -target $(TARGET) \
|
|
|
|
-configuration $(BUILDSTYLE) $(PBBUILD_SETTINGS)
|
|
|
|
$(RSYNC_ALL) --copy-unsafe-links \
|
|
|
|
$(XCODE_PRODUCT_DIR)/Camino.app/ $(DIST)/$(APP_NAME).app
|
2006-04-19 18:36:21 +04:00
|
|
|
$(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/components/camino.xpt
|
2007-12-17 19:21:00 +03:00
|
|
|
$(XPIDL_LINK) $(DIST)/$(APP_NAME).app/Contents/MacOS/camino.xpt \
|
|
|
|
$(DIST)/$(APP_NAME).app/Contents/MacOS/components/*.xpt
|
2006-04-19 07:14:43 +04:00
|
|
|
$(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/components/*.xpt
|
2007-12-17 19:21:00 +03:00
|
|
|
mv $(DIST)/$(APP_NAME).app/Contents/MacOS/camino.xpt \
|
|
|
|
$(DIST)/$(APP_NAME).app/Contents/MacOS/components/camino.xpt
|