xref: /titanic_44/usr/src/uts/sparc/dad/Makefile (revision 87308b749adb04ab3f564c765b089962af3edb4d)
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
27#
28#	This makefile drives the production of the dad driver kernel module.
29#
30#	SPARC architecture dependent
31#
32
33#
34#	Path to the base of the uts directory tree (usually /usr/src/uts).
35#
36UTSBASE	  = ../..
37
38#
39#	Define the module and object file sets.
40#
41MODULE		= dad
42OBJECTS		= $(DAD_OBJS:%=$(OBJS_DIR)/%)
43LINTS		= $(DAD_OBJS:%.o=$(LINTS_DIR)/%.ln)
44ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
45CONF_SRCDIR	= $(UTSBASE)/sun/io/dada/targets
46WARLOCK_OUT     = $(DAD_OBJS:%.o=%.ll)
47WARLOCK_OK      = $(MODULE).ok
48WLCMD_DIR	= $(UTSBASE)/common/io/warlock
49
50#
51#	Include common rules.
52#
53include $(UTSBASE)/sparc/Makefile.sparc
54
55
56#
57#	Define targets
58#
59ALL_TARGET	= $(BINARY)
60LINT_TARGET	= $(MODULE).lint
61INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
62
63#
64#	Overrides.
65#
66CFLAGS		+= $(CCVERBOSE)
67LDFLAGS         += -dy -Nmisc/dada  -Nmisc/cmlb
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_BAD_PTR_CAST_ALIGN
75LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
76LINTTAGS	+= -erroff=E_STATIC_UNUSED
77LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
78
79CERRWARN	+= -_gcc=-Wno-unused-label
80CERRWARN	+= -_gcc=-Wno-unused-variable
81CERRWARN	+= -_gcc=-Wno-unused-function
82CERRWARN	+= -_gcc=-Wno-uninitialized
83CERRWARN	+= -_gcc=-Wno-parentheses
84CERRWARN	+= -_gcc=-Wno-switch
85CERRWARN	+= -_gcc=-Wno-type-limits
86
87#
88#	Default build targets.
89#
90.KEEP_STATE:
91
92all:		$(ALL_DEPS)
93
94def:		$(DEF_DEPS)
95
96clean:		$(CLEAN_DEPS)
97		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
98
99clobber:	$(CLOBBER_DEPS)
100		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
101
102lint:		$(LINT_DEPS)
103
104modlintlib:	$(MODLINTLIB_DEPS) lint64
105
106clean.lint:	$(CLEAN_LINT_DEPS)
107
108install:	$(INSTALL_DEPS)
109
110#
111#	Include common targets.
112#
113include	$(UTSBASE)/sparc/Makefile.targ
114
115
116#
117#	Defines for local commands.
118#
119WARLOCK		= warlock
120WLCC		= wlcc
121TOUCH		= touch
122TEST		= test
123
124#
125# Warlock targets
126#
127# Note that in warlock_with_{esp,isp} it is important to load sd.ll
128# before {isp,esp}.ll; the reason is that both have _init/_info/_fini
129# and warlock can only handle one extern function by a given name;
130# any loaded after the first are ignored.
131
132DADA_FILES = $(DADA_OBJS:%.o=-l $(UTSBASE)/sparc/dada/%.ll)
133CMLB_FILES = $(CMLB_OBJS:%.o=-l $(UTSBASE)/sparc/cmlb/%.ll)
134
135warlock: warlock_alone
136
137warlock_alone: $(WARLOCK_OK)
138
139dada_files:
140	@cd $(UTSBASE)/sparc/dada; pwd; $(MAKE) warlock
141
142cmlb_files:
143	@cd $(UTSBASE)/sparc/cmlb; pwd; $(MAKE) warlock
144
145$(WARLOCK_OK): $(WLCMD_DIR)/dad.wlcmd $(WARLOCK_OUT) dada_files \
146	warlock_ddi.files cmlb_files
147	$(WARLOCK) -c $(WLCMD_DIR)/dad.wlcmd $(WARLOCK_OUT) -l $(DADA_FILES) \
148	-l $(CMLB_FILES) \
149	-l $(UTSBASE)/sparc/warlock/ddi_dki_impl.ll
150	$(TOUCH) $@
151
152%.ll: $(UTSBASE)/sun/io/dada/targets/%.c
153	$(WLCC) $(CPPFLAGS) -o $@ $<
154
155warlock_ddi.files:
156	@cd $(UTSBASE)/sparc/warlock; pwd; $(MAKE) warlock
157