xref: /titanic_41/usr/src/uts/sparc/dad/Makefile (revision 8d483882aa3390058094b043f3d62187b5d1de03)
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#ident	"%Z%%M%	%I%	%E% SMI"
23#
24# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27# uts/sparc/dad/Makefile
28#
29#	This makefile drives the production of the dad driver kernel module.
30#
31#	SPARC 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		= dad
43OBJECTS		= $(DAD_OBJS:%=$(OBJS_DIR)/%)
44LINTS		= $(DAD_OBJS:%.o=$(LINTS_DIR)/%.ln)
45ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
46CONF_SRCDIR	= $(UTSBASE)/sun/io/dada/targets
47WARLOCK_OUT     = $(DAD_OBJS:%.o=%.ll)
48WARLOCK_OK      = $(MODULE).ok
49WLCMD_DIR	= $(UTSBASE)/common/io/warlock
50
51#
52#	Include common rules.
53#
54include $(UTSBASE)/sparc/Makefile.sparc
55
56
57#
58#	Define targets
59#
60ALL_TARGET	= $(BINARY)
61LINT_TARGET	= $(MODULE).lint
62INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
63
64#
65#	Overrides.
66#
67CFLAGS		+= $(CCVERBOSE)
68LDFLAGS         += -dy -Nmisc/dada  -Nmisc/cmlb
69
70#
71# For now, disable these lint checks; maintainers should endeavor
72# to investigate and remove these for maximum lint coverage.
73# Please do not carry these forward to new Makefiles.
74#
75LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
76LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
77LINTTAGS	+= -erroff=E_STATIC_UNUSED
78LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
79
80#
81#	Default build targets.
82#
83.KEEP_STATE:
84
85all:		$(ALL_DEPS)
86
87def:		$(DEF_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) lint64
98
99clean.lint:	$(CLEAN_LINT_DEPS)
100
101install:	$(INSTALL_DEPS)
102
103#
104#	Include common targets.
105#
106include	$(UTSBASE)/sparc/Makefile.targ
107
108
109#
110#	Defines for local commands.
111#
112WARLOCK		= warlock
113WLCC		= wlcc
114TOUCH		= touch
115TEST		= test
116
117#
118# Warlock targets
119#
120# Note that in warlock_with_{esp,isp} it is important to load sd.ll
121# before {isp,esp}.ll; the reason is that both have _init/_info/_fini
122# and warlock can only handle one extern function by a given name;
123# any loaded after the first are ignored.
124
125DADA_FILES = $(DADA_OBJS:%.o=-l $(UTSBASE)/sparc/dada/%.ll)
126CMLB_FILES = $(CMLB_OBJS:%.o=-l $(UTSBASE)/sparc/cmlb/%.ll)
127
128warlock: warlock_alone
129
130warlock_alone: $(WARLOCK_OK)
131
132dada_files:
133	@cd $(UTSBASE)/sparc/dada; pwd; $(MAKE) warlock
134
135cmlb_files:
136	@cd $(UTSBASE)/sparc/cmlb; pwd; $(MAKE) warlock
137
138$(WARLOCK_OK): $(WLCMD_DIR)/dad.wlcmd $(WARLOCK_OUT) dada_files \
139	warlock_ddi.files cmlb_files
140	$(WARLOCK) -c $(WLCMD_DIR)/dad.wlcmd $(WARLOCK_OUT) -l $(DADA_FILES) \
141	-l $(CMLB_FILES) \
142	-l $(UTSBASE)/sparc/warlock/ddi_dki_impl.ll
143	$(TOUCH) $@
144
145%.ll: $(UTSBASE)/sun/io/dada/targets/%.c
146	$(WLCC) $(CPPFLAGS) -o $@ $<
147
148warlock_ddi.files:
149	@cd $(UTSBASE)/sparc/warlock; pwd; $(MAKE) warlock
150