xref: /onnv-gate/usr/src/stand/lib/Makefile.com (revision 9741:d997cd4a582f)
10Sstevel@tonic-gate#
20Sstevel@tonic-gate# CDDL HEADER START
30Sstevel@tonic-gate#
40Sstevel@tonic-gate# The contents of this file are subject to the terms of the
52522Sraf# Common Development and Distribution License (the "License").
62522Sraf# You may not use this file except in compliance with the License.
70Sstevel@tonic-gate#
80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate# See the License for the specific language governing permissions
110Sstevel@tonic-gate# and limitations under the License.
120Sstevel@tonic-gate#
130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate#
190Sstevel@tonic-gate# CDDL HEADER END
200Sstevel@tonic-gate#
218864SVladimir.Kotal@Sun.COM# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
220Sstevel@tonic-gate# Use is subject to license terms.
232522Sraf#
242522Sraf
252522Sraf#
260Sstevel@tonic-gate# Common macro definitions and pattern rules for stand libraries.
270Sstevel@tonic-gate# Basically just a trivial wrapper around $(SRC)/lib/Makefile.lib.
280Sstevel@tonic-gate#
290Sstevel@tonic-gate
300Sstevel@tonic-gateinclude $(SRC)/lib/Makefile.lib
310Sstevel@tonic-gateinclude $(SRC)/stand/lib/Makefile.$(MACH)
320Sstevel@tonic-gate
332522SrafSRCDIR =	.
340Sstevel@tonic-gateLIBS +=		$(LIBRARY) $(LINTLIB)
350Sstevel@tonic-gateCFLAGS +=	$(CCVERBOSE)
360Sstevel@tonic-gateLDFLAGS =	-r
370Sstevel@tonic-gateLDLIBS +=	-lsa -lfakeboot
380Sstevel@tonic-gate$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
390Sstevel@tonic-gate
400Sstevel@tonic-gate#
410Sstevel@tonic-gate# Reset ROOTLIBDIR to an alternate directory so that we don't clash with
420Sstevel@tonic-gate# $(ROOT)/usr/lib.  The Makefiles over in usr/src/psm expect to find our
430Sstevel@tonic-gate# libraries here.
440Sstevel@tonic-gate#
450Sstevel@tonic-gateROOTLIBDIR = $(ROOT)/stand/lib
460Sstevel@tonic-gate
470Sstevel@tonic-gate#
480Sstevel@tonic-gate# Paths to a variety of commonly-referenced directories.  Note that we use
490Sstevel@tonic-gate# relative paths so that references to filenames in the source (e.g.,
500Sstevel@tonic-gate# through use of assert()) are not exposed absolutely (for reasons of
510Sstevel@tonic-gate# taste and to help make the binaries end up the same even when built from
520Sstevel@tonic-gate# different workspaces).  Makefiles that are more than one directory level
530Sstevel@tonic-gate# deeper than this Makefile need to set DIRREL appropriately so that the
540Sstevel@tonic-gate# relative paths can still be accessed correctly.
550Sstevel@tonic-gate#
560Sstevel@tonic-gateTOPDIR =	$(DIRREL)../../..
570Sstevel@tonic-gateSTANDDIR =	$(DIRREL)../..
580Sstevel@tonic-gateCMNNETDIR =	$(TOPDIR)/common/net
590Sstevel@tonic-gateSYSDIR	=	$(TOPDIR)/uts
600Sstevel@tonic-gate
610Sstevel@tonic-gate#
620Sstevel@tonic-gate# As a courtesy to the numerous standalone libraries which are built from
630Sstevel@tonic-gate# sources living elsewhere, we provide a generic CMNDIR macro which the
640Sstevel@tonic-gate# library's Makefile can set (if need be) to the primary other directory
650Sstevel@tonic-gate# it grabs its sources from.
660Sstevel@tonic-gate#
670Sstevel@tonic-gateCMNDIR =	.
680Sstevel@tonic-gate
690Sstevel@tonic-gate#
700Sstevel@tonic-gate# Configure the appropriate #defines and #include path for building
710Sstevel@tonic-gate# standalone bits.  Note that we turn off access to /usr/include and
720Sstevel@tonic-gate# the proto area since those headers match libc's implementation, and
730Sstevel@tonic-gate# libc is of course not available to standalone binaries.
740Sstevel@tonic-gate#
750Sstevel@tonic-gateCPPDEFS	= 	-D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP
768192SJohn.Zolnowsky@Sun.COMCPPINCS	= 	-YI,$(STANDDIR)/lib/sa -I$(STANDDIR)/lib/sa \
778192SJohn.Zolnowsky@Sun.COM		-I$(STANDDIR) -I$(SRCDIR) -I$(CMNDIR) \
780Sstevel@tonic-gate		-I$(STANDDIR)/$(MACH) -I$(SYSDIR)/common $(ARCHDIRS) \
790Sstevel@tonic-gate		-I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH)
800Sstevel@tonic-gate
810Sstevel@tonic-gateCPPFLAGS =	$(CPPDEFS) $(CPPINCS)
820Sstevel@tonic-gateAS_CPPFLAGS =	$(CPPDEFS) $(CPPINCS:-YI,%=-I%)
830Sstevel@tonic-gateASFLAGS =	-P -D__STDC__ -D_ASM
840Sstevel@tonic-gate
850Sstevel@tonic-gate#
860Sstevel@tonic-gate# While things are pretty much 32-bit lint-clean, there are a ton of
870Sstevel@tonic-gate# suspect pointer casts.  Since these may be serious problems (especially
880Sstevel@tonic-gate# on SPARC), this really needs to be investigated thoroughly one day.
890Sstevel@tonic-gate# However, we shouldn't feel too bad: the whole kernel is linted with this
900Sstevel@tonic-gate# turned off as well (along with a dozen other disabled warnings).
910Sstevel@tonic-gate#
920Sstevel@tonic-gate# The other two -erroff's are needed only because lint's -u flag is lame
930Sstevel@tonic-gate# and also turns off "name used but not defined" checks (so we instead
940Sstevel@tonic-gate# just enumerate the errors that -u turns off that we want turned off).
950Sstevel@tonic-gate#
960Sstevel@tonic-gateLINTFLAGS = -nmsF -erroff=E_BAD_PTR_CAST_ALIGN \
970Sstevel@tonic-gate	    -erroff=E_NAME_DECL_NOT_USED_DEF2 -erroff=E_NAME_DEF_NOT_USED2 \
980Sstevel@tonic-gate	    -erroff=E_STATIC_UNUSED
990Sstevel@tonic-gate
1000Sstevel@tonic-gate#
1010Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking with or
1020Sstevel@tonic-gate# building libssl or libcrypto.
103*9741SMark.Phalan@Sun.COM# Exclusions here are for both legal and size reasons.
1040Sstevel@tonic-gate#
1058864SVladimir.Kotal@Sun.COMOPENSSL_SRC = ../../../common/openssl
1060Sstevel@tonic-gateOPENSSL_BUILD_CPPFLAGS_sparc = -DB_ENDIAN
107*9741SMark.Phalan@Sun.COMOPENSSL_BUILD_CPPFLAGS = -DOPENSSL_NO_ECDH -DOPENSSL_NO_ECDSA \
108*9741SMark.Phalan@Sun.COM			-DOPENSSL_NO_HW_4758_CCA -DOPENSSL_NO_HW_AEP \
109*9741SMark.Phalan@Sun.COM			-DOPENSSL_NO_HW_ATALLA -DOPENSSL_NO_HW_CHIL \
110*9741SMark.Phalan@Sun.COM			-DOPENSSL_NO_HW_CSWIFT -DOPENSSL_NO_HW_GMP \
111*9741SMark.Phalan@Sun.COM			-DOPENSSL_NO_HW_NURON -DOPENSSL_NO_HW_PADLOCK \
112*9741SMark.Phalan@Sun.COM			-DOPENSSL_NO_HW_SUREWARE -DOPENSSL_NO_HW_UBSEC \
113*9741SMark.Phalan@Sun.COM			-DOPENSSL_NO_HW \
1140Sstevel@tonic-gate			-DOPENSSL_NO_MD2 -DOPENSSL_NO_MD4 -DOPENSSL_NO_MDC2 \
1150Sstevel@tonic-gate			-DOPENSSL_NO_RIPEMD -DOPENSSL_NO_RC3 -DOPENSSL_NO_RC4 \
1160Sstevel@tonic-gate			-DOPENSSL_NO_EC -DOPENSSL_NO_RC5 -DOPENSSL_NO_IDEA \
1170Sstevel@tonic-gate			-DOPENSSL_NO_CAST -DOPENSSL_NO_AES \
1180Sstevel@tonic-gate			-DDEVRANDOM=\"/dev/urandom\" \
119*9741SMark.Phalan@Sun.COM			-I.. \
1200Sstevel@tonic-gate			$(OPENSSL_BUILD_CPPFLAGS_$(MACH)) \
1218192SJohn.Zolnowsky@Sun.COM			-I$(ROOT)/usr/include \
1220Sstevel@tonic-gate			-I$(OPENSSL_SRC) -I$(OPENSSL_SRC)/crypto
1230Sstevel@tonic-gate
1240Sstevel@tonic-gate#
1250Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking the DHCP
1260Sstevel@tonic-gate# routines in $SRC/common/net/dhcp.
1270Sstevel@tonic-gate#
1280Sstevel@tonic-gateDHCPCPPFLAGS = -I$(CMNNETDIR)/dhcp
1290Sstevel@tonic-gate
1300Sstevel@tonic-gate#
1310Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking with or
1320Sstevel@tonic-gate# building libsock.
1330Sstevel@tonic-gate#
1340Sstevel@tonic-gate# The header files for libsock provide alternate definitions for data
1350Sstevel@tonic-gate# types that are also defined in <sys/stream.h>.  To make sure we get the
1360Sstevel@tonic-gate# right ones, prevent <sys/stream.h>'s contents from being included.  This
1370Sstevel@tonic-gate# is shameful.
1380Sstevel@tonic-gate#
1390Sstevel@tonic-gateSOCKCPPFLAGS = -I$(STANDDIR)/lib/sock -D_SYS_STREAM_H
1400Sstevel@tonic-gate
1410Sstevel@tonic-gate.KEEP_STATE:
142