4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
21 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
22 # Use is subject to license terms.
26 # Common macro definitions and pattern rules for stand libraries.
27 # Basically just a trivial wrapper around $(SRC)/lib/Makefile.lib.
30 include $(SRC)/lib/Makefile.lib
31 include $(SRC)/stand/lib/Makefile.$(MACH)
34 LIBS += $(LIBRARY) $(LINTLIB)
35 CFLAGS += $(CCVERBOSE)
37 LDLIBS += -lsa -lfakeboot
38 $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
41 # Reset ROOTLIBDIR to an alternate directory so that we don't clash with
42 # $(ROOT)/usr/lib. The Makefiles over in usr/src/psm expect to find our
45 ROOTLIBDIR = $(ROOT)/stand/lib
48 # Paths to a variety of commonly-referenced directories. Note that we use
49 # relative paths so that references to filenames in the source (e.g.,
50 # through use of assert()) are not exposed absolutely (for reasons of
51 # taste and to help make the binaries end up the same even when built from
52 # different workspaces). Makefiles that are more than one directory level
53 # deeper than this Makefile need to set DIRREL appropriately so that the
54 # relative paths can still be accessed correctly.
56 TOPDIR = $(DIRREL)../../..
57 STANDDIR = $(DIRREL)../..
58 CMNNETDIR = $(TOPDIR)/common/net
59 SYSDIR = $(TOPDIR)/uts
62 # As a courtesy to the numerous standalone libraries which are built from
63 # sources living elsewhere, we provide a generic CMNDIR macro which the
64 # library's Makefile can set (if need be) to the primary other directory
65 # it grabs its sources from.
70 # Configure the appropriate #defines and #include path for building
71 # standalone bits. Note that we turn off access to /usr/include and
72 # the proto area since those headers match libc's implementation, and
73 # libc is of course not available to standalone binaries.
75 CPPDEFS = -D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP
76 CPPINCS = -YI,$(STANDDIR)/lib/sa -I$(STANDDIR)/lib/sa \
77 -I$(STANDDIR) -I$(SRCDIR) -I$(CMNDIR) \
78 -I$(STANDDIR)/$(MACH) -I$(SYSDIR)/common $(ARCHDIRS) \
79 -I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH)
81 CPPFLAGS = $(CPPDEFS) $(CPPINCS)
82 AS_CPPFLAGS = $(CPPDEFS) $(CPPINCS:-YI,%=-I%)
83 ASFLAGS = -P -D__STDC__ -D_ASM
86 # While things are pretty much 32-bit lint-clean, there are a ton of
87 # suspect pointer casts. Since these may be serious problems (especially
88 # on SPARC), this really needs to be investigated thoroughly one day.
89 # However, we shouldn't feel too bad: the whole kernel is linted with this
90 # turned off as well (along with a dozen other disabled warnings).
92 # The other two -erroff's are needed only because lint's -u flag is lame
93 # and also turns off "name used but not defined" checks (so we instead
94 # just enumerate the errors that -u turns off that we want turned off).
96 LINTFLAGS = -nmsF -erroff=E_BAD_PTR_CAST_ALIGN \
97 -erroff=E_NAME_DECL_NOT_USED_DEF2 -erroff=E_NAME_DEF_NOT_USED2 \
98 -erroff=E_STATIC_UNUSED
101 # CPPFLAGS values that *must* be included whenever linking with or
102 # building libssl or libcrypto.
103 # Exclusions here are for both legal and size reasons.
105 OPENSSL_SRC = ../../../common/openssl
106 OPENSSL_BUILD_CPPFLAGS_sparc = -DB_ENDIAN
107 OPENSSL_BUILD_CPPFLAGS = -DOPENSSL_NO_ECDH -DOPENSSL_NO_ECDSA \
108 -DOPENSSL_NO_HW_4758_CCA -DOPENSSL_NO_HW_AEP \
109 -DOPENSSL_NO_HW_ATALLA -DOPENSSL_NO_HW_CHIL \
110 -DOPENSSL_NO_HW_CSWIFT -DOPENSSL_NO_HW_GMP \
111 -DOPENSSL_NO_HW_NURON -DOPENSSL_NO_HW_PADLOCK \
112 -DOPENSSL_NO_HW_SUREWARE -DOPENSSL_NO_HW_UBSEC \
114 -DOPENSSL_NO_MD2 -DOPENSSL_NO_MD4 -DOPENSSL_NO_MDC2 \
115 -DOPENSSL_NO_RIPEMD -DOPENSSL_NO_RC3 -DOPENSSL_NO_RC4 \
116 -DOPENSSL_NO_EC -DOPENSSL_NO_RC5 -DOPENSSL_NO_IDEA \
117 -DOPENSSL_NO_CAST -DOPENSSL_NO_AES \
118 -DDEVRANDOM=\"/dev/urandom\" \
120 $(OPENSSL_BUILD_CPPFLAGS_$(MACH)) \
121 -I$(ROOT)/usr/include \
122 -I$(OPENSSL_SRC) -I$(OPENSSL_SRC)/crypto
125 # CPPFLAGS values that *must* be included whenever linking the DHCP
126 # routines in $SRC/common/net/dhcp.
128 DHCPCPPFLAGS = -I$(CMNNETDIR)/dhcp
131 # CPPFLAGS values that *must* be included whenever linking with or
134 # The header files for libsock provide alternate definitions for data
135 # types that are also defined in <sys/stream.h>. To make sure we get the
136 # right ones, prevent <sys/stream.h>'s contents from being included. This
139 SOCKCPPFLAGS = -I$(STANDDIR)/lib/sock -D_SYS_STREAM_H