xref: /titanic_52/usr/src/cmd/svc/profile/Makefile (revision 98a55d335316c9ad7a1e0095bfa1c3d0bbd4ab09)
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#
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27include ../../Makefile.cmd
28
29FILEMODE = 0444
30
31ROOTPROFILE = $(ROOT)/var/svc/profile
32
33PROFILESRCS = \
34	generic_open.xml \
35	generic_limited_net.xml \
36	inetd_generic.xml \
37	inetd_upgrade.xml \
38	ns_dns.xml \
39	ns_files.xml \
40	ns_ldap.xml \
41	ns_nis.xml \
42	ns_nisplus.xml \
43	ns_none.xml \
44	platform_SUNW,SPARC-Enterprise.xml \
45	platform_SUNW,Sun-Fire-15000.xml \
46	platform_SUNW,Sun-Fire-880.xml \
47	platform_SUNW,Sun-Fire.xml \
48	platform_SUNW,Ultra-Enterprise-10000.xml \
49	platform_SUNW,UltraSPARC-IIi-Netract.xml \
50	platform_none.xml \
51	platform_sun4v.xml
52
53PROFILES = $(PROFILESRCS:%=$(ROOTPROFILE)/%)
54
55PROFILES_open = generic_open.xml inetd_generic.xml
56PROFILES_limited = generic_limited_net.xml
57CHECK_OPEN = check_open
58CHECK_LMTD = check_limited
59
60COMM =	/usr/bin/comm
61TEE =	/usr/bin/tee
62TEST =	/usr/bin/test
63LISTSVCS = listsvcs.pl
64
65install: all $(PROFILES)
66	$(RM) $(ROOTPROFILE)/platform.xml
67	# SUNW,Sun-Fire-V890
68	$(RM) $(ROOTPROFILE)/platform_SUNW,Sun-Fire-V890.xml
69	$(LN) $(ROOTPROFILE)/platform_SUNW,Sun-Fire-880.xml \
70	    $(ROOTPROFILE)/platform_SUNW,Sun-Fire-V890.xml
71	# SUNW,UltraSPARC-IIe-NetraCT-[46]0
72	$(RM) $(ROOTPROFILE)/platform_SUNW,UltraSPARC-IIe-NetraCT-40.xml
73	$(RM) $(ROOTPROFILE)/platform_SUNW,UltraSPARC-IIe-NetraCT-60.xml
74	$(LN) $(ROOTPROFILE)/platform_SUNW,UltraSPARC-IIi-Netract.xml \
75	$(ROOTPROFILE)/platform_SUNW,UltraSPARC-IIe-NetraCT-40.xml
76	$(LN) $(ROOTPROFILE)/platform_SUNW,UltraSPARC-IIi-Netract.xml \
77	    $(ROOTPROFILE)/platform_SUNW,UltraSPARC-IIe-NetraCT-60.xml
78
79$(ROOTPROFILE)/%: %
80	$(INS.file)
81
82all:	$(CHECK_OPEN) $(CHECK_LMTD)
83
84#
85#	Enforce consistency between open and limited profiles per README
86#
87$(CHECK_OPEN) :=	PROFILES_CHECKED = open
88$(CHECK_OPEN) :=	PROFILES_COVERING = limited
89$(CHECK_LMTD) :=	PROFILES_CHECKED = limited
90$(CHECK_LMTD) :=	PROFILES_COVERING = open
91$(CHECK_OPEN) $(CHECK_LMTD): \
92	$(LISTSVCS) $(PROFILES_open) $(PROFILES_limited)
93	@$(ECHO) Check for enabled $(PROFILES_CHECKED) services \
94		not covered by $(PROFILES_COVERING) profile
95	@$(PERL) -w $(LISTSVCS) -e $(PROFILES_$(PROFILES_CHECKED)) > $@.enabled
96	@$(PERL) -w $(LISTSVCS) $(PROFILES_$(PROFILES_COVERING)) > $@.all
97	@$(COMM) -23 $@.enabled $@.all | $(TEE) $@.notcovered
98	@$(TEST) ! -s $@.notcovered && $(TOUCH) $@
99
100lint _msg:
101
102clobber clean:
103	$(RM) $(CHECK_OPEN)* $(CHECK_LMTD)*
104