0
|
1 |
#
|
|
2 |
# CDDL HEADER START
|
|
3 |
#
|
|
4 |
# The contents of this file are subject to the terms of the
|
|
5 |
# Common Development and Distribution License, Version 1.0 only
|
|
6 |
# (the "License"). You may not use this file except in compliance
|
|
7 |
# with the License.
|
|
8 |
#
|
|
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
10 |
# or http://www.opensolaris.org/os/licensing.
|
|
11 |
# See the License for the specific language governing permissions
|
|
12 |
# and limitations under the License.
|
|
13 |
#
|
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each
|
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
16 |
# If applicable, add the following below this CDDL HEADER, with the
|
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying
|
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner]
|
|
19 |
#
|
|
20 |
# CDDL HEADER END
|
|
21 |
#
|
|
22 |
#
|
|
23 |
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
|
|
24 |
# Use is subject to license terms.
|
|
25 |
#
|
|
26 |
# ident "%Z%%M% %I% %E% SMI"
|
|
27 |
#
|
|
28 |
# cmd/power/Makefile
|
|
29 |
#
|
|
30 |
#
|
|
31 |
|
|
32 |
DAEMON_SRCS = powerd.c sysstat.c
|
|
33 |
DAEMON_OBJS = $(DAEMON_SRCS:%.c=%.o)
|
|
34 |
DAEMON = powerd
|
|
35 |
PMCFG_SRCS = conf.c parse.c handlers.c
|
|
36 |
PMCFG_OBJS = $(PMCFG_SRCS:%.c=%.o)
|
|
37 |
PMCFG = pmconfig
|
|
38 |
SRCS = $(DAEMON_SRCS) $(PMCFG_SRCS)
|
|
39 |
OBJS = $(SRCS:%.c=%.o)
|
|
40 |
SCRIPTS = sysidpm.sh
|
|
41 |
SYSIDPM = sysidpm
|
|
42 |
PROG = $(DAEMON) $(PMCFG) $(SYSIDPM)
|
|
43 |
ETCFILES = power.conf
|
|
44 |
POWERPERM = power
|
|
45 |
|
|
46 |
include ../Makefile.cmd
|
|
47 |
|
|
48 |
MANIFEST = power.xml
|
|
49 |
|
|
50 |
ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
|
|
51 |
ROOTMETHOD = $(ROOTLIBSVCMETHOD)/svc-power
|
|
52 |
|
|
53 |
TEXT_DOMAIN= SUNW_OST_OSCMD
|
|
54 |
|
|
55 |
POFILE= power_all.po
|
|
56 |
POFILES= $(PMCFG_SRCS:%.c=%.po)
|
|
57 |
# needed because POFILES is deleted by clobber, but it's under
|
|
58 |
# SCCS control here.
|
|
59 |
OPOFILES= sysidpm.po
|
|
60 |
|
|
61 |
#
|
|
62 |
# we only need libdevinfo on sparc
|
|
63 |
sparc_LDEVINFO= -ldevinfo
|
|
64 |
i386_LDEVINFO=
|
|
65 |
|
|
66 |
DAEMON_LDLIBS = $(LDLIBS.cmd) -lkstat $($(MACH)_LDEVINFO)
|
|
67 |
PMCFG_LDLIBS = $(LDLIBS.cmd) -lcmd $($(MACH)_LDEVINFO)
|
|
68 |
|
|
69 |
OWNER= root
|
|
70 |
ROOTUSRSBINPMCFG= $(PMCFG:%=$(ROOTUSRSBIN)/%)
|
|
71 |
$(ROOTUSRSBINPMCFG) := GROUP= bin
|
|
72 |
$(ROOTUSRSBINPMCFG) := FILEMODE= 4555
|
|
73 |
|
|
74 |
GROUP= sys
|
|
75 |
ROOTLIBPOWER= $(ROOTLIB)/power
|
|
76 |
ROOTLIBPOWERDAEMON= $(DAEMON:%=$(ROOTLIBPOWER)/%)
|
|
77 |
$(ROOTLIBPOWER) := GROUP= sys
|
|
78 |
$(ROOTLIBPOWER) := FILEMODE= 755
|
|
79 |
$(ROOTLIBPOWERDAEMON) := GROUP= bin
|
|
80 |
$(ROOTLIBPOWERDAEMON) := FILEMODE= 555
|
|
81 |
|
|
82 |
ROOTETCFILES= $(ETCFILES:%=$(ROOTETC)/%)
|
|
83 |
$(ROOTETCFILES) := FILEMODE= 644
|
|
84 |
|
|
85 |
DFLTD= $(ROOTETC)/default
|
|
86 |
ROOTDFLFILES= $(POWERPERM:%=$(DFLTD)/%)
|
|
87 |
$(ROOTDFLFILES) := FILEMODE= 444
|
|
88 |
|
|
89 |
ROOTUSRSBINSYSIDPM= $(SYSIDPM:%=$(ROOTUSRSBIN)/%)
|
|
90 |
$(ROOTUSRSBINSYSIDPM) := FILEMODE= 755
|
|
91 |
|
|
92 |
#
|
|
93 |
# lint pass one enforcement
|
|
94 |
#
|
|
95 |
CFLAGS += $(CCVERBOSE)
|
|
96 |
|
|
97 |
.PARALLEL: $(OBJS)
|
|
98 |
|
|
99 |
.KEEP_STATE:
|
|
100 |
|
|
101 |
all: $(PROG) $(POWERPERM).dfl $(ETCFILES) $(SCRIPTS)
|
|
102 |
|
|
103 |
install clean:
|
|
104 |
|
|
105 |
$(DAEMON_OBJS): $(DAEMON_SRCS)
|
|
106 |
$(CC) $(CFLAGS) -D_REENTRANT $(CPPFLAGS) -o $@ -c $<
|
|
107 |
$(PROCESS_COMMENT) $@
|
|
108 |
|
|
109 |
$(DAEMON): $(DAEMON_OBJS)
|
|
110 |
$(CC) -o $@ $(DAEMON_OBJS) $(LDFLAGS) $(DAEMON_LDLIBS)
|
|
111 |
$(POST_PROCESS)
|
|
112 |
|
|
113 |
$(PMCFG_OBJS): pmconfig.h
|
|
114 |
|
|
115 |
$(PMCFG): $(PMCFG_OBJS)
|
|
116 |
$(LINK.c) -o $@ $(PMCFG_OBJS) $(PMCFG_LDLIBS)
|
|
117 |
$(POST_PROCESS)
|
|
118 |
$(ROOTSVCSYSTEM)/power.xml := OWNER = root
|
|
119 |
$(ROOTSVCSYSTEM)/power.xml := GROUP = sys
|
|
120 |
$(ROOTSVCSYSTEM)/power.xml := FILEMODE = 0444
|
|
121 |
|
|
122 |
$(ROOTLIBSVCMETHOD)/svc-power := OWNER = root
|
|
123 |
$(ROOTLIBSVCMETHOD)/svc-power := GROUP = bin
|
|
124 |
$(ROOTLIBSVCMETHOD)/svc-power := FILEMODE = 0555
|
|
125 |
|
|
126 |
install: all $(ROOTUSRSBINPMCFG) $(ROOTLIBPOWERDAEMON) \
|
|
127 |
$(ROOTETCFILES) $(ROOTUSRSBINSYSIDPM) $(ROOTDFLFILES) \
|
|
128 |
$(ROOTMANIFEST) $(ROOTMETHOD)
|
|
129 |
|
|
130 |
$(DFLTD)/%: %.dfl
|
|
131 |
$(INS.rename)
|
|
132 |
|
|
133 |
$(ROOTLIBPOWER):
|
|
134 |
$(INS.dir)
|
|
135 |
|
|
136 |
$(ROOTLIBPOWER)/%: %
|
|
137 |
$(INS.file)
|
|
138 |
|
|
139 |
$(ROOTLIBPOWERDAEMON): $(ROOTLIBPOWER)
|
|
140 |
|
|
141 |
$(OPOFILES):
|
|
142 |
@
|
|
143 |
|
|
144 |
$(POFILE): $(POFILES) $(OPOFILES)
|
|
145 |
$(RM) $@
|
|
146 |
cat $(POFILES) $(OPOFILES) > $@
|
|
147 |
|
|
148 |
check: $(CHKMANIFEST)
|
|
149 |
|
|
150 |
clean:
|
|
151 |
$(RM) $(OBJS) $(SYSIDPM)
|
|
152 |
$(RM) $(POFILE) $(POFILES)
|
|
153 |
|
|
154 |
lint := LINTFLAGS=-auxn
|
|
155 |
lint:
|
|
156 |
$(LINT.c) $(DAEMON_SRCS)
|
|
157 |
$(LINT.c) $(PMCFG_SRCS)
|
|
158 |
|
|
159 |
cstyle:
|
|
160 |
$(CSTYLE) $(SRCS)
|
|
161 |
|
|
162 |
include ../Makefile.targ
|