8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / uts / sparc / sd / Makefile
blobea74399df4e7590cdb26fbaeae76b9b71c73ba28
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
22 # uts/sparc/sd/Makefile
24 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
26 # Copyright (c) 2011 Bayard G. Bell. All rights reserved.
28 # This makefile drives the production of the sd driver kernel module.
30 # sparc architecture dependent
34 # Path to the base of the uts directory tree (usually /usr/src/uts).
36 UTSBASE = ../..
39 # Define the module and object file sets.
41 MODULE = sd
42 OBJECTS = $(SD_OBJS:%=$(OBJS_DIR)/%)
43 LINTS = $(SD_OBJS:%.o=$(LINTS_DIR)/%.ln)
44 ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE)
45 CONF_SRCDIR = $(UTSBASE)/sun/io/scsi/targets
46 WARLOCK_OUT = $(SD_OBJS:%.o=%.ll)
47 WARLOCK_OK = $(MODULE).ok
48 WLCMD_DIR = $(UTSBASE)/common/io/warlock
51 # Include common rules.
53 include $(UTSBASE)/sparc/Makefile.sparc
56 # Define targets
58 ALL_TARGET = $(BINARY) $(SRC_CONFILE)
59 LINT_TARGET = $(MODULE).lint
60 INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
63 # lint pass one enforcement
65 CFLAGS += $(CCVERBOSE)
68 # Define dependencies on scsi and cmlb
70 LDFLAGS += -dy -N misc/scsi -N misc/cmlb
73 # For now, disable these lint checks; maintainers should endeavor
74 # to investigate and remove these for maximum lint coverage.
75 # Please do not carry these forward to new Makefiles.
77 LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
78 LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
79 LINTTAGS += -erroff=E_STATIC_UNUSED
80 LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
83 # Default build targets.
85 .KEEP_STATE:
87 all: $(ALL_DEPS)
89 def: $(DEF_DEPS)
91 clean: $(CLEAN_DEPS)
92 $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
94 clobber: $(CLOBBER_DEPS)
95 $(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
97 lint: $(LINT_DEPS)
99 modlintlib: $(MODLINTLIB_DEPS)
101 clean.lint: $(CLEAN_LINT_DEPS)
103 install: $(INSTALL_DEPS)
106 # Include common targets.
108 include $(UTSBASE)/sparc/Makefile.targ
112 # Defines for local commands.
114 WARLOCK = warlock
115 WLCC = wlcc
116 TOUCH = touch
117 TEST = test
120 # Warlock targets
122 # Note that in warlock_with_{esp,isp} it is important to load sd.ll
123 # before {isp,esp}.ll; the reason is that both have _init/_info/_fini
124 # and warlock can only handle one extern function by a given name;
125 # any loaded after the first are ignored.
127 SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
128 CMLB_FILES = $(CMLB_OBJS:%.o=-l ../cmlb/%.ll)
130 WARLOCK_TARGETS = warlock_alone warlock_with_esp warlock_with_fas
132 warlock: $(WARLOCK_TARGETS)
134 warlock_alone: $(WARLOCK_OK)
136 $(WARLOCK_OK): $(WLCMD_DIR)/sd.wlcmd $(WARLOCK_OUT) scsi_files \
137 warlock_ddi.files cmlb_files
138 $(WARLOCK) -c $(WLCMD_DIR)/sd.wlcmd $(WARLOCK_OUT) $(SCSI_FILES) \
139 $(CMLB_FILES) \
140 -l ../warlock/ddi_dki_impl.ll
141 $(TOUCH) $@
143 %.ll: $(UTSBASE)/common/io/scsi/targets/%.c
144 $(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
146 warlock_with_esp: $(WLCMD_DIR)/sd_with_esp.wlcmd $(WARLOCK_OUT) scsi_files \
147 esp_files warlock_ddi.files cmlb_files
148 $(WARLOCK) -c $(WLCMD_DIR)/sd_with_esp.wlcmd \
149 $(WARLOCK_OUT) ../esp/esp $(SCSI_FILES) $(CMLB_FILES) \
150 -l ../warlock/ddi_dki_impl.ll
152 warlock_with_fas: $(WLCMD_DIR)/sd_with_fas.wlcmd $(WARLOCK_OUT) scsi_files \
153 fas_files warlock_ddi.files cmlb_files
154 $(WARLOCK) -c $(WLCMD_DIR)/sd_with_fas.wlcmd \
155 $(WARLOCK_OUT) ../fas/fas \
156 ../fas/fas_callbacks \
157 $(SCSI_FILES) $(CMLB_FILES) \
158 -l ../warlock/ddi_dki_impl.ll
160 cmlb_files:
161 @cd ../cmlb; pwd; $(MAKE) warlock
164 scsi_files:
165 @cd ../scsi; pwd; $(MAKE) warlock
167 esp_files:
168 @cd ../esp; pwd; $(MAKE) warlock
170 fas_files:
171 @cd ../fas; pwd; $(MAKE) warlock
173 warlock_ddi.files:
174 @cd ../warlock; pwd; $(MAKE) warlock