From: George Joseph Date: Wed, 27 Jan 2016 16:29:13 +0000 (-0700) Subject: build_system: Prevent goals needing makeopts from running when it's missing X-Git-Tag: 11.22.0-rc1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fchanges%2F00%2F2100%2F1;p=thirdparty%2Fasterisk.git 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 --- diff --git a/Makefile b/Makefile index 3d50d3f173..efa997878c 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,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