xref: /titanic_50/usr/src/uts/sparc/ibmf/Makefile (revision e642872b5a76c4c8654eaa68f64986a85c86ca37)
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# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27#	This makefile drives the production of the ibmf kernel module.
28#
29#	sparc architecture dependent
30#
31
32#
33#	Path to the base of the uts directory tree (usually /usr/src/uts).
34#
35UTSBASE	= ../..
36
37#
38#	Define the module and object file sets.
39#
40MODULE		= ibmf
41OBJECTS		= $(IBMF_OBJS:%=$(OBJS_DIR)/%)
42LINTS		= $(IBMF_OBJS:%.o=$(LINTS_DIR)/%.ln)
43ROOTMODULE	= $(ROOT_MISC_DIR)/$(MODULE)
44LDFLAGS		+= -dy -Nmisc/ibtl
45WARLOCK_OUT     = $(IBMF_OBJS:%.o=%.ll)
46WARLOCK_OK      = $(MODULE).ok
47
48#
49#	Include common rules.
50#
51include $(UTSBASE)/sparc/Makefile.sparc
52
53#
54#	Define targets
55#
56ALL_TARGET	= $(BINARY)
57LINT_TARGET	= $(MODULE).lint
58INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
59
60#
61#	Overrides
62#
63
64#DEBUG_DEFS_DBG64 += -DTNF_DEBUG
65ALL_BUILDS	= $(ALL_BUILDSONLY64)
66DEF_BUILDS	= $(DEF_BUILDSONLY64)
67
68#
69# lint pass one enforcement
70#
71CFLAGS += $(CCVERBOSE)
72
73#
74# For now, disable these lint checks; maintainers should endeavor
75# to investigate and remove these for maximum lint coverage.
76# Please do not carry these forward to new Makefiles.
77#
78LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
79LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
80
81#
82#	Default build targets.
83#
84.KEEP_STATE:
85
86def:		$(DEF_DEPS)
87
88all:		$(ALL_DEPS)
89
90clean:		$(CLEAN_DEPS); \
91		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
92
93clobber:	$(CLOBBER_DEPS); \
94		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
95
96lint:		$(LINT_DEPS)
97
98modlintlib:	$(MODLINTLIB_DEPS) lint32
99
100clean.lint:	$(CLEAN_LINT_DEPS)
101
102install:	$(INSTALL_DEPS)
103
104#
105#	Include common targets.
106#
107include $(UTSBASE)/sparc/Makefile.targ
108
109#
110#	Defines for local commands.
111#
112WLCC		= wlcc
113TOUCH		= touch
114WARLOCK		= warlock
115SCS		= sccs
116TEST		= test
117
118#
119#	Warlock targets
120#
121WARLOCK_OBJECTS	= $(IBMF_OBJS:%.o=%.ll)
122IBMF_FILES = $(IBMF_OBJS:%.o= -l ../ibmf/%.ll)
123
124warlock: $(MODULE).ok
125
126%.wlcmd:
127	$(TEST) -f $@ || @$(SCCS) get $@
128
129$(MODULE).ok: $(WARLOCK_OBJECTS) warlock_ddi.files ibmf.wlcmd
130	$(WARLOCK) -c ibmf.wlcmd $(WARLOCK_OBJECTS) $(IBMF_FILES) \
131		-l ../warlock/ddi_dki_impl.ll
132	$(TOUCH) $@
133
134%.ll: $(UTSBASE)/common/io/ib/mgt/ibmf/%.c
135	$(WLCC) $(CPPFLAGS) -DNPROBE -DDEBUG -o $@ $<
136
137warlock_ddi.files:
138	@cd ../warlock; pwd; $(MAKE) warlock
139