xref: /titanic_51/usr/src/uts/sun4v/nxge/Makefile (revision 6f45ec7b0b964c3be967c4880e8867ac1e7763a5)
144961713Sgirish#
244961713Sgirish# CDDL HEADER START
344961713Sgirish#
444961713Sgirish# The contents of this file are subject to the terms of the
544961713Sgirish# Common Development and Distribution License (the "License").
644961713Sgirish# You may not use this file except in compliance with the License.
744961713Sgirish#
844961713Sgirish# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
944961713Sgirish# or http://www.opensolaris.org/os/licensing.
1044961713Sgirish# See the License for the specific language governing permissions
1144961713Sgirish# and limitations under the License.
1244961713Sgirish#
1344961713Sgirish# When distributing Covered Code, include this CDDL HEADER in each
1444961713Sgirish# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1544961713Sgirish# If applicable, add the following below this CDDL HEADER, with the
1644961713Sgirish# fields enclosed by brackets "[]" replaced with your own identifying
1744961713Sgirish# information: Portions Copyright [yyyy] [name of copyright owner]
1844961713Sgirish#
1944961713Sgirish# CDDL HEADER END
2044961713Sgirish#
2144961713Sgirish# uts/sun4v/nxge/Makefile
2244961713Sgirish#
23*6f45ec7bSml29623# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
2444961713Sgirish# Use is subject to license terms.
2544961713Sgirish#
2644961713Sgirish#
2744961713Sgirish# ident	"%Z%%M%	%I%	%E% SMI"
2844961713Sgirish#
2944961713Sgirish#	This makefile drives the production of the N2 NIU
30*6f45ec7bSml29623#	10G and SUN 10G/1G Ethernet leaf driver kernel module.
3144961713Sgirish#
3244961713Sgirish#	sun4v implementation architecture dependent
3344961713Sgirish#
3444961713Sgirish
3544961713Sgirish#
3644961713Sgirish#	Path to the base of the uts directory tree (usually /usr/src/uts).
3744961713Sgirish#
3844961713SgirishUTSBASE	= ../..
3944961713Sgirish
4044961713Sgirish#
4144961713Sgirish#	Define the module and object file sets.
4244961713Sgirish#
4344961713SgirishMODULE		= nxge
44*6f45ec7bSml29623NXGE_OBJECTS =	$(NXGE_OBJS) $(NXGE_NPI_OBJS) $(NXGE_HCALL_OBJS)
45*6f45ec7bSml29623OBJECTS		=  $(NXGE_OBJECTS:%=$(OBJS_DIR)/%)
46*6f45ec7bSml29623LINTS		= $(NXGE_OBJECTS:%.o=$(LINTS_DIR)/%.ln)
4744961713SgirishROOTMODULE	= $(ROOT_PSM_DRV_DIR)/$(MODULE)
48*6f45ec7bSml29623CONF_SRCDIR	= $(UTSBASE)/common/io/nxge
4944961713Sgirish
5044961713Sgirish#
5144961713Sgirish#	Include common rules.
5244961713Sgirish#
5344961713Sgirishinclude $(UTSBASE)/sun4v/Makefile.sun4v
5444961713Sgirish
5544961713Sgirish#
5644961713Sgirish#	Override defaults to build a unique, local modstubs.o.
5744961713Sgirish#
5844961713SgirishMODSTUBS_DIR	= $(OBJS_DIR)
5944961713Sgirish
6044961713SgirishCLEANFILES	+= $(MODSTUBS_O)
6144961713Sgirish
6244961713Sgirish#
6344961713Sgirish#	Define targets
6444961713Sgirish#
6544961713SgirishALL_TARGET	= $(BINARY)
6644961713SgirishLINT_TARGET	= $(MODULE).lint
67*6f45ec7bSml29623INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
6844961713Sgirish
6944961713Sgirish#
7044961713Sgirish#
7144961713Sgirish# Turn on doubleword alignment for 64 bit registers
7244961713Sgirish#
7344961713SgirishCFLAGS	+= -dalign
7444961713Sgirish#
7544961713Sgirish# Include nxge specific header files
7644961713Sgirish#
77*6f45ec7bSml29623INC_PATH	+= -I$(UTSBASE)/common/io/nxge/npi
78*6f45ec7bSml29623INC_PATH	+= -I$(UTSBASE)/common/sys/nxge
7944961713Sgirish#
8044961713Sgirish#
8144961713Sgirish# lint pass one enforcement
8244961713Sgirish#
8344961713SgirishCFLAGS += -DSOLARIS
8444961713Sgirish# NEMO
8544961713Sgirish#CFLAGS += -DNEMO
8644961713Sgirish#
8744961713Sgirish# Enable the following flags to run mac internal loopback under legion
8844961713Sgirish#CFLAGS += -DLEGION -DAXIS -DAXIS_DEBUG -DAXIS_DEBUG_LB -DSAM_DEBUG
8944961713Sgirish#
9044961713Sgirish# Enable the following flags to run mac internal loopback under AXIS
9144961713Sgirish# (NOTE: LEGION flag can be enabled too)
9244961713Sgirish#CFLAGS += -DAXIS_DEBUG -DAXIS -DAXIS_DEBUG_LB -DSAM_DEBUG -DLEGION
9344961713Sgirish#
9444961713Sgirish# Enable NXGE debug
9544961713Sgirish#CFLAGS += -DNXGE_DEBUG
9644961713Sgirish# Enable NPI debug
9744961713Sgirish#CFLAGS += -DNPI_DEBUG
9814ea4bb7Ssd77468#CFLAGS += -DNXGE_FM
9944961713Sgirish#CFLAGS += -DUSE_RX_BUFF_ATTR
10044961713Sgirish
10144961713Sgirish#CFLAGS += -DNIU_PA_WORKAROUND
10244961713Sgirish#CFLAGS += -DNIU_HV_WORKAROUND
10344961713SgirishCFLAGS += -DNIU_LP_WORKAROUND
10444961713Sgirish
10544961713SgirishLINTFLAGS += -DSOLARIS
10614ea4bb7Ssd77468LINTFLAGS += -DNXGE_FM
10744961713SgirishLINTFLAGS += -DNIU_LP_WORKAROUND
10844961713Sgirish#
10944961713Sgirish# STREAMS, DDI API limitations and other ON header file definitions such as ethernet.h
11044961713Sgirish# force us to turn off these lint checks.
11144961713Sgirish#
11244961713SgirishLINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
11344961713SgirishLINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
11444961713Sgirish#
11544961713Sgirish#	Driver depends on mac & IP
11644961713Sgirish#
11744961713SgirishLDFLAGS		+= -dy -N misc/mac -N drv/ip
11844961713Sgirish
11944961713Sgirish#
12044961713Sgirish#	Default build targets.
12144961713Sgirish#
12244961713Sgirish.KEEP_STATE:
12344961713Sgirish
12444961713Sgirishdef:		$(DEF_DEPS)
12544961713Sgirish
12644961713Sgirishall:		$(ALL_DEPS)
12744961713Sgirish
12844961713Sgirishclean:		$(CLEAN_DEPS)
12944961713Sgirish
13044961713Sgirishclobber:	$(CLOBBER_DEPS)
13144961713Sgirish
13244961713Sgirishlint:		$(LINT_DEPS)
13344961713Sgirish
13444961713Sgirishmodlintlib:	$(MODLINTLIB_DEPS)
13544961713Sgirish
13644961713Sgirishclean.lint:	$(CLEAN_LINT_DEPS)
13744961713Sgirish
13844961713Sgirishinstall:	$(INSTALL_DEPS)
13944961713Sgirish
14044961713Sgirish#
14144961713Sgirish#	Include common targets.
14244961713Sgirish#
143*6f45ec7bSml29623include $(UTSBASE)/sun4v/Makefile.targ
144