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 (c) 2010, Oracle and/or its affiliates. All rights reserved.
23#
24#	This makefile drives the production of the rds driver 
25#	kernel module.
26#
27#	sparc architecture dependent
28#
29
30#
31#	Path to the base of the uts directory tree (usually /usr/src/uts).
32#
33UTSBASE	= ../..
34
35#
36#	Define the module and object file sets.
37#
38MODULE		= rdsv3
39OBJECTS		= $(RDSV3_OBJS:%=$(OBJS_DIR)/%)
40LINTS		= $(RDSV3_OBJS:%.o=$(LINTS_DIR)/%.ln)
41ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
42CONF_SRCDIR	= $(UTSBASE)/common/io/ib/clients/rdsv3
43WARLOCK_OUT     = $(RDSV3_OBJS:%.o=%.ll)
44WARLOCK_OK	= $(MODULE).ok
45WLCMD_DIR	= $(UTSBASE)/common/io/warlock
46
47#
48#	Include common rules.
49#
50include $(UTSBASE)/sparc/Makefile.sparc
51
52#
53#	Define targets
54#
55ALL_TARGET	= $(BINARY) $(SRC_CONFILE)
56LINT_TARGET	= $(MODULE).lint
57INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
58
59#
60# lint pass one enforcement and OS version
61#
62CFLAGS += $(CCVERBOSE)
63
64#
65# Disable these lint checks since some errors suppressed here are
66# in the OFED code, but we'd like to keep it as is as much as possible.
67# Note. maintainers should endeavor to investigate and remove these for
68# maximum lint coverage, but please do not carry these forward to new 
69# Makefiles blindly.
70#
71LINTTAGS        += -erroff=E_STATIC_UNUSED
72LINTTAGS        += -erroff=E_CONSTANT_CONDITION
73LINTTAGS	+= -erroff=E_FUNC_VAR_UNUSED
74LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
75LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
76LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
77LINTTAGS	+= -erroff=E_FUNC_SET_NOT_USED
78LINTTAGS	+= -erroff=E_FUNC_USED_VAR_ARG2
79LINTTAGS	+= -erroff=E_INCONS_ARG_USED2
80
81LDFLAGS += -dy -Nfs/sockfs -Nmisc/ksocket -Ndrv/ip -Nmisc/ibtl -Nmisc/ibcm -Nmisc/sol_ofs
82
83#
84#	Default build targets.
85#
86.KEEP_STATE:
87
88def:		$(DEF_DEPS)
89
90all:		$(ALL_DEPS)
91
92clean:		$(CLEAN_DEPS)
93
94clobber:	$(CLOBBER_DEPS)
95
96lint:		$(LINT_DEPS)
97
98modlintlib:	$(MODLINTLIB_DEPS) lint64
99
100clean.lint:	$(CLEAN_LINT_DEPS)
101
102install:	$(INSTALL_DEPS)
103
104$(ROOTLINK):	$(ROOT_STRMOD_DIR) $(ROOTMODULE)
105	-$(RM) $@; ln $(ROOTMODULE) $@
106
107#
108#	Include common targets.
109#
110include $(UTSBASE)/sparc/Makefile.targ
111
112#
113#       Defines for local commands.
114#
115WARLOCK         = warlock
116WLCC            = wlcc
117TOUCH           = touch
118TEST            = test
119
120warlock: $(WARLOCK_OK) $(WARLOCK_OUT)
121
122$(WARLOCK_OK): $(WARLOCK_OUT) $(WLCMD_DIR)/rdsv3.wlcmd warlock_ddi.files
123	$(WARLOCK) -c $(WLCMD_DIR)/rdsv3.wlcmd $(WARLOCK_OUT) \
124		-l ../warlock/ddi_dki_impl.ll
125	$(TOUCH) $@
126
127%.ll: $(UTSBASE)/common/io/ib/clients/rdsv3/%.c \
128	$(UTSBASE)/common/sys/ib/clients/rdsv3/ib.h \
129	$(UTSBASE)/common/sys/ib/clients/rdsv3/info.h \
130	$(UTSBASE)/common/sys/ib/clients/rdsv3/loop.h \
131	$(UTSBASE)/common/sys/ib/clients/rdsv3/rdma.h \
132	$(UTSBASE)/common/sys/ib/clients/rdsv3/rdma_transport.h \
133	$(UTSBASE)/common/sys/ib/clients/rdsv3/rds.h \
134	$(UTSBASE)/common/sys/ib/clients/rdsv3/rds_rdma.h \
135	$(UTSBASE)/common/sys/ib/clients/rdsv3/rdsv3_atomic.h \
136	$(UTSBASE)/common/sys/ib/clients/rdsv3/rdsv3_debug.h \
137	$(UTSBASE)/common/sys/ib/clients/rdsv3/rdsv3_impl.h \
138	$(UTSBASE)/common/sys/ib/clients/rdsv3/rdsv3_ofed_types.h \
139	$(UTSBASE)/common/sys/ib/clients/rdsv3/rdsv3_sc.h
140	$(WLCC)  $(CPPFLAGS) -DDEBUG -Dinline=  -o $@ $<
141
142warlock_ddi.files:
143	@cd ../warlock; pwd; $(MAKE) warlock
144