]> granicus.if.org Git - flex/commitdiff
build: Fix 'make indent' target
authorExplorer09 <explorer09@gmail.com>
Sun, 1 Jan 2017 16:38:37 +0000 (00:38 +0800)
committerWill Estes <westes575@gmail.com>
Thu, 12 Jan 2017 23:02:24 +0000 (18:02 -0500)
This 'make indent' target has not been working since the directories
reorganization in flex 2.6.0. Now make it work again.

Note that the current indent profile breaks many styles of existing
code. The indent target should not be used until the .indent.pro
options are reviewed for desireability.

Makefile.am
src/Makefile.am

index 1540bb748ebd264df9b6a4871227f7eae78eb379..807a1096694fb580b7eebad906aa54c371b3e938 100644 (file)
@@ -29,7 +29,6 @@
 # to DEFS.
 
 ACLOCAL_AMFLAGS = -I m4
-indent = @INDENT@
 
 dist_doc_DATA = \
        AUTHORS \
@@ -58,8 +57,11 @@ ChangeLog: $(srcdir)/tools/git2cl
                $(srcdir)/tools/git2cl > $@ \
        ; fi
 
+indent:
+       cd src && $(MAKE) $(AM_MAKEFLAGS) indent
+
 install-exec-hook:
        cd $(DESTDIR)$(bindir) && \
                $(LN_S) -f flex$(EXEEXT) flex++$(EXEEXT)
 
-.PHONY: ChangeLog tags indent
+.PHONY: ChangeLog indent
index 3b5e362bb034edef4464162ce6c102bffa694951..18aeec3cc4262aa2475e91c6cf4713b5b257c576 100644 (file)
@@ -135,12 +135,14 @@ indentfiles = \
        tables_shared.h \
        tblcmp.c
 
-indent:
-       if [ -f .indent.pro ] ; then \
-       for f in $(indentfiles);\
-       do\
-               echo indenting $$f ;\
-               f='$(srcdir)'/$$f; \
-               $(indent) < $$f >/dev/null && indent $$f || echo $$f FAILED to indent ;\
-       done \
-       fi
+indent: $(top_srcdir)/.indent.pro
+       cd $(top_srcdir) && \
+       for f in $(indentfiles); do \
+               f=src/$$f; \
+               echo indenting $$f; \
+               INDENT_PROFILE=.indent.pro $(INDENT) <$$f >/dev/null && \
+               INDENT_PROFILE=.indent.pro $(INDENT) $$f || \
+               echo $$f FAILED to indent; \
+       done;
+
+.PHONY: indent