Commit 8309efe6 authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Alan Coopersmith

Add support for "make lint" to check code with lint/sparse/etc.

parent 931e02fb
......@@ -18,3 +18,14 @@ ChangeLog:
GIT_DIR=${srcdir}/.git git-log > ChangeLog
dist-hook: ChangeLog
if LINT
# Check source code with tools like lint & sparse
LINT_SUBDIRS=src # modules
lint:
@for subdir in $(LINT_SUBDIRS) ; do \
echo "Making $@ in $$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) lint) ; \
done
endif LINT
......@@ -314,6 +314,10 @@ if test x"$COMPOSECACHE" = "xyes"; then
AC_DEFINE(COMPOSECACHE,1,[Include compose table cache support])
fi
dnl Allow checking code with lint, sparse, etc.
XORG_WITH_LINT
LINT_FLAGS="${LINT_FLAGS} ${X11_CFLAGS} ${XPROTO_CFLAGS}"
if test "x$GCC" = "xyes"; then
GCC_WARNINGS="-Wall -Wpointer-arith -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations \
......
......@@ -380,6 +380,22 @@ preprocess: $(patsubst %.c,%.ii,$(libX11_la_SOURCES))
.c.ii:
$(COMPILE) -E -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
if LINT
# Check source code with tools like lint & sparse
ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
lint: $(BUILT_SOURCES)
for f in $(libX11_la_SOURCES) ; do \
$(LINT) $(ALL_LINT_FLAGS) $$f ; \
done
@for subdir in $(SUBDIRS) ; do \
echo "Making $@ in src/$$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) lint) ; \
done
endif LINT
#
# Building ks_tables.h requires the makekeys utility
#
......
......@@ -8,3 +8,14 @@ makekeys_CFLAGS=$(X11_CFLAGS)
LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
EXTRA_DIST = mkks.sh
if LINT
# Check source code with tools like lint & sparse
ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
lint:
$(LINT) $(ALL_LINT_FLAGS) makekeys.c
endif LINT
......@@ -84,3 +84,15 @@ libxcms_la_SOURCES = \
X11dir = $(libdir)/X11
dist_X11_DATA = Xcms.txt
if LINT
# Check source code with tools like lint & sparse
ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
lint:
$(LINT) $(ALL_LINT_FLAGS) $(libxcms_la_SOURCES) -lm
endif LINT
......@@ -37,3 +37,14 @@ libxkb_la_SOURCES = \
XKBGAlloc.c \
XKBAlloc.c \
XKBlibint.h
if LINT
# Check source code with tools like lint & sparse
ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
lint:
$(LINT) $(ALL_LINT_FLAGS) $(libxkb_la_SOURCES) -lm
endif LINT
......@@ -134,3 +134,14 @@ EXTRA_DIST = \
lcUniConv/COPYRIGHT \
lcUniConv/8bit_tab_to_h.c \
lcUniConv/cjk_tab_to_h.c
if LINT
# Check source code with tools like lint & sparse
ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
lint:
$(LINT) $(ALL_LINT_FLAGS) $(libi18n_la_SOURCES)
endif LINT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment