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

This commit is contained in:
Alan Coopersmith 2006-07-24 15:52:00 -07:00 committed by Alan Coopersmith
parent 931e02fbd1
commit 8309efe655
7 changed files with 76 additions and 0 deletions

View file

@ -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

View file

@ -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 \

View file

@ -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
#

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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