summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2016-01-27 09:29:13 -0700
committerGeorge Joseph <george.joseph@fairview5.com>2016-01-27 10:44:01 -0600
commitc53903d447b8dff414188933328e4593bc7d1b63 (patch)
treed45ed7a58446e776ed919e7e17db4ebd9ce9a254 /Makefile
parenta706ad44e6834da6034ce6b179195d161f782a61 (diff)
build_system: Prevent goals needing makeopts from running when it's missing
The Makefile only optionally includes makeopts so when goals like uninstall that dont depend on anything else are run after a distclean, rules like 'rm -f "$(DESTDIR)$(ASTMODDIR)/"*' get run as 'rm -f ""/*' which attempts to remove everything in the root directory. Although there's a rule defined for makeopts which prints a message and does an 'exit 1', since '-include makepopts' was specified (with the -), the exit was ignored letting the rest of the rules run. This patch makes makeopts required unless the goal has the string 'clean' in it. ASTERISK-25730 #close Reported-by: George Joseph Change-Id: I1bce59a7ea4f48e7a468e22b2abbb13c63417ac7
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index b1de3d244..a07a3299b 100644
--- a/Makefile
+++ b/Makefile
@@ -100,7 +100,10 @@ export LDCONFIG
export LDCONFIG_FLAGS
export PYTHON
--include makeopts
+# makeopts is required unless the goal is clean or distclean
+ifeq ($(findstring clean,$(MAKECMDGOALS)),)
+include makeopts
+endif
# start the primary CFLAGS and LDFLAGS with any that were provided
# to the configure script