xref: /titanic_50/usr/src/stand/lib/Makefile.com (revision f808c858fa61e7769218966759510a8b1190dfcf)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*f808c858Sraf# Common Development and Distribution License (the "License").
6*f808c858Sraf# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22*f808c858Sraf# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
267c478bd9Sstevel@tonic-gate#
27*f808c858Sraf
28*f808c858Sraf#
297c478bd9Sstevel@tonic-gate# Common macro definitions and pattern rules for stand libraries.
307c478bd9Sstevel@tonic-gate# Basically just a trivial wrapper around $(SRC)/lib/Makefile.lib.
317c478bd9Sstevel@tonic-gate#
327c478bd9Sstevel@tonic-gate
337c478bd9Sstevel@tonic-gateinclude $(SRC)/lib/Makefile.lib
347c478bd9Sstevel@tonic-gateinclude $(SRC)/stand/lib/Makefile.$(MACH)
357c478bd9Sstevel@tonic-gate
36*f808c858SrafSRCDIR =	.
377c478bd9Sstevel@tonic-gateLIBS +=		$(LIBRARY) $(LINTLIB)
387c478bd9Sstevel@tonic-gateCFLAGS +=	$(CCVERBOSE)
397c478bd9Sstevel@tonic-gateLDFLAGS =	-r
407c478bd9Sstevel@tonic-gateLDLIBS +=	-lsa -lfakeboot
417c478bd9Sstevel@tonic-gate$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
427c478bd9Sstevel@tonic-gate
437c478bd9Sstevel@tonic-gate#
447c478bd9Sstevel@tonic-gate# Reset ROOTLIBDIR to an alternate directory so that we don't clash with
457c478bd9Sstevel@tonic-gate# $(ROOT)/usr/lib.  The Makefiles over in usr/src/psm expect to find our
467c478bd9Sstevel@tonic-gate# libraries here.
477c478bd9Sstevel@tonic-gate#
487c478bd9Sstevel@tonic-gateROOTLIBDIR = $(ROOT)/stand/lib
497c478bd9Sstevel@tonic-gate
507c478bd9Sstevel@tonic-gate#
517c478bd9Sstevel@tonic-gate# Paths to a variety of commonly-referenced directories.  Note that we use
527c478bd9Sstevel@tonic-gate# relative paths so that references to filenames in the source (e.g.,
537c478bd9Sstevel@tonic-gate# through use of assert()) are not exposed absolutely (for reasons of
547c478bd9Sstevel@tonic-gate# taste and to help make the binaries end up the same even when built from
557c478bd9Sstevel@tonic-gate# different workspaces).  Makefiles that are more than one directory level
567c478bd9Sstevel@tonic-gate# deeper than this Makefile need to set DIRREL appropriately so that the
577c478bd9Sstevel@tonic-gate# relative paths can still be accessed correctly.
587c478bd9Sstevel@tonic-gate#
597c478bd9Sstevel@tonic-gateTOPDIR =	$(DIRREL)../../..
607c478bd9Sstevel@tonic-gateSTANDDIR =	$(DIRREL)../..
617c478bd9Sstevel@tonic-gateCMNNETDIR =	$(TOPDIR)/common/net
627c478bd9Sstevel@tonic-gateSYSDIR	=	$(TOPDIR)/uts
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gate#
657c478bd9Sstevel@tonic-gate# As a courtesy to the numerous standalone libraries which are built from
667c478bd9Sstevel@tonic-gate# sources living elsewhere, we provide a generic CMNDIR macro which the
677c478bd9Sstevel@tonic-gate# library's Makefile can set (if need be) to the primary other directory
687c478bd9Sstevel@tonic-gate# it grabs its sources from.
697c478bd9Sstevel@tonic-gate#
707c478bd9Sstevel@tonic-gateCMNDIR =	.
717c478bd9Sstevel@tonic-gate
727c478bd9Sstevel@tonic-gate#
737c478bd9Sstevel@tonic-gate# Configure the appropriate #defines and #include path for building
747c478bd9Sstevel@tonic-gate# standalone bits.  Note that we turn off access to /usr/include and
757c478bd9Sstevel@tonic-gate# the proto area since those headers match libc's implementation, and
767c478bd9Sstevel@tonic-gate# libc is of course not available to standalone binaries.
777c478bd9Sstevel@tonic-gate#
787c478bd9Sstevel@tonic-gateCPPDEFS	= 	-D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP
797c478bd9Sstevel@tonic-gateCPPINCS	= 	-YI,$(STANDDIR)/lib/sa -I$(STANDDIR) -I$(SRCDIR) -I$(CMNDIR) \
807c478bd9Sstevel@tonic-gate		-I$(STANDDIR)/$(MACH) -I$(SYSDIR)/common $(ARCHDIRS) \
817c478bd9Sstevel@tonic-gate		-I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH)
827c478bd9Sstevel@tonic-gate
837c478bd9Sstevel@tonic-gateCPPFLAGS =	$(CPPDEFS) $(CPPINCS)
847c478bd9Sstevel@tonic-gateAS_CPPFLAGS =	$(CPPDEFS) $(CPPINCS:-YI,%=-I%)
857c478bd9Sstevel@tonic-gateASFLAGS =	-P -D__STDC__ -D_ASM
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gate#
887c478bd9Sstevel@tonic-gate# While things are pretty much 32-bit lint-clean, there are a ton of
897c478bd9Sstevel@tonic-gate# suspect pointer casts.  Since these may be serious problems (especially
907c478bd9Sstevel@tonic-gate# on SPARC), this really needs to be investigated thoroughly one day.
917c478bd9Sstevel@tonic-gate# However, we shouldn't feel too bad: the whole kernel is linted with this
927c478bd9Sstevel@tonic-gate# turned off as well (along with a dozen other disabled warnings).
937c478bd9Sstevel@tonic-gate#
947c478bd9Sstevel@tonic-gate# The other two -erroff's are needed only because lint's -u flag is lame
957c478bd9Sstevel@tonic-gate# and also turns off "name used but not defined" checks (so we instead
967c478bd9Sstevel@tonic-gate# just enumerate the errors that -u turns off that we want turned off).
977c478bd9Sstevel@tonic-gate#
987c478bd9Sstevel@tonic-gateLINTFLAGS = -nmsF -erroff=E_BAD_PTR_CAST_ALIGN \
997c478bd9Sstevel@tonic-gate	    -erroff=E_NAME_DECL_NOT_USED_DEF2 -erroff=E_NAME_DEF_NOT_USED2 \
1007c478bd9Sstevel@tonic-gate	    -erroff=E_STATIC_UNUSED
1017c478bd9Sstevel@tonic-gate
1027c478bd9Sstevel@tonic-gate#
1037c478bd9Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking with or
1047c478bd9Sstevel@tonic-gate# building libssl or libcrypto.
1057c478bd9Sstevel@tonic-gate# This overrides the restrictions for the standlone build, some of these
1067c478bd9Sstevel@tonic-gate# may be repeats from OPENSSL_NO_XXX but they are explicit here because
1077c478bd9Sstevel@tonic-gate# we are not just excluding for legal reasons but for size as well.
1087c478bd9Sstevel@tonic-gate#
1097c478bd9Sstevel@tonic-gateOPENSSL_BUILD_CPPFLAGS_sparc = -DB_ENDIAN
1107c478bd9Sstevel@tonic-gateOPENSSL_BUILD_CPPFLAGS = $(OPENSSL_NO_XXX) -DOPENSSL_NO_HW \
1117c478bd9Sstevel@tonic-gate			-DOPENSSL_NO_MD2 -DOPENSSL_NO_MD4 -DOPENSSL_NO_MDC2 \
1127c478bd9Sstevel@tonic-gate			-DOPENSSL_NO_RIPEMD -DOPENSSL_NO_RC3 -DOPENSSL_NO_RC4 \
1137c478bd9Sstevel@tonic-gate			-DOPENSSL_NO_EC -DOPENSSL_NO_RC5 -DOPENSSL_NO_IDEA \
1147c478bd9Sstevel@tonic-gate			-DOPENSSL_NO_CAST -DOPENSSL_NO_AES \
1157c478bd9Sstevel@tonic-gate			-DDEVRANDOM=\"/dev/urandom\" \
1167c478bd9Sstevel@tonic-gate			$(OPENSSL_BUILD_CPPFLAGS_$(MACH)) \
1177c478bd9Sstevel@tonic-gate			-I$(ROOTSFWINCLUDE) \
1187c478bd9Sstevel@tonic-gate			-I$(OPENSSL_SRC) -I$(OPENSSL_SRC)/crypto
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gate#
1217c478bd9Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking the DHCP
1227c478bd9Sstevel@tonic-gate# routines in $SRC/common/net/dhcp.
1237c478bd9Sstevel@tonic-gate#
1247c478bd9Sstevel@tonic-gateDHCPCPPFLAGS = -I$(CMNNETDIR)/dhcp
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gate#
1277c478bd9Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking with or
1287c478bd9Sstevel@tonic-gate# building libsock.
1297c478bd9Sstevel@tonic-gate#
1307c478bd9Sstevel@tonic-gate# The header files for libsock provide alternate definitions for data
1317c478bd9Sstevel@tonic-gate# types that are also defined in <sys/stream.h>.  To make sure we get the
1327c478bd9Sstevel@tonic-gate# right ones, prevent <sys/stream.h>'s contents from being included.  This
1337c478bd9Sstevel@tonic-gate# is shameful.
1347c478bd9Sstevel@tonic-gate#
1357c478bd9Sstevel@tonic-gateSOCKCPPFLAGS = -I$(STANDDIR)/lib/sock -D_SYS_STREAM_H
1367c478bd9Sstevel@tonic-gate
1377c478bd9Sstevel@tonic-gate.KEEP_STATE:
138