xref: /titanic_41/usr/src/cmd/power/Makefile (revision 623ec8b0965ca16c95dab78c0bd2af81733a0253)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
506e1a714Sraf# Common Development and Distribution License (the "License").
606e1a714Sraf# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22*623ec8b0SRandy Fishel# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate# cmd/power/Makefile
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gateDAEMON_SRCS =	powerd.c sysstat.c
297c478bd9Sstevel@tonic-gateDAEMON_OBJS =	$(DAEMON_SRCS:%.c=%.o)
307c478bd9Sstevel@tonic-gateDAEMON =	powerd
317c478bd9Sstevel@tonic-gatePMCFG_SRCS = 	conf.c parse.c handlers.c
327c478bd9Sstevel@tonic-gatePMCFG_OBJS =	$(PMCFG_SRCS:%.c=%.o)
337c478bd9Sstevel@tonic-gatePMCFG = 	pmconfig
34*623ec8b0SRandy FishelSUSPEND_SRCS = 	sys-suspend.c pm_pam_conv.c
35*623ec8b0SRandy FishelSUSPEND_OBJS =	$(SUSPEND_SRCS:%.c=%.o)
36*623ec8b0SRandy FishelSUSPEND = 	sys-suspend
37*623ec8b0SRandy FishelSRCS = 		$(DAEMON_SRCS) $(PMCFG_SRCS) $(SUSPEND_SRCS)
387c478bd9Sstevel@tonic-gateOBJS = 		$(SRCS:%.c=%.o)
397c478bd9Sstevel@tonic-gateSCRIPTS =	sysidpm.sh
407c478bd9Sstevel@tonic-gateSYSIDPM = 	sysidpm
41*623ec8b0SRandy FishelPROG =		$(DAEMON) $(PMCFG) $(SYSIDPM) $(SUSPEND)
422df1fe9cSrandyfPOWERCONF=	power.conf
432df1fe9cSrandyfETCFILES =	$(POWERCONF)
447c478bd9Sstevel@tonic-gatePOWERPERM =	power
45a7872406SmeemDEFAULTFILES =	power.dfl
467c478bd9Sstevel@tonic-gate
47a192e900SamaguireMANIFEST=	power.xml
48a192e900SamaguireSVCMETHOD=	svc-power
49a192e900Samaguire
507c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
517c478bd9Sstevel@tonic-gate
527c478bd9Sstevel@tonic-gateROOTMANIFESTDIR =	$(ROOTSVCSYSTEM)
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gateTEXT_DOMAIN=	SUNW_OST_OSCMD
557c478bd9Sstevel@tonic-gate
561dc065c6Smh27603XGETFLAGS +=    -a -x power_all.xcl
577c478bd9Sstevel@tonic-gatePOFILE=		power_all.po
58*623ec8b0SRandy FishelPOFILES=	$(PMCFG_SRCS:%.c=%.po) $(SUSPEND_SRCS:%.c=%.po)
597c478bd9Sstevel@tonic-gate# needed because POFILES is deleted by clobber, but it's under
607c478bd9Sstevel@tonic-gate# SCCS control here.
617c478bd9Sstevel@tonic-gateOPOFILES=	sysidpm.po
627c478bd9Sstevel@tonic-gate
632df1fe9cSrandyf# pmconfig only needs libdevinfo on sparc
64e7cbe64fSgw25295sparc_LDEVINFO=	-ldevinfo -lefi -ladm -lzfs -lnvpair
657c478bd9Sstevel@tonic-gatei386_LDEVINFO=
667c478bd9Sstevel@tonic-gate
672df1fe9cSrandyfLDEVINFO=	-ldevinfo
682df1fe9cSrandyf
692df1fe9cSrandyfDAEMON_LDLIBS =	$(LDLIBS.cmd) -lkstat $(LDEVINFO)
702df1fe9cSrandyfPMCFG_LDLIBS =	$(LDLIBS.cmd) -lcmd -lsmbios -lkstat $($(MACH)_LDEVINFO)
71*623ec8b0SRandy FishelSUSPEND_LDLIBS = $(LDLIBS.cmd) -lbsm -lpam -lsecdb
727c478bd9Sstevel@tonic-gate
737c478bd9Sstevel@tonic-gateOWNER= root
747c478bd9Sstevel@tonic-gateROOTUSRSBINPMCFG= $(PMCFG:%=$(ROOTUSRSBIN)/%)
757c478bd9Sstevel@tonic-gate$(ROOTUSRSBINPMCFG) := GROUP= bin
767c478bd9Sstevel@tonic-gate$(ROOTUSRSBINPMCFG) := FILEMODE= 4555
77*623ec8b0SRandy FishelROOTUSRBINSUSPEND= $(SUSPEND:%=$(ROOTBIN)/%)
78*623ec8b0SRandy Fishel$(ROOTUSRBINSUSPEND) := GROUP= bin
79*623ec8b0SRandy Fishel$(ROOTUSRBINSUSPEND) := FILEMODE= 4555
807c478bd9Sstevel@tonic-gate
817c478bd9Sstevel@tonic-gateGROUP= sys
827c478bd9Sstevel@tonic-gateROOTLIBPOWER= $(ROOTLIB)/power
837c478bd9Sstevel@tonic-gateROOTLIBPOWERDAEMON= $(DAEMON:%=$(ROOTLIBPOWER)/%)
847c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER) := GROUP= sys
857c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER) := FILEMODE= 755
867c478bd9Sstevel@tonic-gate$(ROOTLIBPOWERDAEMON) := GROUP= bin
877c478bd9Sstevel@tonic-gate$(ROOTLIBPOWERDAEMON) := FILEMODE= 555
887c478bd9Sstevel@tonic-gate
897c478bd9Sstevel@tonic-gateROOTETCFILES= $(ETCFILES:%=$(ROOTETC)/%)
907c478bd9Sstevel@tonic-gate$(ROOTETCFILES) := FILEMODE= 644
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gateROOTUSRSBINSYSIDPM= $(SYSIDPM:%=$(ROOTUSRSBIN)/%)
937c478bd9Sstevel@tonic-gate$(ROOTUSRSBINSYSIDPM) := FILEMODE= 755
947c478bd9Sstevel@tonic-gate
957c478bd9Sstevel@tonic-gate#
967c478bd9Sstevel@tonic-gate# lint pass one enforcement
977c478bd9Sstevel@tonic-gate#
987c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE)
997c478bd9Sstevel@tonic-gate
1007c478bd9Sstevel@tonic-gate.PARALLEL: $(OBJS)
1017c478bd9Sstevel@tonic-gate
1027c478bd9Sstevel@tonic-gate.KEEP_STATE:
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gateall: $(PROG) $(POWERPERM).dfl $(ETCFILES) $(SCRIPTS)
1057c478bd9Sstevel@tonic-gate
1067c478bd9Sstevel@tonic-gateinstall clean:
1077c478bd9Sstevel@tonic-gate
1082df1fe9cSrandyf$(POWERCONF): $(POWERCONF).$(MACH)
1092df1fe9cSrandyf
1107c478bd9Sstevel@tonic-gate$(DAEMON_OBJS): $(DAEMON_SRCS)
1117c478bd9Sstevel@tonic-gate	$(CC) $(CFLAGS) -D_REENTRANT $(CPPFLAGS) -o $@ -c $<
1127c478bd9Sstevel@tonic-gate	$(PROCESS_COMMENT) $@
1137c478bd9Sstevel@tonic-gate
1147c478bd9Sstevel@tonic-gate$(DAEMON): $(DAEMON_OBJS)
1157c478bd9Sstevel@tonic-gate	$(CC) -o $@ $(DAEMON_OBJS) $(LDFLAGS) $(DAEMON_LDLIBS)
1167c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1177c478bd9Sstevel@tonic-gate
1187c478bd9Sstevel@tonic-gate$(PMCFG_OBJS): pmconfig.h
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gate$(PMCFG): $(PMCFG_OBJS)
1217c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(PMCFG_OBJS) $(PMCFG_LDLIBS)
1227c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1237c478bd9Sstevel@tonic-gate
124*623ec8b0SRandy Fishel$(SUSPEND): $(SUSPEND_OBJS)
125*623ec8b0SRandy Fishel	$(LINK.c) -o $@ $(SUSPEND_OBJS) $(SUSPEND_LDLIBS)
126*623ec8b0SRandy Fishel	$(POST_PROCESS)
127*623ec8b0SRandy Fishel
128*623ec8b0SRandy Fishelinstall: all $(ROOTUSRSBINPMCFG) $(ROOTLIBPOWERDAEMON) $(ROOTUSRBINSUSPEND) \
129a7872406Smeem	$(ROOTETCFILES) $(ROOTUSRSBINSYSIDPM) $(ROOTETCDEFAULTFILES) \
130a192e900Samaguire	$(ROOTMANIFEST) $(ROOTSVCMETHOD)
1317c478bd9Sstevel@tonic-gate
1327c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER):
1337c478bd9Sstevel@tonic-gate	$(INS.dir)
1347c478bd9Sstevel@tonic-gate
1357c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER)/%:	%
1367c478bd9Sstevel@tonic-gate	$(INS.file)
1377c478bd9Sstevel@tonic-gate
1387c478bd9Sstevel@tonic-gate$(ROOTLIBPOWERDAEMON): $(ROOTLIBPOWER)
1397c478bd9Sstevel@tonic-gate
1407c478bd9Sstevel@tonic-gate$(OPOFILES):
1417c478bd9Sstevel@tonic-gate	@
1427c478bd9Sstevel@tonic-gate
1437c478bd9Sstevel@tonic-gate$(POFILE):	$(POFILES) $(OPOFILES)
1447c478bd9Sstevel@tonic-gate	$(RM)	$@
1457c478bd9Sstevel@tonic-gate	cat	$(POFILES) $(OPOFILES)	> $@
1467c478bd9Sstevel@tonic-gate
1477c478bd9Sstevel@tonic-gatecheck:	$(CHKMANIFEST)
1487c478bd9Sstevel@tonic-gate
1497c478bd9Sstevel@tonic-gateclean:
1502df1fe9cSrandyf	$(RM) $(OBJS) $(SYSIDPM) $(POWERCONF)
1517c478bd9Sstevel@tonic-gate	$(RM) $(POFILE) $(POFILES)
1527c478bd9Sstevel@tonic-gate
1537c478bd9Sstevel@tonic-gatelint := LINTFLAGS=-auxn
1547c478bd9Sstevel@tonic-gatelint:
1557c478bd9Sstevel@tonic-gate	$(LINT.c) $(DAEMON_SRCS)
1567c478bd9Sstevel@tonic-gate	$(LINT.c) $(PMCFG_SRCS)
157*623ec8b0SRandy Fishel	$(LINT.c) $(SUSPEND_SRCS)
1587c478bd9Sstevel@tonic-gate
1597c478bd9Sstevel@tonic-gatecstyle:
1607c478bd9Sstevel@tonic-gate	$(CSTYLE) $(SRCS)
1617c478bd9Sstevel@tonic-gate
1622df1fe9cSrandyf%:	%.$(MACH)
1632df1fe9cSrandyf	$(RM) $@
1642df1fe9cSrandyf	cat $< > $@
1652df1fe9cSrandyf
1667c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
167