xref: /illumos-gate/usr/src/stand/lib/Makefile.com (revision cf4e38058ad7879f18486cf7b2aff0db2934130d)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24
25#
26# Common macro definitions and pattern rules for stand libraries.
27# Basically just a trivial wrapper around $(SRC)/lib/Makefile.lib.
28#
29
30include $(SRC)/lib/Makefile.lib
31include $(SRC)/stand/lib/Makefile.$(MACH)
32
33SRCDIR =	.
34LIBS +=		$(LIBRARY)
35CFLAGS +=	$(CCVERBOSE)
36LDFLAGS =	-r
37LDLIBS +=	-lsa
38
39#
40# Reset ROOTLIBDIR to an alternate directory so that we don't clash with
41# $(ROOT)/usr/lib.  The Makefiles over in usr/src/psm expect to find our
42# libraries here.
43#
44ROOTLIBDIR = $(ROOT)/stand/lib
45
46#
47# Paths to a variety of commonly-referenced directories.  Note that we use
48# relative paths so that references to filenames in the source (e.g.,
49# through use of assert()) are not exposed absolutely (for reasons of
50# taste and to help make the binaries end up the same even when built from
51# different workspaces).  Makefiles that are more than one directory level
52# deeper than this Makefile need to set DIRREL appropriately so that the
53# relative paths can still be accessed correctly.
54#
55TOPDIR =	$(DIRREL)../../..
56STANDDIR =	$(DIRREL)../..
57CMNNETDIR =	$(TOPDIR)/common/net
58SYSDIR	=	$(TOPDIR)/uts
59
60#
61# As a courtesy to the numerous standalone libraries which are built from
62# sources living elsewhere, we provide a generic CMNDIR macro which the
63# library's Makefile can set (if need be) to the primary other directory
64# it grabs its sources from.
65#
66CMNDIR =	.
67
68#
69# Configure the appropriate #defines and #include path for building
70# standalone bits.  Note that we turn off access to /usr/include and
71# the proto area since those headers match libc's implementation, and
72# libc is of course not available to standalone binaries.
73#
74CPPDEFS	=	-D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP
75CPPINCS	=	-YI,$(STANDDIR)/lib/sa -I$(STANDDIR)/lib/sa \
76		-I$(STANDDIR) -I$(SRCDIR) -I$(CMNDIR) \
77		-I$(STANDDIR)/$(MACH) -I$(SYSDIR)/common $(ARCHDIRS) \
78		-I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH)
79
80CPPFLAGS =	$(CPPDEFS) $(CPPINCS)
81AS_CPPFLAGS =	$(CPPDEFS) $(CPPINCS:-YI,%=-I%)
82ASFLAGS =	-D__STDC__ -D_ASM
83
84#
85# CPPFLAGS values that *must* be included whenever linking with or
86# building libssl or libcrypto.
87# Exclusions here are for both legal and size reasons.
88#
89OPENSSL_SRC = ../../../common/openssl
90OPENSSL_BUILD_CPPFLAGS_sparc = -DB_ENDIAN
91OPENSSL_BUILD_CPPFLAGS = -DOPENSSL_NO_ECDH -DOPENSSL_NO_ECDSA \
92			-DOPENSSL_NO_HW_4758_CCA -DOPENSSL_NO_HW_AEP \
93			-DOPENSSL_NO_HW_ATALLA -DOPENSSL_NO_HW_CHIL \
94			-DOPENSSL_NO_HW_CSWIFT -DOPENSSL_NO_HW_GMP \
95			-DOPENSSL_NO_HW_NURON -DOPENSSL_NO_HW_PADLOCK \
96			-DOPENSSL_NO_HW_SUREWARE -DOPENSSL_NO_HW_UBSEC \
97			-DOPENSSL_NO_HW \
98			-DOPENSSL_NO_MD2 -DOPENSSL_NO_MD4 -DOPENSSL_NO_MDC2 \
99			-DOPENSSL_NO_RIPEMD -DOPENSSL_NO_RC3 -DOPENSSL_NO_RC4 \
100			-DOPENSSL_NO_EC -DOPENSSL_NO_RC5 -DOPENSSL_NO_IDEA \
101			-DOPENSSL_NO_CAST -DOPENSSL_NO_AES \
102			-DDEVRANDOM=\"/dev/urandom\" \
103			-I.. \
104			$(OPENSSL_BUILD_CPPFLAGS_$(MACH)) \
105			-I$(ROOT)/usr/include \
106			-I$(OPENSSL_SRC) -I$(OPENSSL_SRC)/crypto
107
108#
109# CPPFLAGS values that *must* be included whenever linking the DHCP
110# routines in $SRC/common/net/dhcp.
111#
112DHCPCPPFLAGS = -I$(CMNNETDIR)/dhcp
113
114#
115# CPPFLAGS values that *must* be included whenever linking with or
116# building libsock.
117#
118# The header files for libsock provide alternate definitions for data
119# types that are also defined in <sys/stream.h>.  To make sure we get the
120# right ones, prevent <sys/stream.h>'s contents from being included.  This
121# is shameful.
122#
123SOCKCPPFLAGS = -I$(STANDDIR)/lib/sock -D_SYS_STREAM_H
124
125#
126# Using Makefile.lib pulls in the stack protector. Explicitly disable it
127# as it is not initialized or supported in this environment currently.
128#
129STACKPROTECT = none
130
131.KEEP_STATE:
132