1*7c478bd9Sstevel@tonic-gate# 2*7c478bd9Sstevel@tonic-gate# CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate# 4*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate# with the License. 8*7c478bd9Sstevel@tonic-gate# 9*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate# and limitations under the License. 13*7c478bd9Sstevel@tonic-gate# 14*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate# 20*7c478bd9Sstevel@tonic-gate# CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate# 22*7c478bd9Sstevel@tonic-gate# 23*7c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate# Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate# 26*7c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 27*7c478bd9Sstevel@tonic-gate# 28*7c478bd9Sstevel@tonic-gate# Common macro definitions and pattern rules for stand libraries. 29*7c478bd9Sstevel@tonic-gate# Basically just a trivial wrapper around $(SRC)/lib/Makefile.lib. 30*7c478bd9Sstevel@tonic-gate# 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gateinclude $(SRC)/lib/Makefile.lib 33*7c478bd9Sstevel@tonic-gateinclude $(SRC)/stand/lib/Makefile.$(MACH) 34*7c478bd9Sstevel@tonic-gate 35*7c478bd9Sstevel@tonic-gateLIBS += $(LIBRARY) $(LINTLIB) 36*7c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) 37*7c478bd9Sstevel@tonic-gateLDFLAGS = -r 38*7c478bd9Sstevel@tonic-gateLDLIBS += -lsa -lfakeboot 39*7c478bd9Sstevel@tonic-gate$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) 40*7c478bd9Sstevel@tonic-gate 41*7c478bd9Sstevel@tonic-gate# 42*7c478bd9Sstevel@tonic-gate# Reset ROOTLIBDIR to an alternate directory so that we don't clash with 43*7c478bd9Sstevel@tonic-gate# $(ROOT)/usr/lib. The Makefiles over in usr/src/psm expect to find our 44*7c478bd9Sstevel@tonic-gate# libraries here. 45*7c478bd9Sstevel@tonic-gate# 46*7c478bd9Sstevel@tonic-gateROOTLIBDIR = $(ROOT)/stand/lib 47*7c478bd9Sstevel@tonic-gate 48*7c478bd9Sstevel@tonic-gate# 49*7c478bd9Sstevel@tonic-gate# Paths to a variety of commonly-referenced directories. Note that we use 50*7c478bd9Sstevel@tonic-gate# relative paths so that references to filenames in the source (e.g., 51*7c478bd9Sstevel@tonic-gate# through use of assert()) are not exposed absolutely (for reasons of 52*7c478bd9Sstevel@tonic-gate# taste and to help make the binaries end up the same even when built from 53*7c478bd9Sstevel@tonic-gate# different workspaces). Makefiles that are more than one directory level 54*7c478bd9Sstevel@tonic-gate# deeper than this Makefile need to set DIRREL appropriately so that the 55*7c478bd9Sstevel@tonic-gate# relative paths can still be accessed correctly. 56*7c478bd9Sstevel@tonic-gate# 57*7c478bd9Sstevel@tonic-gateTOPDIR = $(DIRREL)../../.. 58*7c478bd9Sstevel@tonic-gateSTANDDIR = $(DIRREL)../.. 59*7c478bd9Sstevel@tonic-gateCMNNETDIR = $(TOPDIR)/common/net 60*7c478bd9Sstevel@tonic-gateSYSDIR = $(TOPDIR)/uts 61*7c478bd9Sstevel@tonic-gate 62*7c478bd9Sstevel@tonic-gate# 63*7c478bd9Sstevel@tonic-gate# As a courtesy to the numerous standalone libraries which are built from 64*7c478bd9Sstevel@tonic-gate# sources living elsewhere, we provide a generic CMNDIR macro which the 65*7c478bd9Sstevel@tonic-gate# library's Makefile can set (if need be) to the primary other directory 66*7c478bd9Sstevel@tonic-gate# it grabs its sources from. 67*7c478bd9Sstevel@tonic-gate# 68*7c478bd9Sstevel@tonic-gateCMNDIR = . 69*7c478bd9Sstevel@tonic-gate 70*7c478bd9Sstevel@tonic-gate# 71*7c478bd9Sstevel@tonic-gate# Configure the appropriate #defines and #include path for building 72*7c478bd9Sstevel@tonic-gate# standalone bits. Note that we turn off access to /usr/include and 73*7c478bd9Sstevel@tonic-gate# the proto area since those headers match libc's implementation, and 74*7c478bd9Sstevel@tonic-gate# libc is of course not available to standalone binaries. 75*7c478bd9Sstevel@tonic-gate# 76*7c478bd9Sstevel@tonic-gateCPPDEFS = -D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP 77*7c478bd9Sstevel@tonic-gateCPPINCS = -YI,$(STANDDIR)/lib/sa -I$(STANDDIR) -I$(SRCDIR) -I$(CMNDIR) \ 78*7c478bd9Sstevel@tonic-gate -I$(STANDDIR)/$(MACH) -I$(SYSDIR)/common $(ARCHDIRS) \ 79*7c478bd9Sstevel@tonic-gate -I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH) 80*7c478bd9Sstevel@tonic-gate 81*7c478bd9Sstevel@tonic-gateCPPFLAGS = $(CPPDEFS) $(CPPINCS) 82*7c478bd9Sstevel@tonic-gateAS_CPPFLAGS = $(CPPDEFS) $(CPPINCS:-YI,%=-I%) 83*7c478bd9Sstevel@tonic-gateASFLAGS = -P -D__STDC__ -D_ASM 84*7c478bd9Sstevel@tonic-gate 85*7c478bd9Sstevel@tonic-gate# 86*7c478bd9Sstevel@tonic-gate# While things are pretty much 32-bit lint-clean, there are a ton of 87*7c478bd9Sstevel@tonic-gate# suspect pointer casts. Since these may be serious problems (especially 88*7c478bd9Sstevel@tonic-gate# on SPARC), this really needs to be investigated thoroughly one day. 89*7c478bd9Sstevel@tonic-gate# However, we shouldn't feel too bad: the whole kernel is linted with this 90*7c478bd9Sstevel@tonic-gate# turned off as well (along with a dozen other disabled warnings). 91*7c478bd9Sstevel@tonic-gate# 92*7c478bd9Sstevel@tonic-gate# The other two -erroff's are needed only because lint's -u flag is lame 93*7c478bd9Sstevel@tonic-gate# and also turns off "name used but not defined" checks (so we instead 94*7c478bd9Sstevel@tonic-gate# just enumerate the errors that -u turns off that we want turned off). 95*7c478bd9Sstevel@tonic-gate# 96*7c478bd9Sstevel@tonic-gateLINTFLAGS = -nmsF -erroff=E_BAD_PTR_CAST_ALIGN \ 97*7c478bd9Sstevel@tonic-gate -erroff=E_NAME_DECL_NOT_USED_DEF2 -erroff=E_NAME_DEF_NOT_USED2 \ 98*7c478bd9Sstevel@tonic-gate -erroff=E_STATIC_UNUSED 99*7c478bd9Sstevel@tonic-gate 100*7c478bd9Sstevel@tonic-gate# 101*7c478bd9Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking with or 102*7c478bd9Sstevel@tonic-gate# building libssl or libcrypto. 103*7c478bd9Sstevel@tonic-gate# This overrides the restrictions for the standlone build, some of these 104*7c478bd9Sstevel@tonic-gate# may be repeats from OPENSSL_NO_XXX but they are explicit here because 105*7c478bd9Sstevel@tonic-gate# we are not just excluding for legal reasons but for size as well. 106*7c478bd9Sstevel@tonic-gate# 107*7c478bd9Sstevel@tonic-gateOPENSSL_BUILD_CPPFLAGS_sparc = -DB_ENDIAN 108*7c478bd9Sstevel@tonic-gateOPENSSL_BUILD_CPPFLAGS = $(OPENSSL_NO_XXX) -DOPENSSL_NO_HW \ 109*7c478bd9Sstevel@tonic-gate -DOPENSSL_NO_MD2 -DOPENSSL_NO_MD4 -DOPENSSL_NO_MDC2 \ 110*7c478bd9Sstevel@tonic-gate -DOPENSSL_NO_RIPEMD -DOPENSSL_NO_RC3 -DOPENSSL_NO_RC4 \ 111*7c478bd9Sstevel@tonic-gate -DOPENSSL_NO_EC -DOPENSSL_NO_RC5 -DOPENSSL_NO_IDEA \ 112*7c478bd9Sstevel@tonic-gate -DOPENSSL_NO_CAST -DOPENSSL_NO_AES \ 113*7c478bd9Sstevel@tonic-gate -DDEVRANDOM=\"/dev/urandom\" \ 114*7c478bd9Sstevel@tonic-gate $(OPENSSL_BUILD_CPPFLAGS_$(MACH)) \ 115*7c478bd9Sstevel@tonic-gate -I$(ROOTSFWINCLUDE) \ 116*7c478bd9Sstevel@tonic-gate -I$(OPENSSL_SRC) -I$(OPENSSL_SRC)/crypto 117*7c478bd9Sstevel@tonic-gate 118*7c478bd9Sstevel@tonic-gate# 119*7c478bd9Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking the DHCP 120*7c478bd9Sstevel@tonic-gate# routines in $SRC/common/net/dhcp. 121*7c478bd9Sstevel@tonic-gate# 122*7c478bd9Sstevel@tonic-gateDHCPCPPFLAGS = -I$(CMNNETDIR)/dhcp 123*7c478bd9Sstevel@tonic-gate 124*7c478bd9Sstevel@tonic-gate# 125*7c478bd9Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking with or 126*7c478bd9Sstevel@tonic-gate# building libsock. 127*7c478bd9Sstevel@tonic-gate# 128*7c478bd9Sstevel@tonic-gate# The header files for libsock provide alternate definitions for data 129*7c478bd9Sstevel@tonic-gate# types that are also defined in <sys/stream.h>. To make sure we get the 130*7c478bd9Sstevel@tonic-gate# right ones, prevent <sys/stream.h>'s contents from being included. This 131*7c478bd9Sstevel@tonic-gate# is shameful. 132*7c478bd9Sstevel@tonic-gate# 133*7c478bd9Sstevel@tonic-gateSOCKCPPFLAGS = -I$(STANDDIR)/lib/sock -D_SYS_STREAM_H 134*7c478bd9Sstevel@tonic-gate 135*7c478bd9Sstevel@tonic-gate.KEEP_STATE: 136