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