xref: /titanic_52/usr/src/uts/intel/ahci/Makefile (revision 5c51f1241dbbdf2656d0e10011981411ed0c9673)
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 2008 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#
86
87#
88#	Default build targets.
89#
90.KEEP_STATE:
91
92def:		$(DEF_DEPS)
93
94all:		$(ALL_DEPS)
95
96clean:		$(CLEAN_DEPS)
97		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
98
99clobber:	$(CLOBBER_DEPS)
100		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
101
102lint:		$(LINT_DEPS)
103
104modlintlib:	$(MODLINTLIB_DEPS)
105
106clean.lint:	$(CLEAN_LINT_DEPS)
107
108install:	$(INSTALL_DEPS)
109
110#
111#	Include common targets.
112#
113include $(UTSBASE)/intel/Makefile.targ
114
115
116#
117#	Defines for local commands.
118#
119WARLOCK		= warlock
120WLCC		= wlcc
121TOUCH		= touch
122TEST		= test
123
124AHCI_FILES   = $(MODULE).ll
125SD_FILES = $(SD_OBJS:%.o=../sd/%.ll)
126SATA_FILES = $(SATA_OBJS:%.o=-l ../sata/%.ll)
127SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
128CMLB_FILES = $(CMLB_OBJS:%.o=-l ../cmlb/%.ll)
129
130warlock: $(WARLOCK_OK)
131
132$(WARLOCK_OK): $(WLCMD_DIR)/ahci.wlcmd $(WARLOCK_OUT) warlock_ddi.files \
133	sata.files scsi.files sd.files cmlb.files
134	$(WARLOCK) -c $(WLCMD_DIR)/ahci.wlcmd $(WARLOCK_OUT) \
135	$(SD_FILES) \
136	$(SCSI_FILES) \
137	$(CMLB_FILES) \
138        $(SATA_FILES) \
139	-l ../warlock/ddi_dki_impl.ll
140	$(TOUCH) $@
141
142%.ll: $(UTSBASE)/common/io/sata/adapters/ahci/%.c
143	$(WLCC) $(CPPFLAGS) -D DEBUG -o $@ $<
144
145sata.files:
146	@cd ../sata; pwd; $(MAKE) warlock
147
148scsi.files:
149	@cd ../scsi; pwd; $(MAKE) warlock
150
151sd.files:
152	@cd ../sd; pwd; $(MAKE) warlock_alone
153
154cmlb.files:
155	@cd ../cmlb; pwd; $(MAKE) warlock
156
157warlock_ddi.files:
158	@cd ../warlock; pwd; $(MAKE) warlock
159