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