diff options
author | Explorer09 <explorer09@gmail.com> | 2017-01-02 00:38:37 +0800 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2017-01-12 18:02:24 -0500 |
commit | bb92951c022ea135d2f9dbc51dd9803ac7cd97ad (patch) | |
tree | 2256ee55521f3fae5e7d29961070536d8283f863 | |
parent | 8db5267af4dfe10b0059c16d2b728bfb43146f63 (diff) |
build: Fix 'make indent' target
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.
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | src/Makefile.am | 20 |
2 files changed, 15 insertions, 11 deletions
diff --git a/Makefile.am b/Makefile.am index 1540bb7..807a109 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/src/Makefile.am b/src/Makefile.am index 3b5e362..18aeec3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 |