Using PCLint and Make

Makefile

# location of executable
PCLINT := LINT-NT

# lint switches for the development platform
PCLINT_PLATFORM_INCLUDE := "$(LINT_INCLUDE)/co-iar-vim-msp.lnt"

# -b: suppress banner
# -i: include path
# defs.lnt : local project options
PCLINT_FLAGS := -b -i"$(LINT_INCLUDE)" -i$(IAR_TOOLKIT) $(PCLINT_PLATFORM_INCLUDE) defs.lnt

# The set of .lob files
LOBS := $(patsubst %.c, %.lob, $(filter %.c,$(CSRCS)))

# lint the whole thing
pclint: $(LOBS)
    $(PCLINT) $(PCLINT_FLAGS) $(LOBS)

# lint a single module
%.lob : %.c
    $(PCLINT) $(PCLINT_FLAGS) -u -zero -oo $<

.PHONY: pclint-clean
pclint-clean:
    @- rm -rf $(LOBS)

Links