xref: /illumos-gate/usr/src/cmd/cmd-crypto/etc/Makefile (revision dd51520e127b452179a2ce4ea3bd8dee949f9afe)
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 (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
23#
24
25RELEASECERTS =		SUNW_SunOS_5.10
26RELEASECRYPTO =		SUNW_SunOS_5.10
27
28ETCCRYPTOFILES = \
29	kcf.conf \
30	pkcs11.conf \
31	kmf.conf \
32	$(RELEASECRYPTO:%=certs/%) \
33	certs/CA \
34	certs/SUNWObjectCA
35
36ETCCERTSFILES = \
37	$(RELEASECERTS) \
38	SUNWSolarisCA \
39	SUNWObjectCA
40
41ANNOTATEDFILES = \
42	certs/SUNWObjectCA.annot
43
44include ../../Makefile.cmd
45.KEEP_STATE:
46
47ROOTETC=		$(ROOT)/etc
48ROOTCRYPTODIR=		$(ROOTETC)/crypto
49ROOTCRYPTOCERTSDIR=	$(ROOTCRYPTODIR)/certs
50
51ROOTETCCERTSDIR=	$(ROOTETC)/certs
52
53CADIR=			certs/CA
54ROOTETCCADIR=		$(ROOTETC)/$(CADIR)
55
56ROOTETCCALINKDIR=	$(ROOTETC)/openssl/certs
57CATARGDIR=		../../$(CADIR)
58
59IETCCRYPTOFILES=	$(ETCCRYPTOFILES:%=$(ROOTCRYPTODIR)/%)
60IETCCERTSFILES=		$(ETCCERTSFILES:%=$(ROOTETCCERTSDIR)/%)
61
62include Makefile.ca-links
63
64$(ROOTCRYPTOCERTSDIR)/SUNWObjectCA: \
65			$(ROOTETCCERTSDIR)/SUNWObjectCA
66			$(RM) $@
67			$(LN) $(ROOTETCCERTSDIR)/SUNWObjectCA $@
68$(ROOTCRYPTODIR)/%:	%
69			$(INS.file)
70$(RELEASECRYPTO:%=$(ROOTCRYPTODIR)/certs/%): \
71			certs/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%)
72			$(RM) $@
73			$(INS) -s -m $(FILEMODE) -f $(@D) \
74				certs/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%)
75			$(MV) $(@D)/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%) $@
76
77$(ROOTETCCERTSDIR)/SUNWObjectCA: \
78			certs/$$(@F)
79			$(RM) $@
80			$(INS) -s -m $(FILEMODE) -f $(@D) certs/$(@F)
81$(ROOTETCCERTSDIR)/%:	certs/%
82			$(INS.file)
83$(RELEASECERTS:%=$(ROOTETCCERTSDIR)/%): \
84			certs/$(@F:SUNW_SunOS_5.%=SUNWSolaris%)
85			$(RM) $@
86			$(INS) -s -m $(FILEMODE) -f $(@D) \
87				certs/$(@F:SUNW_SunOS_5.%=SUNWSolaris%)
88			$(MV) $(@D)/$(@F:SUNW_SunOS_5.%=SUNWSolaris%) $@
89
90ANNOT_DEL =	SOURCE ANNOTATION DELETE
91$(ANNOTATEDFILES:%.annot=%): \
92			$$(@:%=%.annot)
93			$(RM) $@
94			$(SED) -e '/${ANNOT_DEL} START/,/${ANNOT_DEL} END/d' \
95				$(@:%=%.annot) > $@
96
97$(IETCCRYPTOFILES):=	FILEMODE= 644
98$(IETCCERTSFILES):=	FILEMODE= 644
99$(IETCCAFILES):=	FILEMODE= 644
100
101.PARALLEL:	$(IETCCAFILES)
102
103install:	$(IETCCAFILES) $(IETCCRYPTOFILES) $(IETCCERTSFILES)
104
105clean clobber:
106		$(RM) $(ANNOTATEDFILES:%.annot=%)
107