summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Andrews <athenian200@outlook.com>2021-10-21 19:44:27 -0500
committerJeremy Andrews <athenian200@outlook.com>2021-10-21 19:44:27 -0500
commit2e37a47a8f0c4778beb51c528361ad313c2882b8 (patch)
tree24a3f8f63d426f0310c30a9be7ce06b314aeb621
parent9abdd5ee17ece53c42a1df9861e4d0b73a09bc69 (diff)
downloadbasilisk-2e37a47a8f0c4778beb51c528361ad313c2882b8.tar.gz
No Issue - Use MOZILLA_DIR in client.mk and remove config/makefiles.
-rw-r--r--client.mk45
-rw-r--r--config/makefiles/autotargets.mk94
-rw-r--r--config/makefiles/makeutils.mk117
3 files changed, 23 insertions, 233 deletions
diff --git a/client.mk b/client.mk
index e89bbe6..4c23a7a 100644
--- a/client.mk
+++ b/client.mk
@@ -46,7 +46,6 @@ endef
endif
endif
-
CWD := $(CURDIR)
ifneq (1,$(words $(CWD)))
$(error The platform directory cannot be located in a path with spaces.)
@@ -64,11 +63,13 @@ TOPSRCDIR := $(CWD)
endif
endif
+MOZILLA_DIR=$(TOPSRCDIR)/platform
+
SH := /bin/sh
PERL ?= perl
PYTHON ?= $(shell which python2.7 > /dev/null 2>&1 && echo python2.7 || echo python)
-CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/platform/build/autoconf/config.guess)
+CONFIG_GUESS_SCRIPT := $(wildcard $(MOZILLA_DIR)/build/autoconf/config.guess)
ifdef CONFIG_GUESS_SCRIPT
CONFIG_GUESS := $(shell $(CONFIG_GUESS_SCRIPT))
endif
@@ -150,8 +151,8 @@ MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
# 'configure' scripts generated by autoconf.
CONFIGURES := $(TOPSRCDIR)/configure
-CONFIGURES += $(TOPSRCDIR)/platform/configure
-CONFIGURES += $(TOPSRCDIR)/platform/js/src/configure
+CONFIGURES += $(MOZILLA_DIR)/configure
+CONFIGURES += $(MOZILLA_DIR)/js/src/configure
# Make targets that are going to be passed to the real build system
OBJDIR_TARGETS = install export libs clean realclean distclean maybe_clobber_profiledbuild upload sdk installer package package-compare stage-package source-package l10n-check automation/build
@@ -164,8 +165,8 @@ build::
$(MAKE) -f $(TOPSRCDIR)/client.mk $(if $(MOZ_PGO),profiledbuild,realbuild) CREATE_MOZCONFIG_JSON=
# Define mkdir
-include $(TOPSRCDIR)/config/makefiles/makeutils.mk
-include $(TOPSRCDIR)/config/makefiles/autotargets.mk
+include $(MOZILLA_DIR)/config/makefiles/makeutils.mk
+include $(MOZILLA_DIR)/config/makefiles/autotargets.mk
# Create a makefile containing the mk_add_options values from mozconfig,
# but only do so when OBJDIR is defined (see further above).
@@ -242,7 +243,7 @@ profiledbuild::
ifdef MOZ_UNIFY_BDATE
ifndef MOZ_BUILD_DATE
ifdef MOZ_BUILD_PROJECTS
-MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/platform/build/variables.py buildid_header | awk '{print $$3}')
+MOZ_BUILD_DATE = $(shell $(PYTHON) $(MOZILLA_DIR)/build/variables.py buildid_header | awk '{print $$3}')
export MOZ_BUILD_DATE
endif
endif
@@ -295,11 +296,11 @@ CONFIG_CACHE = $(wildcard $(OBJDIR)/config.cache)
EXTRA_CONFIG_DEPS := \
$(TOPSRCDIR)/aclocal.m4 \
- $(TOPSRCDIR)/platform/aclocal.m4 \
- $(TOPSRCDIR)/platform/old-configure.in \
- $(wildcard $(TOPSRCDIR)/platform/build/autoconf/*.m4) \
- $(TOPSRCDIR)/platform/js/src/aclocal.m4 \
- $(TOPSRCDIR)/platform/js/src/old-configure.in \
+ $(MOZILLA_DIR)/aclocal.m4 \
+ $(MOZILLA_DIR)/old-configure.in \
+ $(wildcard $(MOZILLA_DIR)/build/autoconf/*.m4) \
+ $(MOZILLA_DIR)/js/src/aclocal.m4 \
+ $(MOZILLA_DIR)/js/src/old-configure.in \
$(NULL)
$(CONFIGURES): %: %.in $(EXTRA_CONFIG_DEPS)
@@ -308,15 +309,15 @@ $(CONFIGURES): %: %.in $(EXTRA_CONFIG_DEPS)
chmod +x $@
CONFIG_STATUS_DEPS := \
- $(wildcard $(TOPSRCDIR)/platform/ldap/sdks/c-sdk/configure) \
+ $(wildcard $(MOZILLA_DIR)/ldap/sdks/c-sdk/configure) \
$(wildcard $(TOPSRCDIR)/*/confvars.sh) \
$(CONFIGURES) \
- $(TOPSRCDIR)/platform/CLOBBER \
- $(TOPSRCDIR)/platform/nsprpub/configure \
- $(TOPSRCDIR)/platform/config/milestone.txt \
- $(TOPSRCDIR)/platform/build/virtualenv_packages.txt \
- $(TOPSRCDIR)/platform/python/mozbuild/mozbuild/virtualenv.py \
- $(TOPSRCDIR)/platform/testing/mozbase/packages.txt \
+ $(MOZILLA_DIR)/CLOBBER \
+ $(MOZILLA_DIR)/nsprpub/configure \
+ $(MOZILLA_DIR)/config/milestone.txt \
+ $(MOZILLA_DIR)/build/virtualenv_packages.txt \
+ $(MOZILLA_DIR)/python/mozbuild/mozbuild/virtualenv.py \
+ $(MOZILLA_DIR)/testing/mozbase/packages.txt \
$(OBJDIR)/.mozconfig.json \
$(NULL)
@@ -333,9 +334,9 @@ else
CONFIGURE = $(TOPSRCDIR)/configure
endif
-$(OBJDIR)/CLOBBER: $(TOPSRCDIR)/platform/CLOBBER
- $(PYTHON) $(TOPSRCDIR)/platform/config/pythonpath.py -I $(TOPSRCDIR)/platform/testing/mozbase/mozfile \
- $(TOPSRCDIR)/platform/python/mozbuild/mozbuild/controller/clobber.py $(TOPSRCDIR)/platform $(OBJDIR)
+$(OBJDIR)/CLOBBER: $(MOZILLA_DIR)/CLOBBER
+ $(PYTHON) $(MOZILLA_DIR)/config/pythonpath.py -I $(MOZILLA_DIR)/testing/mozbase/mozfile \
+ $(MOZILLA_DIR)/python/mozbuild/mozbuild/controller/clobber.py $(MOZILLA_DIR) $(OBJDIR)
configure-files: $(CONFIGURES)
diff --git a/config/makefiles/autotargets.mk b/config/makefiles/autotargets.mk
deleted file mode 100644
index 16e06fb..0000000
--- a/config/makefiles/autotargets.mk
+++ /dev/null
@@ -1,94 +0,0 @@
-# -*- makefile -*-
-# vim:set ts=8 sw=8 sts=8 noet:
-#
-# 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/.
-#
-
-ifndef INCLUDED_AUTOTARGETS_MK #{
-
-# Conditional does not wrap the entire file so multiple
-# includes will be able to accumulate dependencies.
-
-###########################################################################
-# AUTO_DEPS - A list of deps/targets drived from other macros.
-###########################################################################
-
-MKDIR ?= mkdir -p
-TOUCH ?= touch
-
-# declare for local use, rules.mk may not have been loaded
-space = $(NULL) $(NULL)
-
-# Deps will be considered intermediate when used as a pre-requisite for
-# wildcard targets. Inhibit their removal, mkdir -p is a standalone op.
-.PRECIOUS: %/.mkdir.done
-
-#########################
-##---] FUNCTIONS [---##
-#########################
-
-# Squeeze can be overzealous, restore root for abspath
-getPathPrefix =$(if $(filter /%,$(1)),/)
-
-# Squeeze '//' from the path, easily created by string functions
-_slashSqueeze =$(foreach val,$(getargv),$(call getPathPrefix,$(val))$(subst $(space),/,$(strip $(subst /,$(space),$(val)))))
-
-# Squeeze extraneous directory slashes from the path
-# o protect embedded spaces within the path
-# o replace //+ sequences with /
-slash_strip = \
- $(strip \
- $(subst <--[**]-->,$(space),\
- $(call _slashSqueeze,\
- $(subst $(space),<--[**]-->,$(1))\
- )))
-
-# Extract directory path from a dependency file.
-mkdir_stem =$(foreach val,$(getargv),$(subst /.mkdir.done,$(NULL),$(val)))
-
-## Generate timestamp file for threadsafe directory creation
-mkdir_deps =$(foreach dir,$(getargv),$(call slash_strip,$(dir)/.mkdir.done))
-
-#######################
-##---] TARGETS [---##
-#######################
-
-%/.mkdir.done: # mkdir -p -p => mkdir -p
- $(subst $(space)-p,$(null),$(MKDIR)) -p '$(dir $@)'
-# Make the timestamp old enough for not being a problem with symbolic links
-# targets depending on it. Use Jan 3, 1980 to accomodate any timezone where
-# 198001010000 would translate to something older than FAT epoch.
- @$(TOUCH) -t 198001030000 '$@'
-
-# A handful of makefiles are attempting "mkdir dot".
-# tbpl/valgrind builds are using this target
-# https://bugzilla.mozilla.org/show_bug.cgi?id=837754
-.mkdir.done:
- @echo 'WARNING: $(MKDIR) -dot- requested by $(MAKE) -C $(CURDIR) $(MAKECMDGOALS)'
- @$(TOUCH) -t 198001030000 '$@'
-
-INCLUDED_AUTOTARGETS_MK = 1
-endif #}
-
-
-## Accumulate deps and cleanup
-ifneq (,$(GENERATED_DIRS))
- GENERATED_DIRS := $(strip $(sort $(GENERATED_DIRS)))
- tmpauto :=$(call mkdir_deps,GENERATED_DIRS)
- GENERATED_DIRS_DEPS +=$(tmpauto)
- GARBAGE_DIRS +=$(GENERATED_DIRS)
-endif
-
-#################################################################
-# One ring/dep to rule them all:
-# config/rules.mk::all target is available by default
-# Add $(AUTO_DEPS) as an explicit target dependency when needed.
-#################################################################
-
-AUTO_DEPS +=$(GENERATED_DIRS_DEPS)
-AUTO_DEPS := $(strip $(sort $(AUTO_DEPS)))
-
-# Complain loudly if deps have not loaded so getargv != $(NULL)
-$(call requiredfunction,getargv)
diff --git a/config/makefiles/makeutils.mk b/config/makefiles/makeutils.mk
deleted file mode 100644
index d7c5c97..0000000
--- a/config/makefiles/makeutils.mk
+++ /dev/null
@@ -1,117 +0,0 @@
-# -*- makefile -*-
-# vim:set ts=8 sw=8 sts=8 noet:
-#
-# 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/.
-
-## Identify function argument types
-istype =$(if $(value ${1}),list,scalar)
-isval =$(if $(filter-out list,$(call istype,${1})),true)
-isvar =$(if $(filter-out scalar,$(call istype,${1})),true)
-
-# Access up to 9 arguments passed, option needed to emulate $*
-# Inline for function expansion, do not use $(call )
-argv =$(strip
-argv +=$(if $(1), $(1))$(if $(2), $(2))$(if $(3), $(3))$(if $(4), $(4))
-argv +=$(if $(5), $(5))$(if $(6), $(6))$(if $(7), $(7))$(if $(8), $(8))
-argv +=$(if $(9), $(9))
-argv +=$(if $(10), $(error makeutils.mk::argv can only handle 9 arguments))
-argv +=)
-
-###########################################################################
-## Access function args as a simple list, inline within user functions.
-## Usage: $(info ** $(call banner,$(getargv)))
-## $(call banner,scalar)
-## $(call banner,list0 list1 list2)
-## $(call banner,ref) ; ref=foo bar tans
-## getarglist() would be a more accurate name but is longer to type
-getargv = $(if $(call isvar,$(1)),$($(1)),$(argv))
-
-###########################################################################
-# Strip [n] leading options from an argument list. This will allow passing
-# extra args to user functions that will not propogate to sub-$(call )'s
-# Usage: $(call subargv,2)
-subargv =$(wordlist $(1),$(words $(getargv)),$(getargv))
-
-###########################################################################
-# Intent: Display a distinct banner heading in the output stream
-# Usage: $(call banner,BUILDING: foo bar tans)
-# Debug:
-# target-preqs = \
-# $(call banner,target-preqs-BEGIN) \
-# foo bar tans \
-# $(call banner,target-preqs-END) \
-# $(NULL)
-# target: $(target-preqs)
-
-banner = \
-$(info ) \
-$(info ***************************************************************************) \
-$(info ** $(getargv)) \
-$(info ***************************************************************************) \
-$(NULL)
-
-#####################################################################
-# Intent: Determine if a string or pattern is contained in a list
-# Usage: strcmp - $(call if_XinY,clean,$(MAKECMDGOALS))
-# : pattern - $(call if_XinY,clean%,$(MAKECMDGOALS))
-is_XinY =$(filter $(1),$(call subargv,3,$(getargv)))
-
-#####################################################################
-# Provide an alternate var to support testing
-ifdef MAKEUTILS_UNIT_TEST
- mcg_goals=TEST_MAKECMDGOALS
-else
- mcg_goals=MAKECMDGOALS
-endif
-
-# Intent: Conditionals for detecting common/tier target use
-isTargetStem = $(sort \
- $(foreach var,$(getargv),\
- $(foreach pat,$(var)% %$(var),\
- $(call is_XinY,$(pat),${$(mcg_goals)})\
- )))
-isTargetStemClean = $(call isTargetStem,clean)
-isTargetStemExport = $(call isTargetStem,export)
-isTargetStemLibs = $(call isTargetStem,libs)
-isTargetStemTools = $(call isTargetStem,tools)
-
-##################################################
-# Intent: Validation functions / unit test helpers
-
-errorifneq =$(if $(subst $(strip $(1)),$(NULL),$(strip $(2))),$(error expected [$(1)] but found [$(2)]))
-
-# Intent: verify function declaration exists
-requiredfunction =$(foreach func,$(1) $(2) $(3) $(4) $(5) $(6) $(7) $(8) $(9),$(if $(value $(func)),$(NULL),$(error required function [$(func)] is unavailable)))
-
-
-
-## http://www.gnu.org/software/make/manual/make.html#Call-Function
-## Usage: o = $(call map,origin,o map $(MAKE))
-map = $(foreach val,$(2),$(call $(1),$(val)))
-
-
-## Disable checking for clean targets
-ifeq (,$(filter %clean clean%,$(MAKECMDGOALS))) #{
-
-# Usage: $(call checkIfEmpty,[error|warning] foo NULL bar)
-checkIfEmpty =$(foreach var,$(wordlist 2,100,$(argv)),$(if $(strip $($(var))),$(NOP),$(call $(1),Variable $(var) does not contain a value)))
-
-# Usage: $(call errorIfEmpty,foo NULL bar)
-errorIfEmpty =$(call checkIfEmpty,error $(argv))
-warnIfEmpty =$(call checkIfEmpty,warning $(argv))
-
-endif #}
-
-###########################################################################
-## Common makefile library loader
-###########################################################################
-topORerr =$(if $(topsrcdir),$(topsrcdir),$(error topsrcdir is not defined))
-
-ifdef USE_AUTOTARGETS_MK # mkdir_deps
- include $(topORerr)/config/makefiles/autotargets.mk
-endif
-
-## copy(src, dst): recursive copy
-copy_dir = (cd $(1)/. && $(TAR) $(TAR_CREATE_FLAGS) - .) | (cd $(2)/. && tar -xf -)