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