Rev 227 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
# -*- mode: mak; -*-################################################################################ File: TOOLSET/pclint.rul# Contents: PCLINT common rules## Version Who Date Description## APY 07/10/04 Created## $Source: /cvsroot/etm/devl/CFG/TOOLSET/PCLINT.RUL,v $# $Revision: 1.4 $ $Date: 2004/10/14 07:06:45 $ $State: Exp $# $Author: ayoung $ $Locker: $#............................................................................#################################################################################.. Parse user options# Global options already parsed# These options extend the global options#ifdef OPTIONSifneq "$(findstring lint2,$(OPTIONS))" ""LINTPASSES =2endifendif#.. Lint initialisation## Ensure that PCLINT is defined#.PHONY: lint_initlint_init:ifndef PCLINT$(warning The LINT operation requires that the environment variable PCLINT be set)$(error PCLINT has not been set)endif@if [ ! -f $(lint_cmd) ] ; then \echo "ERROR: PCLINT program not found at: $(lint_cmd)";\exit 2;\fi#.. Lint configuration files# There are three# 1) System:Toolset specific - Named by the toolset# 2) User: Common - build.lnt# 3) User: Toolset specfic - Toolset named "lint.???"# Use same extensions as "warnings.???"#ifndef LINT_COFILE$(error TOOLSET does not support PCLINT)endiflint_cfg_file = $(GBE_CONFIG)/TOOLSET/$(LINT_COFILE)lint_cfg_file += $(wildcard $(GBE_ROOT)/build.lnt)ifdef LINT_PRJ_FILElint_prj_file := $(wildcard $(GBE_ROOT)/$(LINT_PRJ_FILE))ifdef lint_prj_filelint_cfg_file += +lnt\($(suffix $(LINT_PRJ_FILE))\) $(lint_prj_file)endifendif#.. Global flags## -b Disable banner.# -zero(400) Generate successful if no messages <400.# -dlint #define 'lint', compat with older source.# -I Add PCLINT to include path.## -passes(2) Walk passes, run thru at least two passes so that# cross-functional checks can be made.# -e306 Previously encountered module.#lint_cmd = $(subst \,/,$(PCLINT))/lint-nt.exelint_flags += \-b \'-zero(400)' \-dlint \-I$(PCLINT)\-e306ifdef LINTPASSESlint_flags += \'-passes($(LINTPASSES),-e306)'endif#.. Enable LINT lob packaging#ifndef LINTPACKAGELINTPACKAGE =elseLINTPACKAGE =YESendif#.. Search path#lint_libpath +=#.. Archive Lint## -u Unit checkout, disables the following messages, 526, 552,# 628, 714, 729, 755-759, 765, 768, 769, 1526, 1527, 1711,# 1714, 1715, and 1755.## 526 Symbol (Location) not defined.# 552 Symbol (Location) not accessed.# 628 No argument information provided for function Symbol.# 714 Symbol (Location) not referenced.# 729 Symbol (Location) not explicitly initialized.# 755,759,765-769# Global (type) Symbol (Location) not referenced.# 1526 Member function Symbol (Location) not defined.# 1527 Static member Symbol (Location) not defined.# 1711 class Symbol (Location) has a virtual function but# is not inherited.# 1714 Member function Symbol (Location) not referenced.# 1715 Static member Symbol (Location) not referenced.# 1755 Global template Symbol (Location) not referenced.## -oo Generate lint object#lint_arflags +=define ARLINT$(XX_PRE)echo [$(LIBNAME)] AR linting..$(XX_PRE)$(lint_cmd) $(lint_cfg_file) -u '-oo($(LIBNAME))' \$(lint_flags) $(lint_arflags) $(LIBCSRC) $(LIBCXXSRC)endef#.. Shared library lint## -u Unit checkout# -oo Generate lint object# --u Ignore modules contained within 'lnt' specification.# -e728 The name-intra module (static) variable is not initialised.#lint_shflags += \-u \--u \-e728define shlint_preecho [$(SHLIBNAME)] SH linting..; \export LINTLIBPATH; LINTLIBPATH="$(lint_libpath)"; \$(cmdfile) -NwkWeo$(SHLIBNAME).lnt \$(lint_shflags) "$($(SHLIBBASE)_shlnt)"endefifndef LEAVETMPdefine shlint_post$(rm) -f $(SHLIBNAME).lntendefelsedefine shlint_postendefendifdefine SHLIBLINT$(XX_PRE)$(shlint_pre)$(XX_PRE)$(show_environment)$(XX_PRE)$(lint_cmd) $(lint_cfg_file) $(lint_flags) '-oo($(SHLIBNAME))' $(SHLIBNAME).lnt \$(SHLIBCSRC) $(SHLIBCXXSRC)$(XX_PRE)$(shlint_post)endef#.. Program lint## --u Ignore modules contained within 'lnt' specification.# -e728 The name-intra module (static) variable is not initialised.#lint_ldflags += \--u \-e728define ldlint_preecho [$(PROGNAME)] PROG linting..; \export LINTLIBPATH; LINTLIBPATH="$(lint_libpath)"; \$(cmdfile) -NwkWeo$(PROGNAME).lnt \$(lint_ldflags) "$($(PROGBASE)_ldlnt)"endefifndef LEAVETMPdefine ldlint_post$(rm) -f $(PROGNAME).lntendefelsedefine ldlint_postendefendifdefine LDLINT$(XX_PRE)$(ldlint_pre)$(XX_PRE)$(show_environment)$(XX_PRE)$(lint_cmd) $(lint_cfg_file) $(lint_flags) $(PROGNAME).lnt \$(PROGCSRC) $(PROGCXXSRC)$(XX_PRE)$(ldlint_post)endef#