dcraw: fix install in non-clean directory
[unleashed-userland.git] / make-rules / lint-libraries.mk
blobebb6ef22d8efccadbe5349589f518e6ff879b642
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
21 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
25 # Rules and Macros for building lint libraries. This searches for lint
26 # libraries in the component directory and adds targets to build and install
27 # them for 32/64 bit.
29 # To use these rules, include $(WS_TOP)/make-rules/lint-libraries.mk in your
30 # Makefile and add your lint library source in your component directory as
31 # llib-l{lib}.
33 # Makefile
34 # include $(WS_TOP)/make-rules/lint-libraries.mk
36 # llib-l{libname}
39 LINT_LIBRARIES = $(wildcard llib-*)
41 LINT_FLAGS = -nsvx -I$(@D) -I$(SOURCE_DIR)/include -I$(SOURCE_DIR)
43 # template for lint library rules. new rules will be added automatically
44 define lintlib-rule
45 $(BUILD_DIR_32)/$(1).ln: BITS=32
46 $(BUILD_DIR_64)/$(1).ln: BITS=64
48 $$(BUILD_DIR)/%/$(1).ln: $(1) $(BUILD_DIR)/%/.installed
49 (cd $$(@D) ; $$(LINT) $$(LINT_FLAGS) -o $$(@F:llib-l%.ln=%) ../../$$<)
51 $$(PROTOUSRLIBDIR)/$(1): $(1)
52 $(INSTALL) -c $$< $$@
54 $$(PROTOUSRLIBDIR)/$(1).ln: $$(BUILD_DIR)/$(MACH32)/$(1).ln
55 $(INSTALL) -c $$< $$@
57 $$(PROTOUSRLIBDIR64)/$(1).ln: $$(BUILD_DIR)/$(MACH64)/$(1).ln
58 $(INSTALL) -c $$< $$@
60 BUILD_32 += $(BUILD_DIR_32)/$(1).ln
61 BUILD_64 += $(BUILD_DIR_64)/$(1).ln
62 INSTALL_32 += $(PROTOUSRLIBDIR)/$(1)
63 INSTALL_32 += $(PROTOUSRLIBDIR)/$(1).ln
64 INSTALL_64 += $(PROTOUSRLIBDIR64)/$(1).ln
65 endef
67 # Generate the lint library rules from the above template
68 $(foreach lintlib,$(LINT_LIBRARIES),$(eval $(call lintlib-rule,$(lintlib))))