xref: /titanic_50/usr/src/uts/sun4v/nxge/Makefile (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
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#
23678453a8Sspeer# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
2444961713Sgirish# Use is subject to license terms.
2544961713Sgirish#
2644961713Sgirish#
2744961713Sgirish#
2844961713Sgirish#	This makefile drives the production of the N2 NIU
296f45ec7bSml29623#	10G and SUN 10G/1G Ethernet leaf driver kernel module.
3044961713Sgirish#
3144961713Sgirish#	sun4v implementation architecture dependent
3244961713Sgirish#
3344961713Sgirish
3444961713Sgirish#
3544961713Sgirish#	Path to the base of the uts directory tree (usually /usr/src/uts).
3644961713Sgirish#
3744961713SgirishUTSBASE	= ../..
3844961713Sgirish
3944961713Sgirish#
4044961713Sgirish#	Define the module and object file sets.
4144961713Sgirish#
4244961713SgirishMODULE		= nxge
436f45ec7bSml29623NXGE_OBJECTS =	$(NXGE_OBJS) $(NXGE_NPI_OBJS) $(NXGE_HCALL_OBJS)
446f45ec7bSml29623OBJECTS		=  $(NXGE_OBJECTS:%=$(OBJS_DIR)/%)
456f45ec7bSml29623LINTS		= $(NXGE_OBJECTS:%.o=$(LINTS_DIR)/%.ln)
4644961713SgirishROOTMODULE	= $(ROOT_PSM_DRV_DIR)/$(MODULE)
476f45ec7bSml29623CONF_SRCDIR	= $(UTSBASE)/common/io/nxge
4844961713Sgirish
4944961713Sgirish#
5044961713Sgirish#	Include common rules.
5144961713Sgirish#
5244961713Sgirishinclude $(UTSBASE)/sun4v/Makefile.sun4v
5344961713Sgirish
5444961713Sgirish#
5544961713Sgirish#	Override defaults to build a unique, local modstubs.o.
5644961713Sgirish#
5744961713SgirishMODSTUBS_DIR	= $(OBJS_DIR)
5844961713Sgirish
5944961713SgirishCLEANFILES	+= $(MODSTUBS_O)
6044961713Sgirish
6144961713Sgirish#
6244961713Sgirish#	Define targets
6344961713Sgirish#
6444961713SgirishALL_TARGET	= $(BINARY)
6544961713SgirishLINT_TARGET	= $(MODULE).lint
666f45ec7bSml29623INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
6744961713Sgirish
6844961713Sgirish#
6944961713Sgirish#
7044961713Sgirish# Turn on doubleword alignment for 64 bit registers
7144961713Sgirish#
7244961713SgirishCFLAGS	+= -dalign
7344961713Sgirish#
7444961713Sgirish# Include nxge specific header files
7544961713Sgirish#
766f45ec7bSml29623INC_PATH	+= -I$(UTSBASE)/common/io/nxge/npi
776f45ec7bSml29623INC_PATH	+= -I$(UTSBASE)/common/sys/nxge
78678453a8SspeerINC_PATH	+= -I$(UTSBASE)/sun4v
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
114*7014882cSRichard Lowe
115*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-label
116*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-parentheses
117*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-switch
118*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-uninitialized
119*7014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-type-limits
120*7014882cSRichard Lowe
12144961713Sgirish#
12244961713Sgirish#	Driver depends on mac & IP
12344961713Sgirish#
12444961713SgirishLDFLAGS		+= -dy -N misc/mac -N drv/ip
12544961713Sgirish
12644961713Sgirish#
12744961713Sgirish#	Default build targets.
12844961713Sgirish#
12944961713Sgirish.KEEP_STATE:
13044961713Sgirish
13144961713Sgirishdef:		$(DEF_DEPS)
13244961713Sgirish
13344961713Sgirishall:		$(ALL_DEPS)
13444961713Sgirish
13544961713Sgirishclean:		$(CLEAN_DEPS)
13644961713Sgirish
13744961713Sgirishclobber:	$(CLOBBER_DEPS)
13844961713Sgirish
13944961713Sgirishlint:		$(LINT_DEPS)
14044961713Sgirish
14144961713Sgirishmodlintlib:	$(MODLINTLIB_DEPS)
14244961713Sgirish
14344961713Sgirishclean.lint:	$(CLEAN_LINT_DEPS)
14444961713Sgirish
14544961713Sgirishinstall:	$(INSTALL_DEPS)
14644961713Sgirish
14744961713Sgirish#
14844961713Sgirish#	Include common targets.
14944961713Sgirish#
1506f45ec7bSml29623include $(UTSBASE)/sun4v/Makefile.targ
151