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