2015-09-24 04:40:54 +03:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
|
|
# /!\ Please make sure to update the following comment when you touch this
|
|
|
|
# file. Thank you /!\
|
|
|
|
|
|
|
|
# The traditional Mozilla build system relied on going through the entire
|
|
|
|
# build tree a number of times with different targets, and many of the
|
|
|
|
# things happening at each step required other things happening in previous
|
|
|
|
# steps without any documentation of those dependencies.
|
|
|
|
#
|
|
|
|
# This new build system tries to start afresh by establishing what files or
|
|
|
|
# operations are needed for the build, and applying the necessary rules to
|
|
|
|
# have those in place, relying on make dependencies to get them going.
|
|
|
|
#
|
|
|
|
# As of writing, only building non-compiled parts of Firefox is supported
|
|
|
|
# here (a few other things are also left out). This is a starting point, with
|
|
|
|
# the intent to grow this build system to make it more complete.
|
|
|
|
#
|
|
|
|
# This file contains rules and dependencies to get things working. The intent
|
|
|
|
# is for a Makefile to define some dependencies and variables, and include
|
|
|
|
# this file. What needs to be defined there, and ends up being generated by
|
|
|
|
# python/mozbuild/mozbuild/backend/fastermake.py is the following:
|
|
|
|
# - TOPSRCDIR/TOPOBJDIR, respectively the top source directory and the top
|
|
|
|
# object directory
|
|
|
|
# - PYTHON, the path to the python executable
|
|
|
|
# - ACDEFINES, which contains a set of -Dvar=name to be used during
|
|
|
|
# preprocessing
|
|
|
|
# - INSTALL_MANIFESTS, which defines the list of base directories handled
|
|
|
|
# by install manifests, see further below
|
|
|
|
#
|
|
|
|
# A convention used between this file and the Makefile including it is that
|
|
|
|
# global Make variables names are uppercase, while "local" Make variables
|
|
|
|
# applied to specific targets are lowercase.
|
|
|
|
|
|
|
|
# Targets to be triggered for a default build
|
|
|
|
default: $(addprefix install-,$(INSTALL_MANIFESTS))
|
|
|
|
|
2015-11-30 11:39:47 +03:00
|
|
|
ifndef NO_XPIDL
|
2015-09-25 11:18:45 +03:00
|
|
|
# Targets from the recursive make backend to be built for a default build
|
|
|
|
default: $(TOPOBJDIR)/config/makefiles/xpidl/xpidl
|
2015-11-30 11:39:47 +03:00
|
|
|
endif
|
2015-09-25 11:18:45 +03:00
|
|
|
|
2015-10-07 03:47:24 +03:00
|
|
|
# Mac builds require to copy things in dist/bin/*.app
|
2015-11-30 11:43:06 +03:00
|
|
|
# TODO: remove the MOZ_WIDGET_TOOLKIT and MOZ_BUILD_APP variables from
|
|
|
|
# faster/Makefile and python/mozbuild/mozbuild/test/backend/test_build.py
|
|
|
|
# when this is not required anymore.
|
2016-01-22 05:13:26 +03:00
|
|
|
# We however don't need to do this when using the hybrid
|
|
|
|
# FasterMake/RecursiveMake backend (FASTER_RECURSIVE_MAKE is set when
|
|
|
|
# recursing from the RecursiveMake backend)
|
|
|
|
ifndef FASTER_RECURSIVE_MAKE
|
|
|
|
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
2015-10-07 03:47:24 +03:00
|
|
|
default:
|
|
|
|
$(MAKE) -C $(TOPOBJDIR)/$(MOZ_BUILD_APP)/app repackage
|
|
|
|
endif
|
2016-01-22 05:13:26 +03:00
|
|
|
endif
|
2015-10-07 03:47:24 +03:00
|
|
|
|
2015-09-24 04:40:54 +03:00
|
|
|
.PHONY: FORCE
|
|
|
|
|
|
|
|
# Extra define to trigger some workarounds. We should strive to limit the
|
2015-10-01 01:21:55 +03:00
|
|
|
# use of those. As of writing the only ones are in
|
|
|
|
# toolkit/content/buildconfig.html and browser/locales/jar.mn.
|
2015-09-24 04:40:54 +03:00
|
|
|
ACDEFINES += -DBUILD_FASTER
|
|
|
|
|
|
|
|
# Files under the faster/ sub-directory, however, are not meant to use the
|
|
|
|
# fallback
|
|
|
|
$(TOPOBJDIR)/faster/%: ;
|
|
|
|
|
2016-01-23 22:38:00 +03:00
|
|
|
# Generic rule to fall back to the recursive make backend.
|
|
|
|
# This needs to stay after other $(TOPOBJDIR)/* rules because GNU Make
|
|
|
|
# <3.82 apply pattern rules in definition order, not stem length like
|
|
|
|
# modern GNU Make.
|
|
|
|
$(TOPOBJDIR)/%: FORCE
|
|
|
|
$(MAKE) -C $(dir $@) $(notdir $@)
|
|
|
|
|
2015-09-24 04:40:54 +03:00
|
|
|
# Install files using install manifests
|
|
|
|
#
|
|
|
|
# The list of base directories is given in INSTALL_MANIFESTS. The
|
|
|
|
# corresponding install manifests are named correspondingly, with forward
|
|
|
|
# slashes replaced with underscores, and prefixed with `install_`. That is,
|
|
|
|
# the install manifest for `dist/bin` would be `install_dist_bin`.
|
2016-02-12 03:42:58 +03:00
|
|
|
$(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(addprefix $(TOPOBJDIR)/,buildid.h source-repo.h)
|
2015-10-01 11:10:08 +03:00
|
|
|
@# For now, force preprocessed files to be reprocessed every time.
|
|
|
|
@# The overhead is not that big, and this avoids waiting for proper
|
|
|
|
@# support for defines tracking in process_install_manifest.
|
|
|
|
@touch install_$(subst /,_,$*)
|
2015-12-25 04:27:29 +03:00
|
|
|
@# BOOKMARKS_INCLUDE_DIR is for bookmarks.html only.
|
2015-09-24 04:40:54 +03:00
|
|
|
$(PYTHON) -m mozbuild.action.process_install_manifest \
|
2015-12-03 10:49:12 +03:00
|
|
|
--track install_$(subst /,_,$*).track \
|
2015-09-24 04:40:54 +03:00
|
|
|
$(TOPOBJDIR)/$* \
|
|
|
|
-DAB_CD=en-US \
|
2015-12-25 04:27:29 +03:00
|
|
|
-DBOOKMARKS_INCLUDE_DIR=$(TOPSRCDIR)/browser/locales/en-US/profile \
|
2015-09-24 04:40:54 +03:00
|
|
|
$(ACDEFINES) \
|
2015-10-01 11:10:08 +03:00
|
|
|
install_$(subst /,_,$*)
|
2015-09-24 04:40:54 +03:00
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
# Below is a set of additional dependencies and variables used to build things
|
|
|
|
# that are not supported by data in moz.build.
|
|
|
|
|
2015-09-25 11:18:45 +03:00
|
|
|
# The xpidl target in config/makefiles/xpidl requires the install manifest for
|
2016-01-23 22:40:24 +03:00
|
|
|
# dist/idl to have been processed. When using the hybrid
|
|
|
|
# FasterMake/RecursiveMake backend, this dependency is handled in the top-level
|
|
|
|
# Makefile.
|
|
|
|
ifndef FASTER_RECURSIVE_MAKE
|
2015-09-25 11:18:45 +03:00
|
|
|
$(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(TOPOBJDIR)/install-dist_idl
|
2016-01-23 22:40:24 +03:00
|
|
|
endif
|
2016-01-19 08:50:54 +03:00
|
|
|
# It also requires all the install manifests for dist/bin to have been processed
|
|
|
|
# because it adds interfaces.manifest references with buildlist.py.
|
|
|
|
$(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(addprefix install-,$(filter dist/bin%,$(INSTALL_MANIFESTS)))
|