xref: /titanic_51/usr/src/uts/sparc/ib/Makefile (revision 25cf1a301a396c38e8adf52c15f537b80d2483f7)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#pragma ident	"%Z%%M%	%I%	%E% SMI"
27#
28#
29#
30#	This makefile drives the production of the ibnex driver
31#
32#	sparc architecture dependent
33#
34
35#
36#	Path to the base of the uts directory tree (usually /usr/src/uts).
37#
38UTSBASE	= ../..
39
40#
41#	Define the module and object file sets.
42#
43MODULE		= ib
44OBJECTS		= $(IB_OBJS:%=$(OBJS_DIR)/%)
45LINTS		= $(IB_OBJS:%.o=$(LINTS_DIR)/%.ln)
46ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
47CONF_SRCDIR	= $(UTSBASE)/common/io/ib/ibnex
48WARLOCK_OBJS	= $(IB_OBJS:%.o=%.ll)
49WARLOCK_OK	= $(MODULE).ok
50
51#
52#	Include common rules.
53#
54include $(UTSBASE)/sparc/Makefile.sparc
55
56#
57#	Define targets
58#
59ALL_TARGET	= $(BINARY) $(SRC_CONFILE)
60LINT_TARGET	= $(MODULE).lint
61INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
62
63#
64#	Overrides.
65#
66ALL_BUILDS	= $(ALL_BUILDSONLY64)
67DEF_BUILDS	= $(DEF_BUILDSONLY64)
68
69#
70# lint pass one enforcement
71#
72CFLAGS += $(CCVERBOSE)
73
74#
75#	depends on misc/ibtl
76#
77LDFLAGS	+= -dy -Nmisc/ibdm -Nmisc/ibtl
78
79#
80#	Default build targets.
81#
82.KEEP_STATE:
83
84def:		$(DEF_DEPS)
85
86all:		$(ALL_DEPS)
87
88clean:		$(CLEAN_DEPS); \
89		$(RM) $(WARLOCK_OBJS) $(WARLOCK_OK)
90
91clobber:	$(CLOBBER_DEPS); \
92		$(RM) $(WARLOCK_OBJS) $(WARLOCK_OK)
93
94lint:		$(LINT_DEPS)
95
96modlintlib:	$(MODLINTLIB_DEPS) lint32
97
98clean.lint:	$(CLEAN_LINT_DEPS)
99
100install:	$(INSTALL_DEPS)
101
102#
103#	Include common targets.
104#
105include $(UTSBASE)/sparc/Makefile.targ
106
107#
108#	Defines for local commands.
109#
110WARLOCK		= warlock
111WLCC		= wlcc
112TOUCH		= touch
113SCCS		= sccs
114TEST		= test
115
116warlock: $(MODULE).ok
117
118%.wlcmd:
119	$(TEST) -f $@ || $(SCCS) get $@
120
121ib.ok: $(WARLOCK_OBJS) ib.wlcmd ibdm_files warlock_ddi.files
122	$(WARLOCK) -c ./ib.wlcmd $(WARLOCK_OBJS)  \
123		-l ../ibdm/ibdm.ll -l ../warlock/ddi_dki_impl.ll
124	$(TOUCH) $@
125
126%.ll: $(UTSBASE)/common/io/ib/ibnex/%.c \
127		$(UTSBASE)/common/sys/ib/ibnex/ibnex.h \
128		$(UTSBASE)/common/sys/ib/ibnex/ibnex_devctl.h
129	$(WLCC)  $(CPPFLAGS) -DDEBUG -o $@ $<
130
131ibdm_files :
132	@cd ../ibdm; pwd; $(MAKE) warlock
133
134warlock_ddi.files:
135	@cd ../warlock; pwd; $(MAKE) warlock
136