xref: /titanic_41/usr/src/uts/intel/ahci/Makefile (revision 3125ebfc35130d243e775dc38a6a59be4df0b137)
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 2006 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
125SCCS		= sccs
126TEST		= test
127
128AHCI_FILES   = $(MODULE).ll
129SD_FILES = $(SD_OBJS:%.o=../sd/%.ll)
130SATA_FILES = $(SATA_OBJS:%.o=-l ../sata/%.ll)
131SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
132
133warlock: $(WARLOCK_OK)
134
135%.wlcmd:
136	cd $(WLCMD_DIR); $(TEST) -f $@  || $(SCCS) get $@
137
138
139$(WARLOCK_OK): ahci.wlcmd $(WARLOCK_OUT)  warlock_ddi.files \
140	sata.files scsi.files sd.files
141	$(WARLOCK) -c $(WLCMD_DIR)/ahci.wlcmd $(WARLOCK_OUT) \
142	$(SD_FILES) \
143	$(SCSI_FILES) \
144        $(SATA_FILES) \
145	-l ../warlock/ddi_dki_impl.ll
146	$(TOUCH) $@
147
148%.ll: $(UTSBASE)/common/io/sata/adapters/ahci/%.c
149	$(WLCC) $(CPPFLAGS) -D DEBUG -o $@ $<
150
151sata.files:
152	@cd ../sata; pwd; $(MAKE) warlock
153
154scsi.files:
155	@cd ../scsi; pwd; $(MAKE) warlock
156
157sd.files:
158	@cd ../sd; pwd; $(MAKE) warlock_alone
159
160warlock_ddi.files:
161	@cd ../warlock; pwd; $(MAKE) warlock
162