--- rpl/tools/Makefile.am 2010/02/11 16:30:44 1.3 +++ rpl/tools/Makefile.am 2010/03/02 09:52:34 1.4 @@ -6,6 +6,36 @@ subdirs = @NCURSES@ @READLINE@ @UNITS@ @ @FILE@ @ICONV@ all: + for i in $(shell find @NCURSES@ -name Makefile \ + -exec grep static {} /dev/null \; | cut -d: -f1); \ + do \ + echo -n Checking $$i; \ + TMP=$$(mktemp); \ + if [ -n "$$(grep static $$i | grep dynamic)" ]; then \ + awk \ + '{ if (index($$0, "-static") != 0 && index($$0, "-dynamic") != 0) \ + { \ + for(j = 1; j <= NF; j++) \ + { \ + if (index($$j, "-static") == 0) \ + { \ + printf("%s ", $$j); \ + } \ + } \ + printf("\n"); \ + } \ + else \ + { \ + print; \ + } \ + }' $$i > $$TMP; \ + \mv -f $$TMP $$i; \ + echo -n " (fixed)"; \ + else \ + echo -n " (nothing to do)"; \ + fi; \ + echo .; \ + done; @list='$(subdirs)'; for subdir in $$list; do \ echo "Making $@ in $$subdir"; \ $(MAKE) -C $$subdir $@ ; \