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