xref: /titanic_50/usr/src/uts/sparc/dad/Makefile (revision 672986541be54a7a471bb088e60780c37e371d7e)
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
115SCCS		= sccs
116TEST		= test
117
118#
119# Warlock targets
120#
121# Note that in warlock_with_{esp,isp} it is important to load sd.ll
122# before {isp,esp}.ll; the reason is that both have _init/_info/_fini
123# and warlock can only handle one extern function by a given name;
124# any loaded after the first are ignored.
125
126DADA_FILES = $(DADA_OBJS:%.o=-l $(UTSBASE)/sparc/dada/%.ll)
127CMLB_FILES = $(CMLB_OBJS:%.o=-l $(UTSBASE)/sparc/cmlb/%.ll)
128
129warlock: warlock_alone
130
131warlock_alone: $(WARLOCK_OK)
132
133%.wlcmd:
134	cd $(WLCMD_DIR); $(TEST) -f $@  || $(SCCS) get $@
135
136dada_files:
137	@cd $(UTSBASE)/sparc/dada; pwd; $(MAKE) warlock
138
139cmlb_files:
140	@cd $(UTSBASE)/sparc/cmlb; pwd; $(MAKE) warlock
141
142$(WARLOCK_OK): dad.wlcmd $(WARLOCK_OUT)  dada_files warlock_ddi.files cmlb_files dad.wlcmd
143	$(WARLOCK) -c $(WLCMD_DIR)/dad.wlcmd $(WARLOCK_OUT) -l $(DADA_FILES) \
144	-l $(CMLB_FILES) \
145	-l $(UTSBASE)/sparc/warlock/ddi_dki_impl.ll
146	$(TOUCH) $@
147
148%.ll: $(UTSBASE)/sun/io/dada/targets/%.c
149	$(WLCC) $(CPPFLAGS) -o $@ $<
150
151warlock_ddi.files:
152	@cd $(UTSBASE)/sparc/warlock; pwd; $(MAKE) warlock
153