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*2df1fe9cSrandyf# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate# Use is subject to license terms. 247c478bd9Sstevel@tonic-gate# 257c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 267c478bd9Sstevel@tonic-gate# 277c478bd9Sstevel@tonic-gate# cmd/power/Makefile 287c478bd9Sstevel@tonic-gate# 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gateDAEMON_SRCS = powerd.c sysstat.c 317c478bd9Sstevel@tonic-gateDAEMON_OBJS = $(DAEMON_SRCS:%.c=%.o) 327c478bd9Sstevel@tonic-gateDAEMON = powerd 337c478bd9Sstevel@tonic-gatePMCFG_SRCS = conf.c parse.c handlers.c 347c478bd9Sstevel@tonic-gatePMCFG_OBJS = $(PMCFG_SRCS:%.c=%.o) 357c478bd9Sstevel@tonic-gatePMCFG = pmconfig 367c478bd9Sstevel@tonic-gateSRCS = $(DAEMON_SRCS) $(PMCFG_SRCS) 377c478bd9Sstevel@tonic-gateOBJS = $(SRCS:%.c=%.o) 387c478bd9Sstevel@tonic-gateSCRIPTS = sysidpm.sh 397c478bd9Sstevel@tonic-gateSYSIDPM = sysidpm 407c478bd9Sstevel@tonic-gatePROG = $(DAEMON) $(PMCFG) $(SYSIDPM) 41*2df1fe9cSrandyfPOWERCONF= power.conf 42*2df1fe9cSrandyfETCFILES = $(POWERCONF) 437c478bd9Sstevel@tonic-gatePOWERPERM = power 44a7872406SmeemDEFAULTFILES = power.dfl 457c478bd9Sstevel@tonic-gate 46a192e900SamaguireMANIFEST= power.xml 47a192e900SamaguireSVCMETHOD= svc-power 48a192e900Samaguire 497c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd 507c478bd9Sstevel@tonic-gate 517c478bd9Sstevel@tonic-gateROOTMANIFESTDIR = $(ROOTSVCSYSTEM) 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gateTEXT_DOMAIN= SUNW_OST_OSCMD 547c478bd9Sstevel@tonic-gate 551dc065c6Smh27603XGETFLAGS += -a -x power_all.xcl 567c478bd9Sstevel@tonic-gatePOFILE= power_all.po 577c478bd9Sstevel@tonic-gatePOFILES= $(PMCFG_SRCS:%.c=%.po) 587c478bd9Sstevel@tonic-gate# needed because POFILES is deleted by clobber, but it's under 597c478bd9Sstevel@tonic-gate# SCCS control here. 607c478bd9Sstevel@tonic-gateOPOFILES= sysidpm.po 617c478bd9Sstevel@tonic-gate 62*2df1fe9cSrandyf# pmconfig only needs libdevinfo on sparc 637c478bd9Sstevel@tonic-gatesparc_LDEVINFO= -ldevinfo 647c478bd9Sstevel@tonic-gatei386_LDEVINFO= 657c478bd9Sstevel@tonic-gate 66*2df1fe9cSrandyfLDEVINFO= -ldevinfo 67*2df1fe9cSrandyf 68*2df1fe9cSrandyfDAEMON_LDLIBS = $(LDLIBS.cmd) -lkstat $(LDEVINFO) 69*2df1fe9cSrandyfPMCFG_LDLIBS = $(LDLIBS.cmd) -lcmd -lsmbios -lkstat $($(MACH)_LDEVINFO) 707c478bd9Sstevel@tonic-gate 717c478bd9Sstevel@tonic-gateOWNER= root 727c478bd9Sstevel@tonic-gateROOTUSRSBINPMCFG= $(PMCFG:%=$(ROOTUSRSBIN)/%) 737c478bd9Sstevel@tonic-gate$(ROOTUSRSBINPMCFG) := GROUP= bin 747c478bd9Sstevel@tonic-gate$(ROOTUSRSBINPMCFG) := FILEMODE= 4555 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gateGROUP= sys 777c478bd9Sstevel@tonic-gateROOTLIBPOWER= $(ROOTLIB)/power 787c478bd9Sstevel@tonic-gateROOTLIBPOWERDAEMON= $(DAEMON:%=$(ROOTLIBPOWER)/%) 797c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER) := GROUP= sys 807c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER) := FILEMODE= 755 817c478bd9Sstevel@tonic-gate$(ROOTLIBPOWERDAEMON) := GROUP= bin 827c478bd9Sstevel@tonic-gate$(ROOTLIBPOWERDAEMON) := FILEMODE= 555 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gateROOTETCFILES= $(ETCFILES:%=$(ROOTETC)/%) 857c478bd9Sstevel@tonic-gate$(ROOTETCFILES) := FILEMODE= 644 867c478bd9Sstevel@tonic-gate 877c478bd9Sstevel@tonic-gateROOTUSRSBINSYSIDPM= $(SYSIDPM:%=$(ROOTUSRSBIN)/%) 887c478bd9Sstevel@tonic-gate$(ROOTUSRSBINSYSIDPM) := FILEMODE= 755 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate# 917c478bd9Sstevel@tonic-gate# lint pass one enforcement 927c478bd9Sstevel@tonic-gate# 937c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) 947c478bd9Sstevel@tonic-gate 957c478bd9Sstevel@tonic-gate.PARALLEL: $(OBJS) 967c478bd9Sstevel@tonic-gate 977c478bd9Sstevel@tonic-gate.KEEP_STATE: 987c478bd9Sstevel@tonic-gate 997c478bd9Sstevel@tonic-gateall: $(PROG) $(POWERPERM).dfl $(ETCFILES) $(SCRIPTS) 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gateinstall clean: 1027c478bd9Sstevel@tonic-gate 103*2df1fe9cSrandyf$(POWERCONF): $(POWERCONF).$(MACH) 104*2df1fe9cSrandyf 1057c478bd9Sstevel@tonic-gate$(DAEMON_OBJS): $(DAEMON_SRCS) 1067c478bd9Sstevel@tonic-gate $(CC) $(CFLAGS) -D_REENTRANT $(CPPFLAGS) -o $@ -c $< 1077c478bd9Sstevel@tonic-gate $(PROCESS_COMMENT) $@ 1087c478bd9Sstevel@tonic-gate 1097c478bd9Sstevel@tonic-gate$(DAEMON): $(DAEMON_OBJS) 1107c478bd9Sstevel@tonic-gate $(CC) -o $@ $(DAEMON_OBJS) $(LDFLAGS) $(DAEMON_LDLIBS) 1117c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1127c478bd9Sstevel@tonic-gate 1137c478bd9Sstevel@tonic-gate$(PMCFG_OBJS): pmconfig.h 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gate$(PMCFG): $(PMCFG_OBJS) 1167c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $(PMCFG_OBJS) $(PMCFG_LDLIBS) 1177c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1187c478bd9Sstevel@tonic-gate 1197c478bd9Sstevel@tonic-gateinstall: all $(ROOTUSRSBINPMCFG) $(ROOTLIBPOWERDAEMON) \ 120a7872406Smeem $(ROOTETCFILES) $(ROOTUSRSBINSYSIDPM) $(ROOTETCDEFAULTFILES) \ 121a192e900Samaguire $(ROOTMANIFEST) $(ROOTSVCMETHOD) 1227c478bd9Sstevel@tonic-gate 1237c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER): 1247c478bd9Sstevel@tonic-gate $(INS.dir) 1257c478bd9Sstevel@tonic-gate 1267c478bd9Sstevel@tonic-gate$(ROOTLIBPOWER)/%: % 1277c478bd9Sstevel@tonic-gate $(INS.file) 1287c478bd9Sstevel@tonic-gate 1297c478bd9Sstevel@tonic-gate$(ROOTLIBPOWERDAEMON): $(ROOTLIBPOWER) 1307c478bd9Sstevel@tonic-gate 1317c478bd9Sstevel@tonic-gate$(OPOFILES): 1327c478bd9Sstevel@tonic-gate @ 1337c478bd9Sstevel@tonic-gate 1347c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES) $(OPOFILES) 1357c478bd9Sstevel@tonic-gate $(RM) $@ 1367c478bd9Sstevel@tonic-gate cat $(POFILES) $(OPOFILES) > $@ 1377c478bd9Sstevel@tonic-gate 1387c478bd9Sstevel@tonic-gatecheck: $(CHKMANIFEST) 1397c478bd9Sstevel@tonic-gate 1407c478bd9Sstevel@tonic-gateclean: 141*2df1fe9cSrandyf $(RM) $(OBJS) $(SYSIDPM) $(POWERCONF) 1427c478bd9Sstevel@tonic-gate $(RM) $(POFILE) $(POFILES) 1437c478bd9Sstevel@tonic-gate 1447c478bd9Sstevel@tonic-gatelint := LINTFLAGS=-auxn 1457c478bd9Sstevel@tonic-gatelint: 1467c478bd9Sstevel@tonic-gate $(LINT.c) $(DAEMON_SRCS) 1477c478bd9Sstevel@tonic-gate $(LINT.c) $(PMCFG_SRCS) 1487c478bd9Sstevel@tonic-gate 1497c478bd9Sstevel@tonic-gatecstyle: 1507c478bd9Sstevel@tonic-gate $(CSTYLE) $(SRCS) 1517c478bd9Sstevel@tonic-gate 152*2df1fe9cSrandyf%: %.$(MACH) 153*2df1fe9cSrandyf $(RM) $@ 154*2df1fe9cSrandyf cat $< > $@ 155*2df1fe9cSrandyf 1567c478bd9Sstevel@tonic-gateinclude ../Makefile.targ 157