]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
BuildSystem regression: Fix errors reported by clean targets.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 7 Mar 2018 19:13:42 +0000 (13:13 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 7 Mar 2018 19:23:04 +0000 (13:23 -0600)
Doing a 'make clean', 'make distclean', or 'make dist-clean' gets errors
about an invalid shell option: "/bin/sh: 0: Illegal option -".

The clean targets do not include the makeopts file which defines GREP and
LDCONFIG because the file may not exist and the distclean/dist-clean
targets will delete it anyway.

ASTERISK-27715

Change-Id: I33d40acdb03862bc89aeb6fb1ff497894a8ea7f5

Makefile

index 4e6072e3a12051b6ee64ba5b58d2e40a20d65ae4..e624abf7787c774004a3766dfc7b3903b61423ac 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -239,7 +239,9 @@ ifeq ($(OSARCH),SunOS)
   _ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2 -D__EXTENSIONS__
 endif
 
-ifneq ($(GREP),:)
+ifeq ($(GREP),)
+else ifeq ($(GREP),:)
+else
   ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) GIT=$(GIT) build_tools/make_version .)
 endif
 ifneq ($(AWK),)
@@ -467,7 +469,9 @@ endif
                $(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTDATADIR)/rest-api" ; \
        done
 
-ifneq ($(GREP),:)
+ifeq ($(GREP),)
+else ifeq ($(GREP),:)
+else
   XML_core_en_US = $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
 endif
 
@@ -486,7 +490,9 @@ doc/core-en_US.xml: makeopts .lastclean $(XML_core_en_US)
        @echo
        @echo "</docs>" >> $@
 
-ifneq ($(GREP),:)
+ifeq ($(GREP),)
+else ifeq ($(GREP),:)
+else
   XML_full_en_US = $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
 endif
 
@@ -630,7 +636,9 @@ oldmodcheck:
        fi
 
 ld-cache-update:
-ifneq ($(LDCONFIG),:)
+ifeq ($(LDCONFIG),)
+else ifeq ($(LDCONFIG),:)
+else
 ifeq ($(DESTDIR),)  # DESTDIR means binary archive creation; ldconfig should be run on postinst
        @if [ $$(id -u) -eq 0 ] ; then \
                $(LDCONFIG) "$(ASTLIBDIR)/" ; \
@@ -984,7 +992,9 @@ ifeq ($(HAVE_DAHDI),1)
        rm -f $(DESTDIR)$(DAHDI_UDEV_HOOK_DIR)/40-asterisk
 endif
        $(MAKE) -C sounds uninstall
-ifneq ($(LDCONFIG),:)
+ifeq ($(LDCONFIG),)
+else ifeq ($(LDCONFIG),:)
+else
        $(LDCONFIG) "$(ASTLIBDIR)/" || :
 endif