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