diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2010-10-31 09:24:11 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2010-10-31 09:28:55 -0700 |
commit | b5222348e167d6080608688b273bfeb4af226e58 (patch) | |
tree | 9c260e2df918d4b2cb56538050e39b7446656506 | |
parent | 40f4a42e5da2c78f15c8ea389a79eb3c7619abaf (diff) |
Add lint rules to enable code checking
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/Makefile.am | 19 |
3 files changed, 29 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 796fb89..84b4b8f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,3 +15,9 @@ ChangeLog: $(CHANGELOG_CMD) dist-hook: ChangeLog INSTALL + +if LINT +# Check source code with tools like lint & sparse +lint: + cd src && $(MAKE) $(AM_MAKEFLAGS) lint +endif LINT diff --git a/configure.ac b/configure.ac index 87dec28..7fb7b4e 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,10 @@ AC_PROG_LIBTOOL # Checks for pkg-config packages PKG_CHECK_MODULES(XEVIE, xproto x11 xextproto xext evieproto) +dnl Allow checking code with lint, sparse, etc. +XORG_WITH_LINT +XORG_LINT_LIBRARY([Xevie]) + AC_OUTPUT([Makefile src/Makefile man/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 3b94ce0..7c5a8ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,3 +12,22 @@ libXevie_la_LDFLAGS = -version-number 1:0:0 -no-undefined libXevieincludedir = $(includedir)/X11/extensions libXevieinclude_HEADERS = $(top_srcdir)/include/X11/extensions/Xevie.h + +if LINT +ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(XEVIE_CFLAGS) + +lint: + $(LINT) $(ALL_LINT_FLAGS) $(libXevie_la_SOURCES) $(XEVIE_LIBS) +endif LINT + +if MAKE_LINT_LIB +lintlibdir = $(libdir) + +lintlib_DATA = $(LINTLIB) + +$(LINTLIB): $(libXevie_la_SOURCES) + $(AM_V_GEN)$(LINT) -y -oXevie -x $(ALL_LINT_FLAGS) $(libXevie_la_SOURCES) +endif MAKE_LINT_LIB + +CLEANFILES = $(lintlib_DATA) |