xref: /titanic_41/usr/src/cmd/cmd-crypto/etc/Makefile (revision 0a0e9771ca0211c15f3ac4466b661c145feeb9e4)
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#
22# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26RELEASECERTS =		SUNW_SunOS_5.10
27RELEASECRYPTO =		SUNW_SunOS_5.10 \
28			SUNW_SunOS_5.11_Limited
29
30ETCCRYPTOFILES = \
31	kcf.conf \
32	pkcs11.conf \
33	kmf.conf \
34	$(RELEASECRYPTO:%=certs/%) \
35	certs/CA \
36	certs/SUNWObjectCA
37
38ETCCERTSFILES = \
39	$(RELEASECERTS) \
40	SUNWSolarisCA \
41	SUNWObjectCA
42
43ANNOTATEDFILES = \
44	certs/SUNWObjectCA.annot
45
46include ../../Makefile.cmd
47
48.KEEP_STATE:
49
50ROOTCRYPTODIR=		$(ROOT)/etc/crypto
51ROOTCRYPTOCERTSDIR=	$(ROOTCRYPTODIR)/certs
52
53ROOTETCCERTSDIR=	$(ROOT)/etc/certs
54
55IETCCRYPTOFILES=	$(ETCCRYPTOFILES:%=$(ROOTCRYPTODIR)/%)
56IETCCERTSFILES=		$(ETCCERTSFILES:%=$(ROOTETCCERTSDIR)/%)
57
58$(ROOTCRYPTOCERTSDIR)/SUNWObjectCA: \
59			$(ROOTETCCERTSDIR)/SUNWObjectCA
60			$(RM) $@
61			$(LN) $(ROOTETCCERTSDIR)/SUNWObjectCA $@
62$(ROOTCRYPTODIR)/%:	%
63			$(INS.file)
64$(RELEASECRYPTO:%=$(ROOTCRYPTODIR)/certs/%): \
65			certs/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%)
66			$(RM) $@
67			$(INS) -s -m $(FILEMODE) -f $(@D) \
68				certs/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%)
69			$(MV) $(@D)/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%) $@
70
71$(ROOTETCCERTSDIR)/SUNWObjectCA: \
72			certs/$$(@F)
73			$(RM) $@
74			$(INS) -s -m $(FILEMODE) -f $(@D) certs/$(@F)
75$(ROOTETCCERTSDIR)/%:	certs/%
76			$(INS.file)
77$(RELEASECERTS:%=$(ROOTETCCERTSDIR)/%): \
78			certs/$(@F:SUNW_SunOS_5.%=SUNWSolaris%)
79			$(RM) $@
80			$(INS) -s -m $(FILEMODE) -f $(@D) \
81				certs/$(@F:SUNW_SunOS_5.%=SUNWSolaris%)
82			$(MV) $(@D)/$(@F:SUNW_SunOS_5.%=SUNWSolaris%) $@
83
84ANNOT_DEL =	SOURCE ANNOTATION DELETE
85$(ANNOTATEDFILES:%.annot=%): \
86			$$(@:%=%.annot)
87			$(RM) $@
88			$(SED) -e '/${ANNOT_DEL} START/,/${ANNOT_DEL} END/d' \
89				$(@:%=%.annot) > $@
90
91$(IETCCRYPTOFILES):=	FILEMODE= 644
92$(IETCCERTSFILES):=	FILEMODE= 644
93
94install:	$(IETCCRYPTOFILES) $(IETCCERTSFILES)
95
96clean clobber:
97		$(RM) $(ANNOTATEDFILES:%.annot=%)
98