author | gw25295 |
Fri, 11 Apr 2008 18:36:28 -0700 | |
changeset 6423 | 437422a29d3a |
parent 5295 | a21f2449e5f9 |
child 8940 | d34ffaa3529c |
permissions | -rw-r--r-- |
0 | 1 |
# |
2 |
# CDDL HEADER START |
|
3 |
# |
|
4 |
# The contents of this file are subject to the terms of the |
|
2923 | 5 |
# Common Development and Distribution License (the "License"). |
6 |
# You may not use this file except in compliance with the License. |
|
0 | 7 |
# |
8 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
# or http://www.opensolaris.org/os/licensing. |
|
10 |
# See the License for the specific language governing permissions |
|
11 |
# and limitations under the License. |
|
12 |
# |
|
13 |
# When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
# If applicable, add the following below this CDDL HEADER, with the |
|
16 |
# fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
# |
|
19 |
# CDDL HEADER END |
|
20 |
# |
|
21 |
# |
|
6423 | 22 |
# Copyright 2008 Sun Microsystems, Inc. All rights reserved. |
0 | 23 |
# Use is subject to license terms. |
24 |
# |
|
25 |
# ident "%Z%%M% %I% %E% SMI" |
|
26 |
# |
|
27 |
# cmd/power/Makefile |
|
28 |
# |
|
29 |
||
30 |
DAEMON_SRCS = powerd.c sysstat.c |
|
31 |
DAEMON_OBJS = $(DAEMON_SRCS:%.c=%.o) |
|
32 |
DAEMON = powerd |
|
33 |
PMCFG_SRCS = conf.c parse.c handlers.c |
|
34 |
PMCFG_OBJS = $(PMCFG_SRCS:%.c=%.o) |
|
35 |
PMCFG = pmconfig |
|
36 |
SRCS = $(DAEMON_SRCS) $(PMCFG_SRCS) |
|
37 |
OBJS = $(SRCS:%.c=%.o) |
|
38 |
SCRIPTS = sysidpm.sh |
|
39 |
SYSIDPM = sysidpm |
|
40 |
PROG = $(DAEMON) $(PMCFG) $(SYSIDPM) |
|
5295 | 41 |
POWERCONF= power.conf |
42 |
ETCFILES = $(POWERCONF) |
|
0 | 43 |
POWERPERM = power |
89
ba4d0152c0bd
4533144 ON needs a single set of rules for installing default files
meem
parents:
0
diff
changeset
|
44 |
DEFAULTFILES = power.dfl |
0 | 45 |
|
3048 | 46 |
MANIFEST= power.xml |
47 |
SVCMETHOD= svc-power |
|
48 |
||
0 | 49 |
include ../Makefile.cmd |
50 |
||
51 |
ROOTMANIFESTDIR = $(ROOTSVCSYSTEM) |
|
52 |
||
53 |
TEXT_DOMAIN= SUNW_OST_OSCMD |
|
54 |
||
763
83a9a006a448
6332731 pmconfig .po files are missing a lot of strings
mh27603
parents:
89
diff
changeset
|
55 |
XGETFLAGS += -a -x power_all.xcl |
0 | 56 |
POFILE= power_all.po |
57 |
POFILES= $(PMCFG_SRCS:%.c=%.po) |
|
58 |
# needed because POFILES is deleted by clobber, but it's under |
|
59 |
# SCCS control here. |
|
60 |
OPOFILES= sysidpm.po |
|
61 |
||
5295 | 62 |
# pmconfig only needs libdevinfo on sparc |
6423 | 63 |
sparc_LDEVINFO= -ldevinfo -lefi -ladm -lzfs -lnvpair |
0 | 64 |
i386_LDEVINFO= |
65 |
||
5295 | 66 |
LDEVINFO= -ldevinfo |
67 |
||
68 |
DAEMON_LDLIBS = $(LDLIBS.cmd) -lkstat $(LDEVINFO) |
|
69 |
PMCFG_LDLIBS = $(LDLIBS.cmd) -lcmd -lsmbios -lkstat $($(MACH)_LDEVINFO) |
|
0 | 70 |
|
71 |
OWNER= root |
|
72 |
ROOTUSRSBINPMCFG= $(PMCFG:%=$(ROOTUSRSBIN)/%) |
|
73 |
$(ROOTUSRSBINPMCFG) := GROUP= bin |
|
74 |
$(ROOTUSRSBINPMCFG) := FILEMODE= 4555 |
|
75 |
||
76 |
GROUP= sys |
|
77 |
ROOTLIBPOWER= $(ROOTLIB)/power |
|
78 |
ROOTLIBPOWERDAEMON= $(DAEMON:%=$(ROOTLIBPOWER)/%) |
|
79 |
$(ROOTLIBPOWER) := GROUP= sys |
|
80 |
$(ROOTLIBPOWER) := FILEMODE= 755 |
|
81 |
$(ROOTLIBPOWERDAEMON) := GROUP= bin |
|
82 |
$(ROOTLIBPOWERDAEMON) := FILEMODE= 555 |
|
83 |
||
89
ba4d0152c0bd
4533144 ON needs a single set of rules for installing default files
meem
parents:
0
diff
changeset
|
84 |
ROOTETCFILES= $(ETCFILES:%=$(ROOTETC)/%) |
ba4d0152c0bd
4533144 ON needs a single set of rules for installing default files
meem
parents:
0
diff
changeset
|
85 |
$(ROOTETCFILES) := FILEMODE= 644 |
0 | 86 |
|
87 |
ROOTUSRSBINSYSIDPM= $(SYSIDPM:%=$(ROOTUSRSBIN)/%) |
|
88 |
$(ROOTUSRSBINSYSIDPM) := FILEMODE= 755 |
|
89 |
||
90 |
# |
|
91 |
# lint pass one enforcement |
|
92 |
# |
|
93 |
CFLAGS += $(CCVERBOSE) |
|
94 |
||
95 |
.PARALLEL: $(OBJS) |
|
96 |
||
97 |
.KEEP_STATE: |
|
98 |
||
99 |
all: $(PROG) $(POWERPERM).dfl $(ETCFILES) $(SCRIPTS) |
|
100 |
||
101 |
install clean: |
|
102 |
||
5295 | 103 |
$(POWERCONF): $(POWERCONF).$(MACH) |
104 |
||
0 | 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 |
||
119 |
install: all $(ROOTUSRSBINPMCFG) $(ROOTLIBPOWERDAEMON) \ |
|
89
ba4d0152c0bd
4533144 ON needs a single set of rules for installing default files
meem
parents:
0
diff
changeset
|
120 |
$(ROOTETCFILES) $(ROOTUSRSBINSYSIDPM) $(ROOTETCDEFAULTFILES) \ |
3048 | 121 |
$(ROOTMANIFEST) $(ROOTSVCMETHOD) |
0 | 122 |
|
123 |
$(ROOTLIBPOWER): |
|
124 |
$(INS.dir) |
|
125 |
||
126 |
$(ROOTLIBPOWER)/%: % |
|
127 |
$(INS.file) |
|
128 |
||
129 |
$(ROOTLIBPOWERDAEMON): $(ROOTLIBPOWER) |
|
130 |
||
131 |
$(OPOFILES): |
|
132 |
@ |
|
133 |
||
134 |
$(POFILE): $(POFILES) $(OPOFILES) |
|
135 |
$(RM) $@ |
|
136 |
cat $(POFILES) $(OPOFILES) > $@ |
|
137 |
||
138 |
check: $(CHKMANIFEST) |
|
139 |
||
140 |
clean: |
|
5295 | 141 |
$(RM) $(OBJS) $(SYSIDPM) $(POWERCONF) |
0 | 142 |
$(RM) $(POFILE) $(POFILES) |
143 |
||
144 |
lint := LINTFLAGS=-auxn |
|
145 |
lint: |
|
146 |
$(LINT.c) $(DAEMON_SRCS) |
|
147 |
$(LINT.c) $(PMCFG_SRCS) |
|
148 |
||
149 |
cstyle: |
|
150 |
$(CSTYLE) $(SRCS) |
|
151 |
||
5295 | 152 |
%: %.$(MACH) |
153 |
$(RM) $@ |
|
154 |
cat $< > $@ |
|
155 |
||
0 | 156 |
include ../Makefile.targ |