xref: /illumos-gate/usr/src/stand/lib/Makefile.com (revision 3db86aab)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# Common macro definitions and pattern rules for stand libraries.
29# Basically just a trivial wrapper around $(SRC)/lib/Makefile.lib.
30#
31
32include $(SRC)/lib/Makefile.lib
33include $(SRC)/stand/lib/Makefile.$(MACH)
34
35LIBS +=		$(LIBRARY) $(LINTLIB)
36CFLAGS +=	$(CCVERBOSE)
37LDFLAGS =	-r
38LDLIBS +=	-lsa -lfakeboot
39$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
40
41#
42# Reset ROOTLIBDIR to an alternate directory so that we don't clash with
43# $(ROOT)/usr/lib.  The Makefiles over in usr/src/psm expect to find our
44# libraries here.
45#
46ROOTLIBDIR = $(ROOT)/stand/lib
47
48#
49# Paths to a variety of commonly-referenced directories.  Note that we use
50# relative paths so that references to filenames in the source (e.g.,
51# through use of assert()) are not exposed absolutely (for reasons of
52# taste and to help make the binaries end up the same even when built from
53# different workspaces).  Makefiles that are more than one directory level
54# deeper than this Makefile need to set DIRREL appropriately so that the
55# relative paths can still be accessed correctly.
56#
57TOPDIR =	$(DIRREL)../../..
58STANDDIR =	$(DIRREL)../..
59CMNNETDIR =	$(TOPDIR)/common/net
60SYSDIR	=	$(TOPDIR)/uts
61
62#
63# As a courtesy to the numerous standalone libraries which are built from
64# sources living elsewhere, we provide a generic CMNDIR macro which the
65# library's Makefile can set (if need be) to the primary other directory
66# it grabs its sources from.
67#
68CMNDIR =	.
69
70#
71# Configure the appropriate #defines and #include path for building
72# standalone bits.  Note that we turn off access to /usr/include and
73# the proto area since those headers match libc's implementation, and
74# libc is of course not available to standalone binaries.
75#
76CPPDEFS	= 	-D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP
77CPPINCS	= 	-YI,$(STANDDIR)/lib/sa -I$(STANDDIR) -I$(SRCDIR) -I$(CMNDIR) \
78		-I$(STANDDIR)/$(MACH) -I$(SYSDIR)/common $(ARCHDIRS) \
79		-I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH)
80
81CPPFLAGS =	$(CPPDEFS) $(CPPINCS)
82AS_CPPFLAGS =	$(CPPDEFS) $(CPPINCS:-YI,%=-I%)
83ASFLAGS =	-P -D__STDC__ -D_ASM
84
85#
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).
91#
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).
95#
96LINTFLAGS = -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
99
100#
101# CPPFLAGS values that *must* be included whenever linking with or
102# building libssl or libcrypto.
103# This overrides the restrictions for the standlone build, some of these
104# may be repeats from OPENSSL_NO_XXX but they are explicit here because
105# we are not just excluding for legal reasons but for size as well.
106#
107OPENSSL_BUILD_CPPFLAGS_sparc = -DB_ENDIAN
108OPENSSL_BUILD_CPPFLAGS = $(OPENSSL_NO_XXX) -DOPENSSL_NO_HW \
109			-DOPENSSL_NO_MD2 -DOPENSSL_NO_MD4 -DOPENSSL_NO_MDC2 \
110			-DOPENSSL_NO_RIPEMD -DOPENSSL_NO_RC3 -DOPENSSL_NO_RC4 \
111			-DOPENSSL_NO_EC -DOPENSSL_NO_RC5 -DOPENSSL_NO_IDEA \
112			-DOPENSSL_NO_CAST -DOPENSSL_NO_AES \
113			-DDEVRANDOM=\"/dev/urandom\" \
114			$(OPENSSL_BUILD_CPPFLAGS_$(MACH)) \
115			-I$(ROOTSFWINCLUDE) \
116			-I$(OPENSSL_SRC) -I$(OPENSSL_SRC)/crypto
117
118#
119# CPPFLAGS values that *must* be included whenever linking the DHCP
120# routines in $SRC/common/net/dhcp.
121#
122DHCPCPPFLAGS = -I$(CMNNETDIR)/dhcp
123
124#
125# CPPFLAGS values that *must* be included whenever linking with or
126# building libsock.
127#
128# The header files for libsock provide alternate definitions for data
129# types that are also defined in <sys/stream.h>.  To make sure we get the
130# right ones, prevent <sys/stream.h>'s contents from being included.  This
131# is shameful.
132#
133SOCKCPPFLAGS = -I$(STANDDIR)/lib/sock -D_SYS_STREAM_H
134
135.KEEP_STATE:
136