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