xref: /illumos-gate/usr/src/cmd/cmd-inet/etc/Makefile (revision ae115bc77f6fcde83175c75b4206dc2e50747966)
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#ident	"%Z%%M%	%I%	%E% SMI"
23#
24# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27
28SYMPROG= hosts inetd.conf networks protocols services netmasks sock2path
29
30# New /etc/inet files shouldn't have /etc entries.
31PROG= datemsk.ndpd ipaddrsel.conf ipsecalgs ipsecinit.sample \
32    ipqosconf.1.sample ipqosconf.2.sample ipqosconf.3.sample \
33    wanboot.conf.sample
34#mipagent config file permissions need to be tighter
35PROG2=	mipagent.conf-sample mipagent.conf.fa-sample mipagent.conf.ha-sample
36ETCPROG= $(SYMPROG) $(PROG) $(PROG2)
37SUBDIRS= default dhcp init.d ike nca ppp secret
38
39include ../../Makefile.cmd
40
41all:=		TARGET= all
42install:=	TARGET= install
43
44ROOTVAR=	$(ROOT)/var
45INETETCDIR=	$(ROOTETC)/inet
46INETVARDIR=	$(ROOTVAR)/inet
47DIRS= 		$(INETETCDIR) $(INETVARDIR)
48SYMDIR= 	inet
49ETCINETPROG=	$(ETCPROG:%=$(INETETCDIR)/%)
50ETCINETPROG2=	$(PROG2:%=$(INETETCDIR)/%)
51# Only old /etc/inet files get symlinks in /etc.
52SYMETCPROG=	$(SYMPROG:%=sym_%)
53SYMIPNODES=	$(INETETCDIR)/ipnodes
54
55FILEMODE= 0444
56OWNER= root
57GROUP= sys
58
59$(ETCINETPROG2):=	FILEMODE= 0600
60
61.KEEP_STATE:
62
63all: $(ETCPROG) $(SUBDIRS)
64
65install: all $(DIRS) $(ETCINETPROG) $(SYMETCPROG) $(SYMIPNODES) $(SUBDIRS)
66
67$(SYMIPNODES) :
68	$(RM) $@
69	$(SYMLINK) ./hosts $@
70
71$(INETETCDIR)/% : %
72	$(INS.file)
73
74sym_% : %
75	$(RM) $(ROOTETC)/$<
76	$(SYMLINK) $(SYMDIR)/$< $(ROOTETC)/$<
77
78$(DIRS):
79	$(INS.dir)
80
81$(SUBDIRS): FRC $(DIRS)
82	@cd $@; pwd; $(MAKE) $(TARGET)
83
84FRC:
85
86# datemsk.ndpd is generated from datemsk.template because of a side-effect of
87# SCCS.  Some of the datemsk.ndpd format strings include "%<letter>%", which
88# SCCS confuses for ID keywords.  datemsk.template should quote the "%"
89# with "\" and code below will filter out the "\".  Only datemsk.ndpd format
90# strings next to each other need to be quoted.
91
92datemsk.ndpd: datemsk.template
93	@while read i; do echo $$i; done < datemsk.template > $@
94
95clean clobber:
96	$(RM) datemsk.ndpd
97
98lint:
99