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