michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: USE_RCS_MK := 1 michael@0: include $(topsrcdir)/config/makefiles/makeutils.mk michael@0: michael@0: ifdef MOZ_APP_BASENAME michael@0: DIST_FILES = $(srcdir)/application.ini michael@0: michael@0: ifneq (android,$(MOZ_WIDGET_TOOLKIT)) michael@0: ifdef MOZ_UPDATER michael@0: DIST_FILES += update-settings.ini michael@0: endif michael@0: endif michael@0: michael@0: ifdef LIBXUL_SDK michael@0: APP_INI_DEPS = $(LIBXUL_DIST)/bin/platform.ini michael@0: else michael@0: APP_INI_DEPS = $(topsrcdir)/config/milestone.txt michael@0: endif michael@0: michael@0: APP_BUILDID := $(shell cat $(DEPTH)/config/buildid) michael@0: APP_INI_DEPS += $(DEPTH)/config/buildid michael@0: michael@0: DEFINES += -DAPP_BUILDID=$(APP_BUILDID) michael@0: michael@0: APP_INI_DEPS += $(DEPTH)/config/autoconf.mk michael@0: michael@0: MOZ_SOURCE_STAMP := $(firstword $(shell cd $(topsrcdir)/$(MOZ_BUILD_APP)/.. && hg parent --template='{node|short}\n' 2>/dev/null)) michael@0: ifdef MOZ_SOURCE_STAMP michael@0: DEFINES += -DMOZ_SOURCE_STAMP='$(MOZ_SOURCE_STAMP)' michael@0: endif michael@0: michael@0: source_repo ?= $(call getSourceRepo,$(topsrcdir)/$(MOZ_BUILD_APP)/..) michael@0: ifneq (,$(source_repo)) michael@0: DEFINES += -DMOZ_SOURCE_REPO='$(source_repo)' michael@0: endif michael@0: michael@0: endif michael@0: michael@0: # Put a useful .gdbinit in the bin directory, to be picked up automatically michael@0: # by GDB when we debug executables there. michael@0: # NOTE: Keep .gdbinit in the topsrcdir for people who run gdb from the topsrcdir. michael@0: GDBINIT_FILES := $(topsrcdir)/.gdbinit michael@0: GDBINIT_OBJDIR_FILES = $(topsrcdir)/.gdbinit michael@0: GDBINIT_DEST = $(FINAL_TARGET) michael@0: michael@0: # needs to be absolute to be distinct from $(topsrcdir)/.gdbinit michael@0: GDBINIT_OBJDIR_DEST = $(abspath $(DEPTH)) michael@0: INSTALL_TARGETS += GDBINIT GDBINIT_OBJDIR michael@0: michael@0: # Put a .lldbinit in the bin directory and the objdir, to be picked up michael@0: # automatically by LLDB when we debug executables using either of those two michael@0: # directories as the current working directory. The .lldbinit file will michael@0: # load $(topsrcdir)/.lldbinit, which is where the actual debugging commands are. michael@0: LLDBINIT_OBJDIR := .lldbinit.in michael@0: LLDBINIT_OBJDIR_PATH = $(DEPTH) michael@0: LLDBINIT_OBJDIR_FLAGS += -Dtopsrcdir=$(abspath $(topsrcdir)) michael@0: PP_TARGETS += LLDBINIT_OBJDIR michael@0: michael@0: LLDBINIT_FINAL_TARGET_FILES := $(DEPTH)/.lldbinit michael@0: LLDBINIT_FINAL_TARGET_DEST = $(FINAL_TARGET) michael@0: INSTALL_TARGETS += LLDBINIT_FINAL_TARGET michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: michael@0: # we install to _leaktest/ michael@0: TARGET_DEPTH = .. michael@0: include $(srcdir)/automation-build.mk michael@0: michael@0: _LEAKTEST_DIR = $(DEPTH)/_leaktest michael@0: michael@0: _LEAKTEST_FILES = \ michael@0: automation.py \ michael@0: automationutils.py \ michael@0: $(topsrcdir)/testing/profiles/prefs_general.js \ michael@0: leaktest.py \ michael@0: bloatcycle.html \ michael@0: $(topsrcdir)/build/pgo/server-locations.txt \ michael@0: $(topsrcdir)/build/pgo/favicon.ico \ michael@0: $(topsrcdir)/build/pgo/blueprint/sample.html \ michael@0: $(topsrcdir)/build/pgo/blueprint/elements.html \ michael@0: $(topsrcdir)/build/pgo/blueprint/forms.html \ michael@0: $(topsrcdir)/build/pgo/blueprint/grid.html \ michael@0: $(topsrcdir)/build/pgo/blueprint/test.jpg \ michael@0: $(topsrcdir)/build/pgo/blueprint/test-small.jpg \ michael@0: $(topsrcdir)/build/pgo/blueprint/valid.png \ michael@0: $(topsrcdir)/build/pgo/blueprint/screen.css \ michael@0: $(topsrcdir)/build/pgo/blueprint/print.css \ michael@0: $(topsrcdir)/build/pgo/blueprint/grid.png \ michael@0: $(topsrcdir)/build/pgo/blueprint/fancytype-screen.css \ michael@0: $(NULL) michael@0: michael@0: leaktest.py: leaktest.py.in michael@0: $(call py_action,preprocessor,$^ -o $@) michael@0: chmod +x $@ michael@0: GARBAGE += leaktest.py michael@0: michael@0: ifdef MOZ_APP_BASENAME michael@0: $(FINAL_TARGET)/application.ini: $(APP_INI_DEPS) michael@0: michael@0: ifdef MOZ_APP_STATIC_INI michael@0: application.ini.h: appini_header.py $(FINAL_TARGET)/application.ini michael@0: $(PYTHON) $^ > $@ michael@0: export:: application.ini.h michael@0: GARBAGE += application.ini.h michael@0: endif michael@0: endif michael@0: michael@0: libs:: $(_LEAKTEST_FILES) michael@0: $(INSTALL) $^ $(_LEAKTEST_DIR) michael@0: michael@0: ifdef MOZ_VALGRIND michael@0: _VALGRIND_DIR = $(DEPTH)/_valgrind michael@0: GARBAGE_DIRS += $(_VALGRIND_DIR) michael@0: michael@0: _VALGRIND_FILES = \ michael@0: $(topsrcdir)/build/valgrind/cross-architecture.sup \ michael@0: $(topsrcdir)/build/valgrind/i386-redhat-linux-gnu.sup \ michael@0: $(topsrcdir)/build/valgrind/x86_64-redhat-linux-gnu.sup \ michael@0: $(NULL) michael@0: michael@0: libs:: $(_VALGRIND_FILES) michael@0: $(INSTALL) $^ $(_VALGRIND_DIR) michael@0: endif michael@0: michael@0: ifdef ENABLE_TESTS michael@0: libs:: $(topsrcdir)/tools/rb/fix_stack_using_bpsyms.py michael@0: $(INSTALL) $< $(DIST)/bin michael@0: michael@0: ifeq ($(OS_ARCH),Darwin) michael@0: libs:: $(topsrcdir)/tools/rb/fix_macosx_stack.py michael@0: $(INSTALL) $< $(DIST)/bin michael@0: endif michael@0: michael@0: ifeq ($(OS_ARCH),Linux) michael@0: libs:: $(topsrcdir)/tools/rb/fix-linux-stack.pl michael@0: $(INSTALL) $< $(DIST)/bin michael@0: endif michael@0: michael@0: GARBAGE += $(srcdir)/automationutils.pyc michael@0: michael@0: endif # ENABLE_TESTS