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# 22623ec8b0SRandy 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 34623ec8b0SRandy FishelSUSPEND_SRCS = sys-suspend.c pm_pam_conv.c 35623ec8b0SRandy FishelSUSPEND_OBJS = $(SUSPEND_SRCS:%.c=%.o) 36623ec8b0SRandy FishelSUSPEND = sys-suspend 37623ec8b0SRandy FishelSRCS = $(DAEMON_SRCS) $(PMCFG_SRCS) $(SUSPEND_SRCS) 387c478bd9Sstevel@tonic-gateOBJS = $(SRCS:%.c=%.o) 397c478bd9Sstevel@tonic-gateSCRIPTS = sysidpm.sh 407c478bd9Sstevel@tonic-gateSYSIDPM = sysidpm 41623ec8b0SRandy 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 58623ec8b0SRandy 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) 70*ec8accefSMilan JurikPMCFG_LDLIBS = $(LDLIBS.cmd) -lsmbios -lkstat $($(MACH)_LDEVINFO) 71623ec8b0SRandy FishelSUSPEND_LDLIBS = $(LDLIBS.cmd) -lbsm -lpam -lsecdb 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gateROOTUSRSBINPMCFG= $(PMCFG:%=$(ROOTUSRSBIN)/%) 747c478bd9Sstevel@tonic-gate$(ROOTUSRSBINPMCFG) := FILEMODE= 4555 75623ec8b0SRandy FishelROOTUSRBINSUSPEND= $(SUSPEND:%=$(ROOTBIN)/%) 76623ec8b0SRandy Fishel$(ROOTUSRBINSUSPEND) := FILEMODE= 4555 777c478bd9Sstevel@tonic-gate 787c478bd9Sstevel@tonic-gateROOTLIBPOWER= $(ROOTLIB)/power 797c478bd9Sstevel@tonic-gateROOTLIBPOWERDAEMON= $(DAEMON:%=$(ROOTLIBPOWER)/%) 807c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER) := FILEMODE= 755 817c478bd9Sstevel@tonic-gate$(ROOTLIBPOWERDAEMON) := FILEMODE= 555 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gateROOTETCFILES= $(ETCFILES:%=$(ROOTETC)/%) 847c478bd9Sstevel@tonic-gate$(ROOTETCFILES) := FILEMODE= 644 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gateROOTUSRSBINSYSIDPM= $(SYSIDPM:%=$(ROOTUSRSBIN)/%) 877c478bd9Sstevel@tonic-gate$(ROOTUSRSBINSYSIDPM) := FILEMODE= 755 887c478bd9Sstevel@tonic-gate 897c478bd9Sstevel@tonic-gate# 907c478bd9Sstevel@tonic-gate# lint pass one enforcement 917c478bd9Sstevel@tonic-gate# 927c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) 937c478bd9Sstevel@tonic-gate 947c478bd9Sstevel@tonic-gate.PARALLEL: $(OBJS) 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate.KEEP_STATE: 977c478bd9Sstevel@tonic-gate 987c478bd9Sstevel@tonic-gateall: $(PROG) $(POWERPERM).dfl $(ETCFILES) $(SCRIPTS) 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gateinstall clean: 1017c478bd9Sstevel@tonic-gate 1022df1fe9cSrandyf$(POWERCONF): $(POWERCONF).$(MACH) 1032df1fe9cSrandyf 1047c478bd9Sstevel@tonic-gate$(DAEMON_OBJS): $(DAEMON_SRCS) 1057c478bd9Sstevel@tonic-gate $(CC) $(CFLAGS) -D_REENTRANT $(CPPFLAGS) -o $@ -c $< 1067c478bd9Sstevel@tonic-gate $(PROCESS_COMMENT) $@ 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gate$(DAEMON): $(DAEMON_OBJS) 1097c478bd9Sstevel@tonic-gate $(CC) -o $@ $(DAEMON_OBJS) $(LDFLAGS) $(DAEMON_LDLIBS) 1107c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gate$(PMCFG_OBJS): pmconfig.h 1137c478bd9Sstevel@tonic-gate 1147c478bd9Sstevel@tonic-gate$(PMCFG): $(PMCFG_OBJS) 1157c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $(PMCFG_OBJS) $(PMCFG_LDLIBS) 1167c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1177c478bd9Sstevel@tonic-gate 118623ec8b0SRandy Fishel$(SUSPEND): $(SUSPEND_OBJS) 119623ec8b0SRandy Fishel $(LINK.c) -o $@ $(SUSPEND_OBJS) $(SUSPEND_LDLIBS) 120623ec8b0SRandy Fishel $(POST_PROCESS) 121623ec8b0SRandy Fishel 122623ec8b0SRandy Fishelinstall: all $(ROOTUSRSBINPMCFG) $(ROOTLIBPOWERDAEMON) $(ROOTUSRBINSUSPEND) \ 123a7872406Smeem $(ROOTETCFILES) $(ROOTUSRSBINSYSIDPM) $(ROOTETCDEFAULTFILES) \ 124a192e900Samaguire $(ROOTMANIFEST) $(ROOTSVCMETHOD) 1257c478bd9Sstevel@tonic-gate 1267c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER): 1277c478bd9Sstevel@tonic-gate $(INS.dir) 1287c478bd9Sstevel@tonic-gate 1297c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER)/%: % 1307c478bd9Sstevel@tonic-gate $(INS.file) 1317c478bd9Sstevel@tonic-gate 1327c478bd9Sstevel@tonic-gate$(ROOTLIBPOWERDAEMON): $(ROOTLIBPOWER) 1337c478bd9Sstevel@tonic-gate 1347c478bd9Sstevel@tonic-gate$(OPOFILES): 1357c478bd9Sstevel@tonic-gate @ 1367c478bd9Sstevel@tonic-gate 1377c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES) $(OPOFILES) 1387c478bd9Sstevel@tonic-gate $(RM) $@ 1397c478bd9Sstevel@tonic-gate cat $(POFILES) $(OPOFILES) > $@ 1407c478bd9Sstevel@tonic-gate 1417c478bd9Sstevel@tonic-gatecheck: $(CHKMANIFEST) 1427c478bd9Sstevel@tonic-gate 1437c478bd9Sstevel@tonic-gateclean: 1442df1fe9cSrandyf $(RM) $(OBJS) $(SYSIDPM) $(POWERCONF) 1457c478bd9Sstevel@tonic-gate $(RM) $(POFILE) $(POFILES) 1467c478bd9Sstevel@tonic-gate 1477c478bd9Sstevel@tonic-gatelint := LINTFLAGS=-auxn 1487c478bd9Sstevel@tonic-gatelint: 1497c478bd9Sstevel@tonic-gate $(LINT.c) $(DAEMON_SRCS) 1507c478bd9Sstevel@tonic-gate $(LINT.c) $(PMCFG_SRCS) 151623ec8b0SRandy Fishel $(LINT.c) $(SUSPEND_SRCS) 1527c478bd9Sstevel@tonic-gate 1537c478bd9Sstevel@tonic-gatecstyle: 1547c478bd9Sstevel@tonic-gate $(CSTYLE) $(SRCS) 1557c478bd9Sstevel@tonic-gate 1562df1fe9cSrandyf%: %.$(MACH) 1572df1fe9cSrandyf $(RM) $@ 1582df1fe9cSrandyf cat $< > $@ 1592df1fe9cSrandyf 1607c478bd9Sstevel@tonic-gateinclude ../Makefile.targ 161