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.
25 # Copyright (c) 2018, Joyent, Inc.
27 DAEMON_SRCS
= powerd.c sysstat.c
28 DAEMON_OBJS
= $(DAEMON_SRCS
:%.c
=%.o
)
30 PMCFG_SRCS
= conf.c parse.c handlers.c
31 PMCFG_OBJS
= $(PMCFG_SRCS
:%.c
=%.o
)
33 SUSPEND_SRCS
= sys-suspend.c pm_pam_conv.c
34 SUSPEND_OBJS
= $(SUSPEND_SRCS
:%.c
=%.o
)
36 SRCS
= $(DAEMON_SRCS
) $(PMCFG_SRCS
) $(SUSPEND_SRCS
)
37 OBJS
= $(SRCS
:%.c
=%.o
)
38 PROG
= $(DAEMON
) $(PMCFG
) $(SUSPEND
)
40 ETCFILES
= $(POWERCONF
)
42 DEFAULTFILES
= power.dfl
47 include ..
/Makefile.cmd
49 ROOTMANIFESTDIR
= $(ROOTSVCSYSTEM
)
51 TEXT_DOMAIN
= SUNW_OST_OSCMD
53 XGETFLAGS
+= -a
-x power_all.xcl
55 POFILES
= $(PMCFG_SRCS
:%.c
=%.po
) $(SUSPEND_SRCS
:%.c
=%.po
)
57 # pmconfig only needs libdevinfo on sparc
58 sparc_LDEVINFO
= -ldevinfo
-lefi
-ladm
-lzfs
-lnvpair
63 DAEMON_LDLIBS
= $(LDLIBS.cmd
) -lkstat
$(LDEVINFO
)
64 PMCFG_LDLIBS
= $(LDLIBS.cmd
) -lsmbios
-lkstat
$($(MACH
)_LDEVINFO
)
65 SUSPEND_LDLIBS
= $(LDLIBS.cmd
) -lpam
-lsecdb
67 ROOTUSRSBINPMCFG
= $(PMCFG
:%=$(ROOTUSRSBIN
)/%)
68 $(ROOTUSRSBINPMCFG
) := FILEMODE
= 4555
69 ROOTUSRBINSUSPEND
= $(SUSPEND
:%=$(ROOTBIN
)/%)
70 $(ROOTUSRBINSUSPEND
) := FILEMODE
= 4555
72 ROOTLIBPOWER
= $(ROOTLIB
)/power
73 ROOTLIBPOWERDAEMON
= $(DAEMON
:%=$(ROOTLIBPOWER
)/%)
74 $(ROOTLIBPOWER
) := FILEMODE
= 755
75 $(ROOTLIBPOWERDAEMON
) := FILEMODE
= 555
77 ROOTETCFILES
= $(ETCFILES
:%=$(ROOTETC
)/%)
78 $(ROOTETCFILES
) := FILEMODE
= 644
86 all: $(PROG
) $(POWERPERM
).dfl
$(ETCFILES
)
90 $(POWERCONF
): $(POWERCONF
).
$(MACH
)
92 $(DAEMON_OBJS
): $(DAEMON_SRCS
)
93 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -o
$@
-c
$<
95 $(DAEMON
): $(DAEMON_OBJS
)
96 $(CC
) -o
$@
$(CFLAGS
) $(DAEMON_OBJS
) $(LDFLAGS
) $(DAEMON_LDLIBS
)
99 $(PMCFG_OBJS
): pmconfig.h
101 $(PMCFG
): $(PMCFG_OBJS
)
102 $(LINK.c
) -o
$@
$(PMCFG_OBJS
) $(PMCFG_LDLIBS
)
105 $(SUSPEND
): $(SUSPEND_OBJS
)
106 $(LINK.c
) -o
$@
$(SUSPEND_OBJS
) $(SUSPEND_LDLIBS
)
109 install: all $(ROOTUSRSBINPMCFG
) $(ROOTLIBPOWERDAEMON
) $(ROOTUSRBINSUSPEND
) \
110 $(ROOTETCFILES
) $(ROOTETCDEFAULTFILES
) \
111 $(ROOTMANIFEST
) $(ROOTSVCMETHOD
)
119 $(ROOTLIBPOWERDAEMON
): $(ROOTLIBPOWER
)
121 $(POFILE
): $(POFILES
)
125 check: $(CHKMANIFEST
)
128 $(RM
) $(OBJS
) $(POWERCONF
)
129 $(RM
) $(POFILE
) $(POFILES
)
138 include ..
/Makefile.targ