update readme and add gitignore
[client-tools.git] / src / make_include / lint.include
blob549f42b222b5c0f73fedb26f555fb18bc49e8c81
1 LINT_SCRIPT = $(top_srcdir)/../../tools/swglint.sh
2 LINT_TARGETS = $(addsuffix .lint, $(SOURCES))
4 # don't lint header files, though they may appear in the "sources" list
5 %.h.lint : %.h
6         touch $@
8 %.cpp.lint : %.cpp
9         cd $(srcdir) && $(LINT_SCRIPT) $(srcdir)/$(subst .lint,,$@)
10         touch $@
12 lint-am: Makefile
13 lint-recursive:
14         @set fnord $$MAKEFLAGS; amf=$$2; \
15         dot_seen=no; \
16         target=`echo $@ | sed s/-recursive//`; \
17         list='$(SUBDIRS)'; for subdir in $$list; do \
18           echo "Making $$target in $$subdir"; \
19           if test "$$subdir" = "."; then \
20             dot_seen=yes; \
21             local_target="$$target-am"; \
22           else \
23             local_target="$$target"; \
24           fi; \
25           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
26            || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
27         done; \
28         if test "$$dot_seen" = "no"; then \
29           $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
30         fi; test -z "$$fail"
32 lint: lint-recursive $(LINT_TARGETS)