xref: /titanic_51/usr/src/uts/sparc/dad/Makefile (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
1a4aa671eSarutz#
2a4aa671eSarutz# CDDL HEADER START
3a4aa671eSarutz#
4a4aa671eSarutz# The contents of this file are subject to the terms of the
5a4aa671eSarutz# Common Development and Distribution License (the "License").
6a4aa671eSarutz# You may not use this file except in compliance with the License.
7a4aa671eSarutz#
8a4aa671eSarutz# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9a4aa671eSarutz# or http://www.opensolaris.org/os/licensing.
10a4aa671eSarutz# See the License for the specific language governing permissions
11a4aa671eSarutz# and limitations under the License.
12a4aa671eSarutz#
13a4aa671eSarutz# When distributing Covered Code, include this CDDL HEADER in each
14a4aa671eSarutz# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15a4aa671eSarutz# If applicable, add the following below this CDDL HEADER, with the
16a4aa671eSarutz# fields enclosed by brackets "[]" replaced with your own identifying
17a4aa671eSarutz# information: Portions Copyright [yyyy] [name of copyright owner]
18a4aa671eSarutz#
19a4aa671eSarutz# CDDL HEADER END
20a4aa671eSarutz#
21*7014882cSRichard Lowe
22a4aa671eSarutz#
23a4aa671eSarutz# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24a4aa671eSarutz# Use is subject to license terms.
25a4aa671eSarutz#
26*7014882cSRichard Lowe
27a4aa671eSarutz#
28a4aa671eSarutz#	This makefile drives the production of the dad driver kernel module.
29a4aa671eSarutz#
30a4aa671eSarutz#	SPARC architecture dependent
31a4aa671eSarutz#
32a4aa671eSarutz
33a4aa671eSarutz#
34a4aa671eSarutz#	Path to the base of the uts directory tree (usually /usr/src/uts).
35a4aa671eSarutz#
36a4aa671eSarutzUTSBASE	  = ../..
37a4aa671eSarutz
38a4aa671eSarutz#
39a4aa671eSarutz#	Define the module and object file sets.
40a4aa671eSarutz#
41a4aa671eSarutzMODULE		= dad
42a4aa671eSarutzOBJECTS		= $(DAD_OBJS:%=$(OBJS_DIR)/%)
43a4aa671eSarutzLINTS		= $(DAD_OBJS:%.o=$(LINTS_DIR)/%.ln)
44a4aa671eSarutzROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
45a4aa671eSarutzCONF_SRCDIR	= $(UTSBASE)/sun/io/dada/targets
46a4aa671eSarutzWARLOCK_OUT     = $(DAD_OBJS:%.o=%.ll)
47a4aa671eSarutzWARLOCK_OK      = $(MODULE).ok
48a4aa671eSarutzWLCMD_DIR	= $(UTSBASE)/common/io/warlock
49a4aa671eSarutz
50a4aa671eSarutz#
51a4aa671eSarutz#	Include common rules.
52a4aa671eSarutz#
53a4aa671eSarutzinclude $(UTSBASE)/sparc/Makefile.sparc
54a4aa671eSarutz
55a4aa671eSarutz
56a4aa671eSarutz#
57a4aa671eSarutz#	Define targets
58a4aa671eSarutz#
59a4aa671eSarutzALL_TARGET	= $(BINARY)
60a4aa671eSarutzLINT_TARGET	= $(MODULE).lint
61a4aa671eSarutzINSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
62a4aa671eSarutz
63a4aa671eSarutz#
64a4aa671eSarutz#	Overrides.
65a4aa671eSarutz#
66a4aa671eSarutzCFLAGS		+= $(CCVERBOSE)
67a4aa671eSarutzLDFLAGS         += -dy -Nmisc/dada  -Nmisc/cmlb
68a4aa671eSarutz
69a4aa671eSarutz#
70a4aa671eSarutz# For now, disable these lint checks; maintainers should endeavor
71a4aa671eSarutz# to investigate and remove these for maximum lint coverage.
72a4aa671eSarutz# Please do not carry these forward to new Makefiles.
73a4aa671eSarutz#
74a4aa671eSarutzLINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
75a4aa671eSarutzLINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
76a4aa671eSarutzLINTTAGS	+= -erroff=E_STATIC_UNUSED
77a4aa671eSarutzLINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
78a4aa671eSarutz
79*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-label
80*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-variable
81*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-function
82*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-uninitialized
83*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-parentheses
84*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-switch
85*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-type-limits
86*7014882cSRichard Lowe
87a4aa671eSarutz#
88a4aa671eSarutz#	Default build targets.
89a4aa671eSarutz#
90a4aa671eSarutz.KEEP_STATE:
91a4aa671eSarutz
92a4aa671eSarutzall:		$(ALL_DEPS)
93a4aa671eSarutz
94a4aa671eSarutzdef:		$(DEF_DEPS)
95a4aa671eSarutz
96a4aa671eSarutzclean:		$(CLEAN_DEPS)
97a4aa671eSarutz		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
98a4aa671eSarutz
99a4aa671eSarutzclobber:	$(CLOBBER_DEPS)
100a4aa671eSarutz		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
101a4aa671eSarutz
102a4aa671eSarutzlint:		$(LINT_DEPS)
103a4aa671eSarutz
104a4aa671eSarutzmodlintlib:	$(MODLINTLIB_DEPS) lint64
105a4aa671eSarutz
106a4aa671eSarutzclean.lint:	$(CLEAN_LINT_DEPS)
107a4aa671eSarutz
108a4aa671eSarutzinstall:	$(INSTALL_DEPS)
109a4aa671eSarutz
110a4aa671eSarutz#
111a4aa671eSarutz#	Include common targets.
112a4aa671eSarutz#
113a4aa671eSarutzinclude	$(UTSBASE)/sparc/Makefile.targ
114a4aa671eSarutz
115a4aa671eSarutz
116a4aa671eSarutz#
117a4aa671eSarutz#	Defines for local commands.
118a4aa671eSarutz#
119a4aa671eSarutzWARLOCK		= warlock
120a4aa671eSarutzWLCC		= wlcc
121a4aa671eSarutzTOUCH		= touch
122a4aa671eSarutzTEST		= test
123a4aa671eSarutz
124a4aa671eSarutz#
125a4aa671eSarutz# Warlock targets
126a4aa671eSarutz#
127a4aa671eSarutz# Note that in warlock_with_{esp,isp} it is important to load sd.ll
128a4aa671eSarutz# before {isp,esp}.ll; the reason is that both have _init/_info/_fini
129a4aa671eSarutz# and warlock can only handle one extern function by a given name;
130a4aa671eSarutz# any loaded after the first are ignored.
131a4aa671eSarutz
132a4aa671eSarutzDADA_FILES = $(DADA_OBJS:%.o=-l $(UTSBASE)/sparc/dada/%.ll)
133a4aa671eSarutzCMLB_FILES = $(CMLB_OBJS:%.o=-l $(UTSBASE)/sparc/cmlb/%.ll)
134a4aa671eSarutz
135a4aa671eSarutzwarlock: warlock_alone
136a4aa671eSarutz
137a4aa671eSarutzwarlock_alone: $(WARLOCK_OK)
138a4aa671eSarutz
139a4aa671eSarutzdada_files:
140a4aa671eSarutz	@cd $(UTSBASE)/sparc/dada; pwd; $(MAKE) warlock
141a4aa671eSarutz
142a4aa671eSarutzcmlb_files:
143a4aa671eSarutz	@cd $(UTSBASE)/sparc/cmlb; pwd; $(MAKE) warlock
144a4aa671eSarutz
145bf56214cSstevel$(WARLOCK_OK): $(WLCMD_DIR)/dad.wlcmd $(WARLOCK_OUT) dada_files \
146bf56214cSstevel	warlock_ddi.files cmlb_files
147a4aa671eSarutz	$(WARLOCK) -c $(WLCMD_DIR)/dad.wlcmd $(WARLOCK_OUT) -l $(DADA_FILES) \
148a4aa671eSarutz	-l $(CMLB_FILES) \
149a4aa671eSarutz	-l $(UTSBASE)/sparc/warlock/ddi_dki_impl.ll
150a4aa671eSarutz	$(TOUCH) $@
151a4aa671eSarutz
152a4aa671eSarutz%.ll: $(UTSBASE)/sun/io/dada/targets/%.c
153a4aa671eSarutz	$(WLCC) $(CPPFLAGS) -o $@ $<
154a4aa671eSarutz
155a4aa671eSarutzwarlock_ddi.files:
156a4aa671eSarutz	@cd $(UTSBASE)/sparc/warlock; pwd; $(MAKE) warlock
157