181N/A#
181N/A# CDDL HEADER START
181N/A#
181N/A# The contents of this file are subject to the terms of the
181N/A# Common Development and Distribution License (the "License").
181N/A# You may not use this file except in compliance with the License.
181N/A#
181N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
181N/A# or http://www.opensolaris.org/os/licensing.
181N/A# See the License for the specific language governing permissions
181N/A# and limitations under the License.
181N/A#
181N/A# When distributing Covered Code, include this CDDL HEADER in each
181N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
181N/A# If applicable, add the following below this CDDL HEADER, with the
181N/A# fields enclosed by brackets "[]" replaced with your own identifying
181N/A# information: Portions Copyright [yyyy] [name of copyright owner]
181N/A#
181N/A# CDDL HEADER END
181N/A#
5680N/A
5680N/A#
5680N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
181N/A#
181N/A
181N/A#
181N/A# Rules and Macros for building lint libraries. This searches for lint
181N/A# libraries in the component directory and adds targets to build and install
181N/A# them for 32/64 bit.
181N/A#
3817N/A# To use these rules, include $(WS_MAKE_RULES)/lint-libraries.mk in your
181N/A# Makefile and add your lint library source in your component directory as
181N/A# llib-l{lib}.
181N/A#
181N/A# Makefile
3817N/A# include $(WS_MAKE_RULES)/lint-libraries.mk
181N/A#
181N/A# llib-l{libname}
181N/A#
181N/A
5680N/ALINT_LIBRARIES ?= $(wildcard llib-*)
181N/A
181N/ALINT_FLAGS = -nsvx -I$(@D) -I$(SOURCE_DIR)/include -I$(SOURCE_DIR)
181N/A
181N/A# template for lint library rules. new rules will be added automatically
181N/Adefine lintlib-rule
181N/A$(BUILD_DIR_32)/$(1).ln: BITS=32
181N/A$(BUILD_DIR_64)/$(1).ln: BITS=64
181N/A
254N/A$$(BUILD_DIR)/%/$(1).ln: $(1) $(BUILD_DIR)/%/.installed
181N/A (cd $$(@D) ; $$(LINT) $$(LINT_FLAGS) -o $$(@F:llib-l%.ln=%) ../../$$<)
181N/A
181N/A$$(PROTOUSRLIBDIR)/$(1): $(1)
181N/A $(INSTALL) -c $$< $$@
181N/A
181N/A$$(PROTOUSRLIBDIR)/$(1).ln: $$(BUILD_DIR)/$(MACH32)/$(1).ln
181N/A $(INSTALL) -c $$< $$@
181N/A
181N/A$$(PROTOUSRLIBDIR64)/$(1).ln: $$(BUILD_DIR)/$(MACH64)/$(1).ln
181N/A $(INSTALL) -c $$< $$@
181N/A
181N/ABUILD_32 += $(BUILD_DIR_32)/$(1).ln
181N/ABUILD_64 += $(BUILD_DIR_64)/$(1).ln
181N/AINSTALL_32 += $(PROTOUSRLIBDIR)/$(1)
181N/AINSTALL_32 += $(PROTOUSRLIBDIR)/$(1).ln
181N/AINSTALL_64 += $(PROTOUSRLIBDIR64)/$(1).ln
181N/Aendef
181N/A
181N/A# Generate the lint library rules from the above template
181N/A$(foreach lintlib,$(LINT_LIBRARIES),$(eval $(call lintlib-rule,$(lintlib))))