xref: /titanic_41/usr/src/cmd/power/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# cmd/power/Makefile
29*7c478bd9Sstevel@tonic-gate#
30*7c478bd9Sstevel@tonic-gate#
31*7c478bd9Sstevel@tonic-gate
32*7c478bd9Sstevel@tonic-gateDAEMON_SRCS =	powerd.c sysstat.c
33*7c478bd9Sstevel@tonic-gateDAEMON_OBJS =	$(DAEMON_SRCS:%.c=%.o)
34*7c478bd9Sstevel@tonic-gateDAEMON =	powerd
35*7c478bd9Sstevel@tonic-gatePMCFG_SRCS = 	conf.c parse.c handlers.c
36*7c478bd9Sstevel@tonic-gatePMCFG_OBJS =	$(PMCFG_SRCS:%.c=%.o)
37*7c478bd9Sstevel@tonic-gatePMCFG = 	pmconfig
38*7c478bd9Sstevel@tonic-gateSRCS = 		$(DAEMON_SRCS) $(PMCFG_SRCS)
39*7c478bd9Sstevel@tonic-gateOBJS = 		$(SRCS:%.c=%.o)
40*7c478bd9Sstevel@tonic-gateSCRIPTS =	sysidpm.sh
41*7c478bd9Sstevel@tonic-gateSYSIDPM = 	sysidpm
42*7c478bd9Sstevel@tonic-gatePROG =		$(DAEMON) $(PMCFG) $(SYSIDPM)
43*7c478bd9Sstevel@tonic-gateETCFILES =	power.conf
44*7c478bd9Sstevel@tonic-gatePOWERPERM =	power
45*7c478bd9Sstevel@tonic-gate
46*7c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
47*7c478bd9Sstevel@tonic-gate
48*7c478bd9Sstevel@tonic-gateMANIFEST =	power.xml
49*7c478bd9Sstevel@tonic-gate
50*7c478bd9Sstevel@tonic-gateROOTMANIFESTDIR =	$(ROOTSVCSYSTEM)
51*7c478bd9Sstevel@tonic-gateROOTMETHOD =	$(ROOTLIBSVCMETHOD)/svc-power
52*7c478bd9Sstevel@tonic-gate
53*7c478bd9Sstevel@tonic-gateTEXT_DOMAIN=	SUNW_OST_OSCMD
54*7c478bd9Sstevel@tonic-gate
55*7c478bd9Sstevel@tonic-gatePOFILE=		power_all.po
56*7c478bd9Sstevel@tonic-gatePOFILES=	$(PMCFG_SRCS:%.c=%.po)
57*7c478bd9Sstevel@tonic-gate# needed because POFILES is deleted by clobber, but it's under
58*7c478bd9Sstevel@tonic-gate# SCCS control here.
59*7c478bd9Sstevel@tonic-gateOPOFILES=	sysidpm.po
60*7c478bd9Sstevel@tonic-gate
61*7c478bd9Sstevel@tonic-gate#
62*7c478bd9Sstevel@tonic-gate# we only need libdevinfo on sparc
63*7c478bd9Sstevel@tonic-gatesparc_LDEVINFO=	-ldevinfo
64*7c478bd9Sstevel@tonic-gatei386_LDEVINFO=
65*7c478bd9Sstevel@tonic-gate
66*7c478bd9Sstevel@tonic-gateDAEMON_LDLIBS =	$(LDLIBS.cmd) -lkstat $($(MACH)_LDEVINFO)
67*7c478bd9Sstevel@tonic-gatePMCFG_LDLIBS =	$(LDLIBS.cmd) -lcmd $($(MACH)_LDEVINFO)
68*7c478bd9Sstevel@tonic-gate
69*7c478bd9Sstevel@tonic-gateOWNER= root
70*7c478bd9Sstevel@tonic-gateROOTUSRSBINPMCFG= $(PMCFG:%=$(ROOTUSRSBIN)/%)
71*7c478bd9Sstevel@tonic-gate$(ROOTUSRSBINPMCFG) := GROUP= bin
72*7c478bd9Sstevel@tonic-gate$(ROOTUSRSBINPMCFG) := FILEMODE= 4555
73*7c478bd9Sstevel@tonic-gate
74*7c478bd9Sstevel@tonic-gateGROUP= sys
75*7c478bd9Sstevel@tonic-gateROOTLIBPOWER= $(ROOTLIB)/power
76*7c478bd9Sstevel@tonic-gateROOTLIBPOWERDAEMON= $(DAEMON:%=$(ROOTLIBPOWER)/%)
77*7c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER) := GROUP= sys
78*7c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER) := FILEMODE= 755
79*7c478bd9Sstevel@tonic-gate$(ROOTLIBPOWERDAEMON) := GROUP= bin
80*7c478bd9Sstevel@tonic-gate$(ROOTLIBPOWERDAEMON) := FILEMODE= 555
81*7c478bd9Sstevel@tonic-gate
82*7c478bd9Sstevel@tonic-gateROOTETCFILES= $(ETCFILES:%=$(ROOTETC)/%)
83*7c478bd9Sstevel@tonic-gate$(ROOTETCFILES) := FILEMODE= 644
84*7c478bd9Sstevel@tonic-gate
85*7c478bd9Sstevel@tonic-gateDFLTD= $(ROOTETC)/default
86*7c478bd9Sstevel@tonic-gateROOTDFLFILES= $(POWERPERM:%=$(DFLTD)/%)
87*7c478bd9Sstevel@tonic-gate$(ROOTDFLFILES) := FILEMODE= 444
88*7c478bd9Sstevel@tonic-gate
89*7c478bd9Sstevel@tonic-gateROOTUSRSBINSYSIDPM= $(SYSIDPM:%=$(ROOTUSRSBIN)/%)
90*7c478bd9Sstevel@tonic-gate$(ROOTUSRSBINSYSIDPM) := FILEMODE= 755
91*7c478bd9Sstevel@tonic-gate
92*7c478bd9Sstevel@tonic-gate#
93*7c478bd9Sstevel@tonic-gate# lint pass one enforcement
94*7c478bd9Sstevel@tonic-gate#
95*7c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE)
96*7c478bd9Sstevel@tonic-gate
97*7c478bd9Sstevel@tonic-gate.PARALLEL: $(OBJS)
98*7c478bd9Sstevel@tonic-gate
99*7c478bd9Sstevel@tonic-gate.KEEP_STATE:
100*7c478bd9Sstevel@tonic-gate
101*7c478bd9Sstevel@tonic-gateall: $(PROG) $(POWERPERM).dfl $(ETCFILES) $(SCRIPTS)
102*7c478bd9Sstevel@tonic-gate
103*7c478bd9Sstevel@tonic-gateinstall clean:
104*7c478bd9Sstevel@tonic-gate
105*7c478bd9Sstevel@tonic-gate$(DAEMON_OBJS): $(DAEMON_SRCS)
106*7c478bd9Sstevel@tonic-gate	$(CC) $(CFLAGS) -D_REENTRANT $(CPPFLAGS) -o $@ -c $<
107*7c478bd9Sstevel@tonic-gate	$(PROCESS_COMMENT) $@
108*7c478bd9Sstevel@tonic-gate
109*7c478bd9Sstevel@tonic-gate$(DAEMON): $(DAEMON_OBJS)
110*7c478bd9Sstevel@tonic-gate	$(CC) -o $@ $(DAEMON_OBJS) $(LDFLAGS) $(DAEMON_LDLIBS)
111*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
112*7c478bd9Sstevel@tonic-gate
113*7c478bd9Sstevel@tonic-gate$(PMCFG_OBJS): pmconfig.h
114*7c478bd9Sstevel@tonic-gate
115*7c478bd9Sstevel@tonic-gate$(PMCFG): $(PMCFG_OBJS)
116*7c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(PMCFG_OBJS) $(PMCFG_LDLIBS)
117*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
118*7c478bd9Sstevel@tonic-gate$(ROOTSVCSYSTEM)/power.xml := OWNER = root
119*7c478bd9Sstevel@tonic-gate$(ROOTSVCSYSTEM)/power.xml := GROUP = sys
120*7c478bd9Sstevel@tonic-gate$(ROOTSVCSYSTEM)/power.xml := FILEMODE = 0444
121*7c478bd9Sstevel@tonic-gate
122*7c478bd9Sstevel@tonic-gate$(ROOTLIBSVCMETHOD)/svc-power := OWNER = root
123*7c478bd9Sstevel@tonic-gate$(ROOTLIBSVCMETHOD)/svc-power := GROUP = bin
124*7c478bd9Sstevel@tonic-gate$(ROOTLIBSVCMETHOD)/svc-power := FILEMODE = 0555
125*7c478bd9Sstevel@tonic-gate
126*7c478bd9Sstevel@tonic-gateinstall: all $(ROOTUSRSBINPMCFG) $(ROOTLIBPOWERDAEMON) \
127*7c478bd9Sstevel@tonic-gate	$(ROOTETCFILES) $(ROOTUSRSBINSYSIDPM) $(ROOTDFLFILES) \
128*7c478bd9Sstevel@tonic-gate	$(ROOTMANIFEST) $(ROOTMETHOD)
129*7c478bd9Sstevel@tonic-gate
130*7c478bd9Sstevel@tonic-gate$(DFLTD)/%:	%.dfl
131*7c478bd9Sstevel@tonic-gate	$(INS.rename)
132*7c478bd9Sstevel@tonic-gate
133*7c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER):
134*7c478bd9Sstevel@tonic-gate	$(INS.dir)
135*7c478bd9Sstevel@tonic-gate
136*7c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER)/%:	%
137*7c478bd9Sstevel@tonic-gate	$(INS.file)
138*7c478bd9Sstevel@tonic-gate
139*7c478bd9Sstevel@tonic-gate$(ROOTLIBPOWERDAEMON): $(ROOTLIBPOWER)
140*7c478bd9Sstevel@tonic-gate
141*7c478bd9Sstevel@tonic-gate$(OPOFILES):
142*7c478bd9Sstevel@tonic-gate	@
143*7c478bd9Sstevel@tonic-gate
144*7c478bd9Sstevel@tonic-gate$(POFILE):	$(POFILES) $(OPOFILES)
145*7c478bd9Sstevel@tonic-gate	$(RM)	$@
146*7c478bd9Sstevel@tonic-gate	cat	$(POFILES) $(OPOFILES)	> $@
147*7c478bd9Sstevel@tonic-gate
148*7c478bd9Sstevel@tonic-gatecheck:	$(CHKMANIFEST)
149*7c478bd9Sstevel@tonic-gate
150*7c478bd9Sstevel@tonic-gateclean:
151*7c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(SYSIDPM)
152*7c478bd9Sstevel@tonic-gate	$(RM) $(POFILE) $(POFILES)
153*7c478bd9Sstevel@tonic-gate
154*7c478bd9Sstevel@tonic-gatelint := LINTFLAGS=-auxn
155*7c478bd9Sstevel@tonic-gatelint:
156*7c478bd9Sstevel@tonic-gate	$(LINT.c) $(DAEMON_SRCS)
157*7c478bd9Sstevel@tonic-gate	$(LINT.c) $(PMCFG_SRCS)
158*7c478bd9Sstevel@tonic-gate
159*7c478bd9Sstevel@tonic-gatecstyle:
160*7c478bd9Sstevel@tonic-gate	$(CSTYLE) $(SRCS)
161*7c478bd9Sstevel@tonic-gate
162*7c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
163