8354 sync regcomp(3C) with upstream (fix make catalog)
[unleashed/tickless.git] / usr / src / uts / intel / sd / Makefile
blob90e10840c1e9cfe2ecba335cbb227524d418788b
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 # uts/intel/io/sd/Makefile
23 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 # Copyright (c) 2011 Bayard G. Bell. All rights reserved.
27 # This makefile drives the production of the sd
28 # kernel module.
33 # Path to the base of the uts directory tree (usually /usr/src/uts).
35 UTSBASE = ../..
38 # Define the module and object file sets.
40 MODULE = sd
41 OBJECTS = $(SD_OBJS:%=$(OBJS_DIR)/%)
42 LINTS = $(SD_OBJS:%.o=$(LINTS_DIR)/%.ln)
43 ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE)
44 CONF_SRCDIR = $(UTSBASE)/intel/io/scsi/targets
45 WARLOCK_OUT = $(SD_OBJS:%.o=%.ll)
46 WARLOCK_OK = $(MODULE).ok
47 WLCMD_DIR = $(UTSBASE)/common/io/warlock
50 # Include common rules.
52 include $(UTSBASE)/intel/Makefile.intel
55 # Define targets
57 ALL_TARGET = $(BINARY) $(CONFMOD)
58 LINT_TARGET = $(MODULE).lint
59 INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
62 # Overrides.
64 DEBUG_FLGS =
65 DEBUG_DEFS += $(DEBUG_FLGS)
67 INC_PATH += -I$(UTSBASE)/intel/io/scsi/targets
70 # For now, disable these lint checks; maintainers should endeavor
71 # to investigate and remove these for maximum lint coverage.
72 # Please do not carry these forward to new Makefiles.
74 LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
75 LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
76 LINTTAGS += -erroff=E_STATIC_UNUSED
77 LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
78 LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
81 # Depends on scsi and cmlb
83 LDFLAGS += -dy -N misc/scsi -N misc/cmlb
86 # Default build targets.
88 .KEEP_STATE:
90 def: $(DEF_DEPS)
92 all: $(ALL_DEPS)
94 clean: $(CLEAN_DEPS)
95 $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
97 clobber: $(CLOBBER_DEPS)
98 $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
100 lint: $(LINT_DEPS)
102 modlintlib: $(MODLINTLIB_DEPS)
104 clean.lint: $(CLEAN_LINT_DEPS)
106 install: $(INSTALL_DEPS)
109 # Include common targets.
111 include $(UTSBASE)/intel/Makefile.targ
115 # Defines for local commands.
117 WARLOCK = warlock
118 WLCC = wlcc
119 TOUCH = touch
120 TEST = test
123 # Warlock targets
125 # Note that in warlock_with_{esp,isp} it is important to load sd.ll
126 # before {isp,esp}.ll; the reason is that both have _init/_info/_fini
127 # and warlock can only handle one extern function by a given name;
128 # any loaded after the first are ignored.
130 SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
131 CMLB_FILES = $(CMLB_OBJS:%.o=-l ../cmlb/%.ll)
133 WARLOCK_TARGETS = warlock_alone
135 warlock: $(WARLOCK_TARGETS)
137 warlock_alone: $(WARLOCK_OK)
139 $(WARLOCK_OK): $(WLCMD_DIR)/sd.wlcmd $(WARLOCK_OUT) scsi_files \
140 warlock_ddi.files cmlb_files
141 $(WARLOCK) -c $(WLCMD_DIR)/sd.wlcmd $(WARLOCK_OUT) $(SCSI_FILES) \
142 $(CMLB_FILES) \
143 -l ../warlock/ddi_dki_impl.ll
144 $(TOUCH) $@
146 %.ll: $(UTSBASE)/common/io/scsi/targets/%.c
147 $(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
149 cmlb_files:
150 @cd ../cmlb; pwd; $(MAKE) warlock
152 scsi_files:
153 @cd ../scsi; pwd; $(MAKE) warlock
155 warlock_ddi.files:
156 @cd ../warlock; pwd; $(MAKE) warlock