xref: /titanic_52/usr/src/uts/intel/ahci/Makefile (revision b6c3f7863936abeae522e48a13887dddeb691a45)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29#
30#	This makefile drives the production of the
31#	"/kernel/drv/ahci" kernel module.
32#
33#	intel architecture dependent
34#
35
36#
37#	Path to the base of the uts directory tree (usually /usr/src/uts).
38#
39UTSBASE	= ../..
40
41#
42#	Define the module and object file sets.
43#
44MODULE		= ahci
45OBJECTS		= $(AHCI_OBJS:%=$(OBJS_DIR)/%)
46LINTS		= $(AHCI_OBJS:%.o=$(LINTS_DIR)/%.ln)
47ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
48CONF_SRCDIR     = $(UTSBASE)/common/io/sata/adapters/ahci
49WARLOCK_OUT     = $(AHCI_OBJS:%.o=%.ll)
50WARLOCK_OK      = $(MODULE).ok
51WLCMD_DIR	= $(UTSBASE)/common/io/warlock
52
53#
54#	Include common rules.
55#
56include $(UTSBASE)/intel/Makefile.intel
57
58#
59#	Define targets
60#
61ALL_TARGET	= $(BINARY)
62LINT_TARGET	= $(MODULE).lint
63INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
64
65#
66#	Overrides.
67#
68DEBUG_FLGS	=
69DEBUG_DEFS	+= $(DEBUG_FLGS)
70
71#
72# lint pass one enforcement
73#
74CFLAGS += $(CCVERBOSE)
75
76#
77#
78# we depend on the sata module
79LDFLAGS += -dy -N misc/sata
80
81#
82# For now, disable these lint checks; maintainers should endeavor
83# to investigate and remove these for maximum lint coverage.
84# Please do not carry these forward to new Makefiles.
85#
86LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
87LINTTAGS	+= -erroff=E_STATIC_UNUSED
88LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
89
90#
91#	Default build targets.
92#
93.KEEP_STATE:
94
95def:		$(DEF_DEPS)
96
97all:		$(ALL_DEPS)
98
99clean:		$(CLEAN_DEPS)
100		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
101
102clobber:	$(CLOBBER_DEPS)
103		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
104
105lint:		$(LINT_DEPS)
106
107modlintlib:	$(MODLINTLIB_DEPS)
108
109clean.lint:	$(CLEAN_LINT_DEPS)
110
111install:	$(INSTALL_DEPS)
112
113#
114#	Include common targets.
115#
116include $(UTSBASE)/intel/Makefile.targ
117
118
119#
120#	Defines for local commands.
121#
122WARLOCK		= warlock
123WLCC		= wlcc
124TOUCH		= touch
125TEST		= test
126
127AHCI_FILES   = $(MODULE).ll
128SD_FILES = $(SD_OBJS:%.o=../sd/%.ll)
129SATA_FILES = $(SATA_OBJS:%.o=-l ../sata/%.ll)
130SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
131CMLB_FILES = $(CMLB_OBJS:%.o=-l ../cmlb/%.ll)
132
133warlock: $(WARLOCK_OK)
134
135$(WARLOCK_OK): $(WLCMD_DIR)/ahci.wlcmd $(WARLOCK_OUT) warlock_ddi.files \
136	sata.files scsi.files sd.files cmlb.files
137	$(WARLOCK) -c $(WLCMD_DIR)/ahci.wlcmd $(WARLOCK_OUT) \
138	$(SD_FILES) \
139	$(SCSI_FILES) \
140	$(CMLB_FILES) \
141        $(SATA_FILES) \
142	-l ../warlock/ddi_dki_impl.ll
143	$(TOUCH) $@
144
145%.ll: $(UTSBASE)/common/io/sata/adapters/ahci/%.c
146	$(WLCC) $(CPPFLAGS) -D DEBUG -o $@ $<
147
148sata.files:
149	@cd ../sata; pwd; $(MAKE) warlock
150
151scsi.files:
152	@cd ../scsi; pwd; $(MAKE) warlock
153
154sd.files:
155	@cd ../sd; pwd; $(MAKE) warlock_alone
156
157cmlb.files:
158	@cd ../cmlb; pwd; $(MAKE) warlock
159
160warlock_ddi.files:
161	@cd ../warlock; pwd; $(MAKE) warlock
162