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