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