xref: /titanic_44/usr/src/cmd/initpkg/Makefile (revision 549ec3fff108310966327d1dc9004551b63210b7)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29SHFILES=	dfstab vfstab
30CPFILES=	rcS rc0 rc1 rc2 rc3 mountall shutdown swapadd umountall
31ALL=		$(SHFILES) $(CPFILES)
32TXTS=		rcS.d/mk.rcS.d.sh rc0.d/mk.rc0.d.sh \
33		rc1.d/mk.rc1.d.sh rc2.d/mk.rc2.d.sh rc3.d/mk.rc3.d.sh
34CLOBBERFILES=	$(ALL)
35SUBDIRS=	rcS.d rc0.d rc1.d rc2.d rc3.d
36
37include ../Makefile.cmd
38
39ETCINITD=	$(ROOTETC)/init.d
40ETCDFSD=	$(ROOTETC)/dfs
41DIRS=		$(ETCINITD) $(ETCDFSD) $(ROOTETC)/security
42
43SBINF=		rcS mountall rc0 rc1 rc2 rc3 swapadd umountall
44SBINL=		rc5 rc6
45USRSBINF=	mountall shutdown umountall
46
47sparc_ETCTABS=
48i386_ETCTABS=	bootrc
49ETCTABS=	vfstab inittab nscd.conf security/crypt.conf $($(MACH)_ETCTABS)
50
51DFSTAB=		dfstab
52SBINETC=	rcS mountall rc0 rc1 rc2 rc3 rc5 rc6 swapadd umountall
53USRSBINETC=	shutdown
54
55OWNER=		root
56GROUP=		sys
57FILEMODE=	0744
58
59ROOTSBINF=	$(SBINF:%=$(ROOTSBIN)/%)
60ROOTSBINL=	$(SBINL:%=$(ROOTSBIN)/%)
61ROOTUSRSBINF=	$(USRSBINF:%=$(ROOTUSRSBIN)/%)
62ROOTETCTABS=	$(ETCTABS:%=$(ROOTETC)/%)
63ROOTDFSTAB=	$(DFSTAB:%=$(ETCDFSD)/%)
64SYMSBINF=	$(SBINETC:%=$(ROOTETC)/%)
65SYMUSRSBINF=	$(USRSBINETC:%=$(ROOTETC)/%)
66
67$(ROOTETC)/inittab		:= FILEMODE =	0644
68$(ROOTETC)/vfstab		:= FILEMODE =	0644
69$(ROOTETC)/nscd.conf		:= FILEMODE =	0644
70$(ROOTETC)/security/crypt.conf	:= FILEMODE =	0644
71$(ROOTETC)/bootrc		:= FILEMODE =	0755
72$(ROOTDFSTAB)			:= FILEMODE =	0644
73$(ROOTSBIN)/mountall		:= FILEMODE =	0555
74$(ROOTUSRSBIN)/mountall		:= FILEMODE =	0555
75$(ROOTSBIN)/umountall		:= FILEMODE =	0555
76$(ROOTUSRSBIN)/umountall	:= FILEMODE =	0555
77$(ROOTUSRSBIN)/shutdown		:= FILEMODE =	0755
78
79$(ETCDFSD)/% : %
80	$(INS.file)
81
82.KEEP_STATE:
83
84all: $(ALL) all_init.d $(TXTS)
85
86$(SYMSBINF):
87	$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
88
89$(SYMUSRSBINF):
90	$(RM) $@; $(SYMLINK) ../usr/sbin/$(@F) $@
91
92$(ROOTSBINL):	$(ROOTSBIN)/rc0
93	$(RM) $@; $(LN) $(ROOTSBIN)/rc0 $@
94
95all_init.d: FRC
96	@cd init.d; pwd; $(MAKE) $(MFLAGS) all
97
98ins_init.d: FRC
99	@cd init.d; pwd; $(MAKE) $(MFLAGS) install
100
101$(SHFILES):
102	sh $@.sh $(ROOT)
103
104install: $(ALL) ins_all ins_init.d $(SUBDIRS)
105
106ins_all : $(ROOTSBINF) $(ROOTSBINL) $(ROOTUSRSBINF) $(ROOTETCTABS) \
107	$(ROOTDFSTAB)  $(SYMSBINF) $(SYMUSRSBINF)
108
109# Don't re-install directories already installed by Targetdirs
110#$(DIRS):
111#	$(INS.dir)
112
113$(SUBDIRS):	FRC
114	@cd $@; pwd; ROOT=$(ROOT) CH=$(CH) sh mk.$@.sh
115
116FRC:
117
118clean lint:
119
120include	../Makefile.targ
121