xref: /titanic_44/usr/src/uts/intel/st/Makefile (revision 2ec7cc7fc084163eaed884efee9bbd322cc8951b)
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# uts/intel/st/Makefile
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#	This makefile drives the production of the st driver
29#	kernel module.
30#
31#	intel implementation architecture independent
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		= st
43OBJECTS		= $(ST_OBJS:%=$(OBJS_DIR)/%)
44LINTS		= $(ST_OBJS:%.o=$(LINTS_DIR)/%.ln)
45ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
46CONF_SRCDIR	= $(UTSBASE)/intel/io/scsi/targets
47WARLOCK_OUT     = $(ST_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) $(SRC_CONFILE)
60LINT_TARGET	= $(MODULE).lint
61INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
62
63#
64#	Overrides.
65#
66DEBUG_FLGS	=
67DEBUG_DEFS	+= $(DEBUG_FLGS)
68
69#
70# For now, disable these lint checks; maintainers should endeavor
71# to investigate and remove these for maximum lint coverage.
72# Please do not carry these forward to new Makefiles.
73#
74LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
75LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
76LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
77
78#
79#	Default build targets.
80#
81.KEEP_STATE:
82
83def:		$(DEF_DEPS)
84
85all:		$(ALL_DEPS)
86
87clean:		$(CLEAN_DEPS)
88		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
89
90clobber:	$(CLOBBER_DEPS)
91		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
92
93lint:		$(LINT_DEPS)
94
95modlintlib:	$(MODLINTLIB_DEPS)
96
97clean.lint:	$(CLEAN_LINT_DEPS)
98
99install:	$(INSTALL_DEPS)
100
101#
102#	Include common targets.
103#
104include $(UTSBASE)/intel/Makefile.targ
105
106#
107#	Defines for local commands.
108#
109WARLOCK		= warlock
110WLCC		= wlcc
111TOUCH		= touch
112TEST		= test
113
114#
115# Warlock targets
116#
117
118SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll)
119
120WARLOCK_TARGETS = warlock_alone
121$(CLOSED_BUILD)WARLOCK_TARGETS += warlock_with_glm
122
123warlock: $(WARLOCK_TARGETS)
124
125warlock_alone: $(WARLOCK_OK)
126
127scsi_files:
128	@cd ../scsi; pwd; $(MAKE) warlock
129
130$(WARLOCK_OK): 	$(WLCMD_DIR)/st.wlcmd $(WARLOCK_OUT) scsi_files \
131	warlock_ddi.files
132	$(WARLOCK) -c $(WLCMD_DIR)/st.wlcmd $(WARLOCK_OUT) $(SCSI_FILES) \
133	-l ../warlock/ddi_dki_impl.ll
134	$(TOUCH) $@
135
136%.ll: $(UTSBASE)/common/io/scsi/targets/%.c
137	$(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<
138
139warlock_with_glm: $(WLCMD_DIR)/st_with_glm.wlcmd $(WARLOCK_OUT) scsi_files \
140	glm_files warlock_ddi.files
141	$(WARLOCK) -c $(WLCMD_DIR)/st_with_glm.wlcmd \
142		$(WARLOCK_OUT) $(CLOSED)/uts/intel/glm/glm $(SCSI_FILES) \
143		-l ../warlock/ddi_dki_impl.ll
144glm_files:
145	@cd $(CLOSED)/uts/intel/glm; pwd; $(MAKE) warlock
146
147warlock_ddi.files:
148	@cd ../warlock; pwd; $(MAKE) warlock
149
150scsi.files:
151	@cd ../scsi; pwd; $(MAKE) warlock
152