xref: /titanic_41/usr/src/cmd/initpkg/Makefile (revision 26fd77009b17f8c8fb32eb362584cfd635e87ad9)
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# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26SHFILES=	dfstab vfstab
27CPFILES=	rcS rc0 rc1 rc2 rc3 mountall shutdown swapadd umountall
28ALL=		$(SHFILES) $(CPFILES)
29TXTS=		rcS.d/mk.rcS.d.sh rc0.d/mk.rc0.d.sh \
30		rc1.d/mk.rc1.d.sh rc2.d/mk.rc2.d.sh rc3.d/mk.rc3.d.sh
31CLOBBERFILES=	$(ALL)
32SUBDIRS=	rcS.d rc0.d rc1.d rc2.d rc3.d
33
34include ../Makefile.cmd
35
36ETCINITD=	$(ROOTETC)/init.d
37ETCDFSD=	$(ROOTETC)/dfs
38DIRS=		$(ETCINITD) $(ETCDFSD) $(ROOTETC)/security
39
40SBINF=		rcS mountall rc0 rc1 rc2 rc3 swapadd umountall
41SBINL=		rc5 rc6
42USRSBINF=	mountall shutdown umountall
43
44sparc_ETCTABS=
45i386_ETCTABS=	bootrc
46ETCTABS=	vfstab inittab nscd.conf security/crypt.conf $($(MACH)_ETCTABS)
47
48DFSTAB=		dfstab
49SBINETC=	rcS mountall rc0 rc1 rc2 rc3 rc5 rc6 swapadd umountall
50USRSBINETC=	shutdown
51
52FILEMODE=	0744
53
54ROOTSBINF=	$(SBINF:%=$(ROOTSBIN)/%)
55ROOTSBINL=	$(SBINL:%=$(ROOTSBIN)/%)
56ROOTUSRSBINF=	$(USRSBINF:%=$(ROOTUSRSBIN)/%)
57ROOTETCTABS=	$(ETCTABS:%=$(ROOTETC)/%)
58ROOTDFSTAB=	$(DFSTAB:%=$(ETCDFSD)/%)
59SYMSBINF=	$(SBINETC:%=$(ROOTETC)/%)
60SYMUSRSBINF=	$(USRSBINETC:%=$(ROOTETC)/%)
61
62$(ROOTETC)/inittab		:= FILEMODE =	0644
63$(ROOTETC)/vfstab		:= FILEMODE =	0644
64$(ROOTETC)/nscd.conf		:= FILEMODE =	0644
65$(ROOTETC)/security/crypt.conf	:= FILEMODE =	0644
66$(ROOTETC)/bootrc		:= FILEMODE =	0755
67$(ROOTDFSTAB)			:= FILEMODE =	0644
68$(ROOTSBIN)/mountall		:= FILEMODE =	0555
69$(ROOTUSRSBIN)/mountall		:= FILEMODE =	0555
70$(ROOTSBIN)/umountall		:= FILEMODE =	0555
71$(ROOTUSRSBIN)/umountall	:= FILEMODE =	0555
72$(ROOTUSRSBIN)/shutdown		:= FILEMODE =	0755
73
74$(ETCDFSD)/% : %
75	$(INS.file)
76
77.KEEP_STATE:
78
79all: $(ALL) all_init.d $(TXTS)
80
81$(SYMSBINF):
82	$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
83
84$(SYMUSRSBINF):
85	$(RM) $@; $(SYMLINK) ../usr/sbin/$(@F) $@
86
87$(ROOTSBINL):	$(ROOTSBIN)/rc0
88	$(RM) $@; $(LN) $(ROOTSBIN)/rc0 $@
89
90all_init.d: FRC
91	@cd init.d; pwd; $(MAKE) $(MFLAGS) all
92
93ins_init.d: FRC
94	@cd init.d; pwd; $(MAKE) $(MFLAGS) install
95
96$(SHFILES):
97	sh $@.sh $(ROOT)
98
99install: $(ALL) ins_all ins_init.d $(SUBDIRS)
100
101ins_all : $(ROOTSBINF) $(ROOTSBINL) $(ROOTUSRSBINF) $(ROOTETCTABS) \
102	$(ROOTDFSTAB)  $(SYMSBINF) $(SYMUSRSBINF)
103
104# Don't re-install directories already installed by Targetdirs
105#$(DIRS):
106#	$(INS.dir)
107
108$(SUBDIRS):	FRC
109	@cd $@; pwd; ROOT=$(ROOT) sh mk.$@.sh
110
111FRC:
112
113clean lint:
114
115include	../Makefile.targ
116