xref: /onnv-gate/usr/src/lib/libkmsagent/Makefile.com (revision 12735:267b5595f37d)
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 (c) 2010, Oracle and/or its affiliates. All rights reserved.
22#
23
24LIBRARY= libkmsagent.a
25VERS= .1
26
27LIB_C_OBJECTS= \
28	SYSCommon.o \
29	ieee80211_crypto.o \
30	k_setupssl.o
31
32LIB_CPP_OBJECTS= \
33	KMSAgent.o \
34	KMSAgentChallenge.o \
35	KMSAgentCryptoUtilities.o \
36	KMSAgentDataUnitCache.o \
37	KMSAgentFatalState.o \
38	KMSAgentKeyCallout.o \
39	KMSAgentKnownAnswerTests.o \
40	KMSAgentLoadBalancer.o \
41	KMSAgentPKICert.o \
42	KMSAgentPKICertOpenSSL.o \
43	KMSAgentPKICommon.o \
44	KMSAgentPKIKey.o \
45	KMSAgentPKIKeyOpenSSL.o \
46	KMSAgentSoapUtilities.o \
47	KMSAgentStorage.o \
48	KMSAgentStringUtilities.o \
49	KMSAuditLogger.o \
50	KMSClientProfile.o
51
52SOAP_OBJECTS =\
53	AgentServiceNamespace.o \
54	CAServiceNamespace.o \
55	CertificateServiceNamespace.o \
56	DiscoveryServiceNamespace.o \
57	KMS_AgentC.o \
58	KMS_AgentClient.o \
59	KMS_CAC.o \
60	KMS_CAClient.o \
61	KMS_CertificateC.o \
62	KMS_CertificateClient.o \
63	KMS_DiscoveryC.o \
64	KMS_DiscoveryClient.o \
65	envC.o \
66	stdsoap2.o
67
68OBJECTS= \
69	$(LIB_C_OBJECTS) \
70	$(LIB_CPP_OBJECTS)	\
71	$(SOAP_OBJECTS)
72
73LIBSRCDIR= ../common
74SOAPSRCDIR= ../common/SOAP
75
76include $(SRC)/lib/Makefile.lib
77
78SRCDIR=../common
79CSRCS 	= $(LIB_C_OBJECTS:%.o=$(LIBSRCDIR)/%.c)
80LIBSRCS = $(LIB_CPP_OBJECTS:%.o=$(LIBSRCDIR)/%.cpp) $(CSRCS)
81SOAPSRCS= $(SOAP_OBJECTS:%.o=$(SOAPSRCDIR)/%.cpp)
82
83CCOBJS = $(LIB_CPP_OBJECTS:%.o=pics/%.o) \
84	$(SOAP_OBJECTS:%.o=pics/%.o)
85
86LIBS	=	$(DYNLIB)
87
88CCNEEDED =	-lCstd -lCrun
89$(__GNUC)CCNEEDED       = -L$(SFWLIBDIR) -R$(SFWLIBDIR) -lstdc++ -lgcc_s
90
91LDLIBS  +=      $(CCNEEDED) -lpam -lc -lsoftcrypto -lcrypto -lssl -lsocket
92LDLIBS64  +=    $(CCNEEDED) -lpam -lc -lsoftcrypto -lcrypto -lssl -lsocket
93
94DEFINES =	-DKMSUSERPKCS12 -D_REENTRANT -DNOWCSICMP -DUNIX \
95		-DWITH_OPENSSL -DHAVE_OPENSSL_SSL_H \
96		-DWITH_IPV6 -D_POSIX_THREADS -DXML_STATIC \
97		-DHAVE_EXPAT_CONFIG_H -DK_SOLARIS_PLATFORM  \
98		-DOPENSSL_NO_DEPRECATED \
99		-DKMS_AGENT_VERSION_STRING=\"KMSAgentLibraryVersion:Build1016\"
100
101CFLAGS +=	$(CCVERBOSE)
102
103#
104# When building C++ objects, redefine CCFLAGS for 32-bit builds to
105# use "compat=5" instead of "compat=4".
106# The 64-bit CCFLAGS already use compat=5 option (see $SRC/Makefile.master)
107#
108$(CCOBJS) := i386_CCFLAGS = \
109		-compat=5 \
110		-Qoption ccfe -messages=no%anachronism \
111		-Qoption ccfe -features=no%conststrings \
112		$(CCERRWARN)
113
114$(CCOBJS) := sparc_CCFLAGS = \
115		-cg92 -compat=5 \
116		-Qoption ccfe -messages=no%anachronism \
117		-Qoption ccfe -features=no%conststrings \
118		$(CCERRWARN)
119
120CPPFLAGS +=	-I../common -I../common/SOAP -I$(SRC)/common/crypto/aes $(DEFINES)
121
122COPTFLAG +=	-xCC
123COPTFLAG64 +=	-xCC
124
125pics/stdsoap2.o:=	CPPFLAGS   += -DWITH_NONAMESPACES
126
127ROOTLIBDIR=     $(ROOT)/usr/lib
128ROOTLIBDIR64=   $(ROOT)/usr/lib/$(MACH64)
129
130.KEEP_STATE:
131
132all:    $(LIBS)
133
134#
135# Don't lint C++ code
136#
137lint:
138
139#
140# Need special rules here because the files are named ".cpp" instead
141# of ".cc".  The source comes from KMS, and we need to keep them in sync
142# so we won't change the naming convention.
143#
144pics/%.o:	$(LIBSRCDIR)/%.cpp
145	$(COMPILE.cc) -o $@ $<
146	$(POST_PROCESS_O)
147
148pics/%.o:	$(SOAPSRCDIR)/%.cpp
149	$(COMPILE.cc) -o $@ $<
150	$(POST_PROCESS_O)
151
152.cpp:
153	$(LINK.cc) -o $@ $< $(LDLIBS)
154	$(POST_PROCESS)
155
156.cpp.o:
157	$(COMPILE.cc) $(OUTPUT_OPTION) $<
158	$(POST_PROCESS_O)
159
160include $(SRC)/lib/Makefile.targ
161
162