tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Makefile.in (7632B)


      1 #
      2 # This Source Code Form is subject to the terms of the Mozilla Public
      3 # License, v. 2.0. If a copy of the MPL was not distributed with this
      4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      5 
      6 export TOPLEVEL_BUILD := 1
      7 
      8 default::
      9 
     10 ifndef TEST_MOZBUILD
     11 ifdef MOZ_BUILD_APP
     12 include $(wildcard $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk)
     13 endif
     14 endif
     15 
     16 include $(topsrcdir)/config/config.mk
     17 
     18 ifneq (mobile/android,$(MOZ_BUILD_APP))
     19 # We only want to generate buildid.h once, during the (recurse) export phase.
     20 # faster make build the files explicitly so also match thoses
     21 ifneq ($(filter $(MAKECMDGOALS),recurse_export buildid.h source-repo.h),)
     22 $(MDDEPDIR)/buildid.h.stub $(MDDEPDIR)/source-repo.h.stub: FORCE
     23 endif
     24 endif
     25 source-repo.h: $(MDDEPDIR)/source-repo.h.stub
     26 buildid.h: $(MDDEPDIR)/buildid.h.stub
     27 # Add explicit dependencies that moz.build can't declare yet.
     28 build/$(MDDEPDIR)/application.ini.stub: source-repo.h buildid.h
     29 
     30 BUILD_BACKEND_FILES := $(addprefix backend.,$(addsuffix Backend,$(BUILD_BACKENDS)))
     31 
     32 ifndef TEST_MOZBUILD
     33 # We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
     34 # rules.mk doesn't run early enough.
     35 $(RUNNABLE_TIERS) binaries:: CLOBBER $(BUILD_BACKEND_FILES)
     36 endif
     37 
     38 ifdef JS_STANDALONE
     39 .PHONY: CLOBBER
     40 CLOBBER:
     41 else
     42 CLOBBER: $(topsrcdir)/CLOBBER
     43 @echo 'STOP!  The CLOBBER file has changed.'
     44 @echo 'Please run the build through "mach build".'
     45 @exit 1
     46 endif
     47 
     48 install_manifests := \
     49  $(addprefix dist/,branding include public private xpi-stage) \
     50  _tests \
     51  $(NULL)
     52 # Skip the dist/bin install manifest when using the hybrid
     53 # FasterMake/RecursiveMake backend. This is a hack until bug 1241744 moves
     54 # xpidl handling to FasterMake in that case, mechanically making the dist/bin
     55 # install manifest non-existent (non-existent manifests being skipped)
     56 ifeq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
     57 install_manifests += dist/bin
     58 endif
     59 install_manifest_depends = \
     60  CLOBBER \
     61  $(BUILD_BACKEND_FILES) \
     62  $(NULL)
     63 
     64 .PHONY: install-manifests
     65 install-manifests: $(addprefix install-,$(install_manifests))
     66 
     67 # If we're using the hybrid FasterMake/RecursiveMake backend, we want
     68 # to recurse in the faster/ directory in parallel of install manifests.
     69 ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
     70 install-manifests: faster
     71 .PHONY: faster
     72 faster:
     73 $(MAKE) -C faster FASTER_RECURSIVE_MAKE=1
     74 endif
     75 
     76 .PHONY: $(addprefix install-,$(install_manifests))
     77 $(addprefix install-,$(install_manifests)): install-%: $(install_manifest_depends)
     78 ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
     79 @# If we're using the hybrid FasterMake/RecursiveMake backend, we want
     80 @# to ensure the FasterMake end doesn't have install manifests for the
     81 @# same directory, because that would blow up
     82 $(if $(wildcard _build_manifests/install/$(subst /,_,$*)),$(if $(wildcard faster/install_$(subst /,_,$*)*),$(error FasterMake and RecursiveMake ends of the hybrid build system want to handle $*)))
     83 endif
     84 $(foreach manifest,$(wildcard _build_manifests/install/$(subst /,_,$*)),$(call py_action,process_install_manifest $*,$(if $(filter copy,$(NSDISTMODE)),--no-symlinks )--track install_$(subst /,_,$*).track $* $(manifest)))
     85 
     86 # Dummy wrapper rule to allow the faster backend to piggy back
     87 $(addprefix install-,$(subst /,_,$(filter dist/%,$(install_manifests)))): install-dist_%: install-dist/% ;
     88 
     89 .PHONY: install-tests
     90 install-tests: install-test-files
     91 
     92 .PHONY: install-test-files
     93 install-test-files:
     94 $(call py_action,process_install_manifest test/files,$(if $(filter copy,$(NSDISTMODE)),--no-symlinks )--track install__test_files.track _tests _build_manifests/install/_test_files)
     95 
     96 include $(topsrcdir)/build/moz-automation.mk
     97 
     98 # Dummy rule for the cases below where we don't depend on dist/include
     99 recurse_pre-export:
    100 
    101 # For the binaries rule, not all the install manifests matter, so force only
    102 # the interesting ones to be done.
    103 recurse_pre-export: install-manifests
    104 binaries::
    105 @$(MAKE) install-manifests install_manifests=dist/include
    106 
    107 ifdef BUILD_VERBOSE_LOG
    108 verbose_flag = -v
    109 endif
    110 
    111 recurse_artifact:
    112 $(PYTHON3) $(topsrcdir)/mach --log-no-times artifact install$(if $(MOZ_ARTIFACT_BUILD_SYMBOLS), --symbols$(addprefix =,$(filter full,$(MOZ_ARTIFACT_BUILD_SYMBOLS)))) $(if $(ENABLE_TESTS),,--no-tests) $(verbose_flag)
    113 
    114 ifdef MOZ_ANDROID_FAT_AAR_ARCHITECTURES
    115 recurse_android-fat-aar-artifact:
    116 $(call py_action,fat_aar,$(MOZ_ANDROID_FAT_AAR_ARCHITECTURES) \
    117    $(if $(MOZ_ANDROID_FAT_AAR_ARMEABI_V7A),--armeabi-v7a $(MOZ_ANDROID_FAT_AAR_ARMEABI_V7A)) \
    118    $(if $(MOZ_ANDROID_FAT_AAR_ARM64_V8A),--arm64-v8a $(MOZ_ANDROID_FAT_AAR_ARM64_V8A)) \
    119    $(if $(MOZ_ANDROID_FAT_AAR_X86_64),--x86-64 $(MOZ_ANDROID_FAT_AAR_X86_64)) \
    120    --distdir $(abspath $(DIST)/fat-aar))
    121 endif
    122 
    123 ifeq ($(MOZ_BUILD_APP),mobile/android)
    124 
    125 recurse_android-stage-package: stage-package
    126 
    127 recurse_android-archive-geckoview:
    128 GRADLE_INVOKED_WITHIN_MACH_BUILD=1 $(topsrcdir)/mach --log-no-times android archive-geckoview  $(if $(MOZ_AUTOMATION),--no-configuration-cache)
    129 endif
    130 
    131 ifdef MOZ_WIDGET_TOOLKIT
    132 ifdef ENABLE_TESTS
    133 # Additional makefile targets to call automated test suites
    134 include $(topsrcdir)/testing/testsuite-targets.mk
    135 endif
    136 endif
    137 
    138 default all::
    139 $(call BUILDSTATUS,TIERS $(TIERS) $(if $(MOZ_AUTOMATION),$(MOZ_AUTOMATION_TIERS)))
    140 
    141 include $(topsrcdir)/config/rules.mk
    142 
    143 ifdef SCCACHE_VERBOSE_STATS
    144 default::
    145 -$(CCACHE) --show-adv-stats --stats-format=json > '$(UPLOAD_PATH)/sccache-stats.json'
    146 @echo "===SCCACHE STATS==="
    147 -$(CCACHE) --show-adv-stats
    148 @echo "==================="
    149 endif
    150 
    151 ifdef MOZ_CRASHREPORTER
    152 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
    153 
    154 endif
    155 
    156 .PHONY: prepsymbolsarchive
    157 prepsymbolsarchive:
    158 echo packing symbols
    159 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
    160 
    161 ifndef MOZ_AUTOMATION
    162 prepsymbolsarchive: recurse_syms
    163 endif
    164 
    165 .PHONY: symbolsfullarchive
    166 symbolsfullarchive: prepsymbolsarchive
    167 $(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst'
    168 $(call py_action,symbols_archive $(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst,'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst' \
    169                                     $(abspath $(DIST)/crashreporter-symbols) \
    170                                     --full-archive)
    171 
    172 .PHONY: symbolsarchive
    173 symbolsarchive: prepsymbolsarchive
    174 $(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip'
    175 $(call py_action,symbols_archive $(SYMBOL_ARCHIVE_BASENAME).zip,'$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' \
    176                                     $(abspath $(DIST)/crashreporter-symbols))
    177 
    178 ifdef MOZ_CRASHREPORTER
    179 # Set MOZ_ENABLE_FULL_SYMBOLS to enable generation and upload of the full
    180 # crashreporter symbols archives
    181 ifdef MOZ_ENABLE_FULL_SYMBOLS
    182 buildsymbols: symbolsfullarchive symbolsarchive
    183 else
    184 buildsymbols: symbolsarchive
    185 endif # MOZ_ENABLE_FULL_SYMBOLS
    186 else
    187 buildsymbols:
    188 @echo "Skipping symbols generation because MOZ_CRASHREPORTER is not set."
    189 endif
    190 
    191 uploadsymbols:
    192 ifdef MOZ_CRASHREPORTER
    193 $(PYTHON3) -u $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst'
    194 endif
    195 
    196 .PHONY: package-generated-sources
    197 package-generated-sources:
    198 $(call py_action,package_generated_sources,'$(DIST)/$(PKG_PATH)$(GENERATED_SOURCE_FILE_PACKAGE)')
    199 
    200 ifdef JS_STANDALONE
    201 # Delegate js-specific rules to js
    202 check-%:
    203 $(MAKE) -C js/src $@
    204 
    205 source-package install:
    206 $(MAKE) -C js/src $@
    207 
    208 # Every export rule depends on config/export, but the rule for config/export
    209 # doesn't exist when building js non-standalone.
    210 .PHONY: config/export
    211 config/export:
    212 
    213 endif
    214 
    215 # There used to be build interdependencies here. They are now in config/recurse.mk