xref: /titanic_41/usr/src/uts/sparc/ahci/Makefile (revision db0d7085f45406af6c45f0b36804a0a97f078084)
1# CDDL HEADER START
2#
3# The contents of this file are subject to the terms of the
4# Common Development and Distribution License (the "License").
5# You may not use this file except in compliance with the License.
6#
7# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8# or http://www.opensolaris.org/os/licensing.
9# See the License for the specific language governing permissions
10# and limitations under the License.
11#
12# When distributing Covered Code, include this CDDL HEADER in each
13# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14# If applicable, add the following below this CDDL HEADER, with the
15# fields enclosed by brackets "[]" replaced with your own identifying
16# information: Portions Copyright [yyyy] [name of copyright owner]
17#
18# CDDL HEADER END
19#
20
21#
22# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26#
27# uts/sparc/ahci/Makefile
28#
29#	This makefile drives the production of the
30#	"/kernel/drv/ahci" kernel module.
31#
32#	sparc architecture dependent
33#
34
35#
36#	Path to the base of the uts directory tree (usually /usr/src/uts).
37#
38UTSBASE	= ../..
39
40#
41#	Define the module and object file sets.
42#
43MODULE		= ahci
44OBJECTS		= $(AHCI_OBJS:%=$(OBJS_DIR)/%)
45LINTS		= $(AHCI_OBJS:%.o=$(LINTS_DIR)/%.ln)
46WARLOCK_OUT     = $(AHCI_OBJS:%.o=%.ll)
47WARLOCK_OK      = $(MODULE).ok
48ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
49CONF_SRCDIR     = $(UTSBASE)/common/io/sata/adapters/ahci
50WLCMD_DIR       = $(UTSBASE)/common/io/warlock
51
52#
53#	Include common rules.
54#
55include $(UTSBASE)/sparc/Makefile.sparc
56
57#
58#	Define targets
59#
60ALL_TARGET	= $(BINARY)
61LINT_TARGET	= $(MODULE).lint
62INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
63
64#
65#	Overrides.
66#
67DEBUG_FLGS	=
68DEBUG_DEFS	+= $(DEBUG_FLGS)
69
70#
71# lint pass one enforcement
72#
73CFLAGS += $(CCVERBOSE)
74
75CERRWARN	+= -_gcc=-Wno-parentheses
76CERRWARN	+= -_gcc=-Wno-unused-label
77CERRWARN	+= -_gcc=-Wno-uninitialized
78
79#
80#	Default build targets.
81#
82.KEEP_STATE:
83
84def:		$(DEF_DEPS)
85
86all:		$(ALL_DEPS)
87
88clean:		$(CLEAN_DEPS)
89		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
90
91clobber:	$(CLOBBER_DEPS)
92		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
93
94lint:		$(LINT_DEPS)
95
96modlintlib:	$(MODLINTLIB_DEPS)
97
98clean.lint:	$(CLEAN_LINT_DEPS)
99
100install:	$(INSTALL_DEPS)
101
102#
103#	Include common targets.
104#
105include $(UTSBASE)/sparc/Makefile.targ
106
107
108#
109#	Defines for local commands.
110#
111WARLOCK		= warlock
112WLCC		= wlcc
113TOUCH		= touch
114TEST		= test
115
116SD_FILES = $(SD_OBJS:%.o=../sd/%.ll)
117SATA_FILES = $(SATA_OBJS:%.o=-l ../sata/%.ll)
118SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
119CMLB_FILES = $(CMLB_OBJS:%.o=-l ../cmlb/%.ll)
120
121warlock: $(WARLOCK_OK)
122
123$(WARLOCK_OK): $(WLCMD_DIR)/ahci.wlcmd $(WARLOCK_OUT) warlock_ddi.files \
124	sata.files scsi.files sd.files cmlb.files
125	$(WARLOCK) -c $(WLCMD_DIR)/ahci.wlcmd $(WARLOCK_OUT) \
126	$(SD_FILES) \
127	$(SCSI_FILES) \
128	$(CMLB_FILES) \
129        $(SATA_FILES) \
130	-l ../warlock/ddi_dki_impl.ll
131	$(TOUCH) $@
132
133%.ll: $(UTSBASE)/common/io/sata/adapters/ahci/%.c
134	$(WLCC) $(CPPFLAGS) -D DEBUG -D __sparcv9 -o $@ $<
135
136sata.files:
137	@cd ../sata; pwd; $(MAKE) warlock
138
139scsi.files:
140	@cd ../scsi; pwd; $(MAKE) warlock
141
142sd.files:
143	@cd ../sd; pwd; $(MAKE) warlock_alone
144
145cmlb.files:
146	@cd ../cmlb; pwd; $(MAKE) warlock
147
148
149warlock_ddi.files:
150	@cd ../warlock; pwd; $(MAKE) warlock
151