summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac5
-rw-r--r--src/Makefile.am8
3 files changed, 17 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 23a33b8..20760d4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,3 +26,7 @@ pkgconfig_DATA = xtst.pc
EXTRA_DIST = xtst.pc.in autogen.sh
+if LINT
+lint:
+ (cd src && $(MAKE) $(MFLAGS) lint)
+endif LINT
diff --git a/configure.ac b/configure.ac
index a7fc7ae..554ab13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,11 @@ AC_PROG_LIBTOOL
# Check for dependencies
PKG_CHECK_MODULES(XTST, x11 xext recordproto xextproto inputproto)
+dnl Allow checking code with lint, sparse, etc.
+XORG_WITH_LINT
+XORG_LINT_LIBRARY([Xtst])
+LINT_FLAGS="${LINT_FLAGS} ${XTST_CFLAGS}"
+
AC_SUBST(XTST_CFLAGS)
AC_SUBST(XTST_LIBS)
diff --git a/src/Makefile.am b/src/Makefile.am
index a3759b2..7e3a901 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -8,3 +8,11 @@ libXtst_la_LIBADD = @XTST_LIBS@
AM_CFLAGS = @XTST_CFLAGS@
libXtst_la_LDFLAGS = -version-number 6:1:0 -no-undefined
+
+if LINT
+ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS)
+
+lint:
+ $(LINT) $(ALL_LINT_FLAGS) $(libXtst_la_SOURCES) $(XTST_LIBS)
+endif LINT