From 6d2edc7cfaf09a5b7e955fa8e53ecaad86ddc0dd Mon Sep 17 00:00:00 2001 From: Carsten Schoenert Date: Tue, 10 Mar 2015 20:52:05 +0100 Subject: [PATCH] Makefile.am: moving check_ctags to a target Calling a shellscript within a Makefile is not POSIX compliant, it's possible that it would not work on all platforms. But using the check for ctags as a seperate target within the main Makefile is no problem and easy to change. This commit is a addition to 101efbfe6940fd471530fb2511def7f3862ad0d0 --- Makefile.am | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4bfb3077..c93d721a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -96,7 +96,7 @@ libcoap_@LIBCOAP_API_VERSION@_la_LDFLAGS = \ # This helper is called by libcoap-$(LIBCOAP_API_VERSION).{map,sym} to see if # configure has detected a usable version of the ctags program and aborts if not. -check_ctags=\ +check_ctags: @if [ "$(CTAGS_PROG)" = "" ]; then \ echo ;\ echo "There was no ctags program found by the configure script!" ;\ @@ -112,19 +112,17 @@ check_ctags=\ ## it must fall back to a plain symbol file. update-map-file: libcoap-$(LIBCOAP_API_VERSION).map libcoap-$(LIBCOAP_API_VERSION).sym -libcoap-$(LIBCOAP_API_VERSION).map: $(libcoap_include_HEADERS) - $(call check_ctags) +libcoap-$(LIBCOAP_API_VERSION).map: check_ctags $(libcoap_include_HEADERS) ( echo "VER_$(LIBCOAP_API_VERSION) {" ; \ echo "global:" ; \ - ctags -f - --c-kinds=p $^ | awk '/^coap_/ { print " " $$1 ";" }' | sort ; \ + ctags -f - --c-kinds=p $(libcoap_include_HEADERS) | awk '/^coap_/ { print " " $$1 ";" }' | sort ; \ echo "local:" ; \ echo " *;" ; \ echo "};" ) > $@.new mv $@.new $@ -libcoap-$(LIBCOAP_API_VERSION).sym: $(libcoap_include_HEADERS) - $(call check_ctags) - ( ctags -f - --c-kinds=p $^ | awk '/^coap_/ { print $$1 }' | sort ) \ +libcoap-$(LIBCOAP_API_VERSION).sym: check_ctags $(libcoap_include_HEADERS) + ( ctags -f - --c-kinds=p $(libcoap_include_HEADERS) | awk '/^coap_/ { print $$1 }' | sort ) \ > $@.new mv $@.new $@