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