4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
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.
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]
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
28 DAEMON_SRCS
= powerd.c sysstat.c
29 DAEMON_OBJS
= $(DAEMON_SRCS
:%.c
=%.o
)
31 PMCFG_SRCS
= conf.c parse.c handlers.c
32 PMCFG_OBJS
= $(PMCFG_SRCS
:%.c
=%.o
)
34 SUSPEND_SRCS
= sys-suspend.c pm_pam_conv.c
35 SUSPEND_OBJS
= $(SUSPEND_SRCS
:%.c
=%.o
)
37 SRCS
= $(DAEMON_SRCS
) $(PMCFG_SRCS
) $(SUSPEND_SRCS
)
38 OBJS
= $(SRCS
:%.c
=%.o
)
39 PROG
= $(DAEMON
) $(PMCFG
) $(SUSPEND
)
41 ETCFILES
= $(POWERCONF
)
43 DEFAULTFILES
= power.dfl
48 include ..
/Makefile.cmd
50 ROOTMANIFESTDIR
= $(ROOTSVCSYSTEM
)
52 TEXT_DOMAIN
= SUNW_OST_OSCMD
54 XGETFLAGS
+= -a
-x power_all.xcl
56 POFILES
= $(PMCFG_SRCS
:%.c
=%.po
) $(SUSPEND_SRCS
:%.c
=%.po
)
58 # pmconfig only needs libdevinfo on sparc
59 sparc_LDEVINFO
= -ldevinfo
-lefi
-ladm
-lzfs
-lnvpair
64 DAEMON_LDLIBS
= $(LDLIBS.cmd
) -lkstat
$(LDEVINFO
)
65 PMCFG_LDLIBS
= $(LDLIBS.cmd
) -lsmbios
-lkstat
$($(MACH
)_LDEVINFO
)
66 SUSPEND_LDLIBS
= $(LDLIBS.cmd
) -lbsm
-lpam
-lsecdb
68 ROOTUSRSBINPMCFG
= $(PMCFG
:%=$(ROOTUSRSBIN
)/%)
69 $(ROOTUSRSBINPMCFG
) := FILEMODE
= 4555
70 ROOTUSRBINSUSPEND
= $(SUSPEND
:%=$(ROOTBIN
)/%)
71 $(ROOTUSRBINSUSPEND
) := FILEMODE
= 4555
73 ROOTLIBPOWER
= $(ROOTLIB
)/power
74 ROOTLIBPOWERDAEMON
= $(DAEMON
:%=$(ROOTLIBPOWER
)/%)
75 $(ROOTLIBPOWER
) := FILEMODE
= 755
76 $(ROOTLIBPOWERDAEMON
) := FILEMODE
= 555
78 ROOTETCFILES
= $(ETCFILES
:%=$(ROOTETC
)/%)
79 $(ROOTETCFILES
) := FILEMODE
= 644
82 # lint pass one enforcement
84 CFLAGS
+= $(CCVERBOSE
)
90 all: $(PROG
) $(POWERPERM
).dfl
$(ETCFILES
)
94 $(POWERCONF
): $(POWERCONF
).
$(MACH
)
96 $(DAEMON_OBJS
): $(DAEMON_SRCS
)
97 $(CC
) $(CFLAGS
) -D_REENTRANT
$(CPPFLAGS
) -o
$@
-c
$<
100 $(DAEMON
): $(DAEMON_OBJS
)
101 $(CC
) -o
$@
$(DAEMON_OBJS
) $(LDFLAGS
) $(DAEMON_LDLIBS
)
104 $(PMCFG_OBJS
): pmconfig.h
106 $(PMCFG
): $(PMCFG_OBJS
)
107 $(LINK.c
) -o
$@
$(PMCFG_OBJS
) $(PMCFG_LDLIBS
)
110 $(SUSPEND
): $(SUSPEND_OBJS
)
111 $(LINK.c
) -o
$@
$(SUSPEND_OBJS
) $(SUSPEND_LDLIBS
)
114 install: all $(ROOTUSRSBINPMCFG
) $(ROOTLIBPOWERDAEMON
) $(ROOTUSRBINSUSPEND
) \
115 $(ROOTETCFILES
) $(ROOTETCDEFAULTFILES
) \
116 $(ROOTMANIFEST
) $(ROOTSVCMETHOD
)
124 $(ROOTLIBPOWERDAEMON
): $(ROOTLIBPOWER
)
126 $(POFILE
): $(POFILES
)
130 check: $(CHKMANIFEST
)
133 $(RM
) $(OBJS
) $(POWERCONF
)
134 $(RM
) $(POFILE
) $(POFILES
)
136 lint
:= LINTFLAGS
=-auxn
138 $(LINT.c
) $(DAEMON_SRCS
)
139 $(LINT.c
) $(PMCFG_SRCS
)
140 $(LINT.c
) $(SUSPEND_SRCS
)
149 include ..
/Makefile.targ