xref: /titanic_50/usr/src/uts/sun4v/nxge/Makefile (revision 4496171313bed39e96f21bc2f9faf2868e267ae3)
1*44961713Sgirish#
2*44961713Sgirish# CDDL HEADER START
3*44961713Sgirish#
4*44961713Sgirish# The contents of this file are subject to the terms of the
5*44961713Sgirish# Common Development and Distribution License (the "License").
6*44961713Sgirish# You may not use this file except in compliance with the License.
7*44961713Sgirish#
8*44961713Sgirish# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*44961713Sgirish# or http://www.opensolaris.org/os/licensing.
10*44961713Sgirish# See the License for the specific language governing permissions
11*44961713Sgirish# and limitations under the License.
12*44961713Sgirish#
13*44961713Sgirish# When distributing Covered Code, include this CDDL HEADER in each
14*44961713Sgirish# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*44961713Sgirish# If applicable, add the following below this CDDL HEADER, with the
16*44961713Sgirish# fields enclosed by brackets "[]" replaced with your own identifying
17*44961713Sgirish# information: Portions Copyright [yyyy] [name of copyright owner]
18*44961713Sgirish#
19*44961713Sgirish# CDDL HEADER END
20*44961713Sgirish#
21*44961713Sgirish# uts/sun4v/nxge/Makefile
22*44961713Sgirish#
23*44961713Sgirish# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*44961713Sgirish# Use is subject to license terms.
25*44961713Sgirish#
26*44961713Sgirish#
27*44961713Sgirish# ident	"%Z%%M%	%I%	%E% SMI"
28*44961713Sgirish#
29*44961713Sgirish#	This makefile drives the production of the N2 NIU
30*44961713Sgirish#	10G Ethernet leaf driver kernel module.
31*44961713Sgirish#
32*44961713Sgirish#	sun4v implementation architecture dependent
33*44961713Sgirish#
34*44961713Sgirish
35*44961713Sgirish#
36*44961713Sgirish#	Path to the base of the uts directory tree (usually /usr/src/uts).
37*44961713Sgirish#
38*44961713SgirishUTSBASE	= ../..
39*44961713Sgirish
40*44961713Sgirish#
41*44961713Sgirish#	Define the module and object file sets.
42*44961713Sgirish#
43*44961713SgirishMODULE		= nxge
44*44961713SgirishOBJECTS		= $(NXGE_OBJS:%=$(OBJS_DIR)/%) $(NXGE_NPI_OBJS:%=$(OBJS_DIR)/%)
45*44961713SgirishLINTS		= $(NXGE_OBJS:%.o=$(LINTS_DIR)/%.ln)	\
46*44961713Sgirish			$(NXGE_NPI_OBJS:%.o=$(LINTS_DIR)/%.ln)
47*44961713SgirishROOTMODULE	= $(ROOT_PSM_DRV_DIR)/$(MODULE)
48*44961713Sgirish
49*44961713Sgirish#
50*44961713Sgirish#	Include common rules.
51*44961713Sgirish#
52*44961713Sgirishinclude $(UTSBASE)/sun4v/Makefile.sun4v
53*44961713Sgirish
54*44961713Sgirish#
55*44961713Sgirish#	Override defaults to build a unique, local modstubs.o.
56*44961713Sgirish#
57*44961713SgirishMODSTUBS_DIR	= $(OBJS_DIR)
58*44961713Sgirish
59*44961713SgirishCLEANFILES	+= $(MODSTUBS_O)
60*44961713Sgirish
61*44961713Sgirish#
62*44961713Sgirish#	Define targets
63*44961713Sgirish#
64*44961713SgirishALL_TARGET	= $(BINARY)
65*44961713SgirishLINT_TARGET	= $(MODULE).lint
66*44961713SgirishINSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
67*44961713Sgirish
68*44961713Sgirish#
69*44961713Sgirish#
70*44961713Sgirish# Turn on doubleword alignment for 64 bit registers
71*44961713Sgirish#
72*44961713SgirishCFLAGS	+= -dalign
73*44961713Sgirish#
74*44961713Sgirish# Include nxge specific header files
75*44961713Sgirish#
76*44961713SgirishINC_PATH	+= -I$(UTSBASE)/sun4v/io/nxge/npi
77*44961713SgirishINC_PATH	+= -I$(UTSBASE)/sun4v/sys/nxge
78*44961713Sgirish#
79*44961713Sgirish#
80*44961713Sgirish# lint pass one enforcement
81*44961713Sgirish#
82*44961713SgirishCFLAGS += -DSOLARIS
83*44961713Sgirish# NEMO
84*44961713Sgirish#CFLAGS += -DNEMO
85*44961713Sgirish#
86*44961713Sgirish# Enable the following flags to run mac internal loopback under legion
87*44961713Sgirish#CFLAGS += -DLEGION -DAXIS -DAXIS_DEBUG -DAXIS_DEBUG_LB -DSAM_DEBUG
88*44961713Sgirish#
89*44961713Sgirish# Enable the following flags to run mac internal loopback under AXIS
90*44961713Sgirish# (NOTE: LEGION flag can be enabled too)
91*44961713Sgirish#CFLAGS += -DAXIS_DEBUG -DAXIS -DAXIS_DEBUG_LB -DSAM_DEBUG -DLEGION
92*44961713Sgirish#
93*44961713Sgirish# Enable NXGE debug
94*44961713Sgirish#CFLAGS += -DNXGE_DEBUG
95*44961713Sgirish# Enable NPI debug
96*44961713Sgirish#CFLAGS += -DNPI_DEBUG
97*44961713Sgirish#CFLAGS += -DUSE_RX_BUFF_ATTR
98*44961713Sgirish
99*44961713Sgirish#CFLAGS += -DNIU_PA_WORKAROUND
100*44961713Sgirish#CFLAGS += -DNIU_HV_WORKAROUND
101*44961713SgirishCFLAGS += -DNIU_LP_WORKAROUND
102*44961713Sgirish
103*44961713SgirishLINTFLAGS += -DSOLARIS
104*44961713SgirishLINTFLAGS += -DNIU_LP_WORKAROUND
105*44961713Sgirish#
106*44961713Sgirish# STREAMS, DDI API limitations and other ON header file definitions such as ethernet.h
107*44961713Sgirish# force us to turn off these lint checks.
108*44961713Sgirish#
109*44961713SgirishLINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
110*44961713SgirishLINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
111*44961713Sgirish#
112*44961713Sgirish#	Driver depends on mac & IP
113*44961713Sgirish#
114*44961713SgirishLDFLAGS		+= -dy -N misc/mac -N drv/ip
115*44961713Sgirish
116*44961713Sgirish#
117*44961713Sgirish#	Default build targets.
118*44961713Sgirish#
119*44961713Sgirish.KEEP_STATE:
120*44961713Sgirish
121*44961713Sgirishdef:		$(DEF_DEPS)
122*44961713Sgirish
123*44961713Sgirishall:		$(ALL_DEPS)
124*44961713Sgirish
125*44961713Sgirishclean:		$(CLEAN_DEPS)
126*44961713Sgirish
127*44961713Sgirishclobber:	$(CLOBBER_DEPS)
128*44961713Sgirish
129*44961713Sgirishlint:		$(LINT_DEPS)
130*44961713Sgirish
131*44961713Sgirishmodlintlib:	$(MODLINTLIB_DEPS)
132*44961713Sgirish
133*44961713Sgirishclean.lint:	$(CLEAN_LINT_DEPS)
134*44961713Sgirish
135*44961713Sgirishinstall:	$(INSTALL_DEPS)
136*44961713Sgirish
137*44961713Sgirish#
138*44961713Sgirish#	Include common targets.
139*44961713Sgirish#
140*44961713Sgirishinclude $(UTSBASE)/$(PLATFORM)/Makefile.targ
141