8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / power / Makefile
blob39346055888ea5fe8203a18f71fd204ea6ab95c5
2 # CDDL HEADER START
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]
19 # CDDL HEADER END
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # cmd/power/Makefile
28 DAEMON_SRCS = powerd.c sysstat.c
29 DAEMON_OBJS = $(DAEMON_SRCS:%.c=%.o)
30 DAEMON = powerd
31 PMCFG_SRCS = conf.c parse.c handlers.c
32 PMCFG_OBJS = $(PMCFG_SRCS:%.c=%.o)
33 PMCFG = pmconfig
34 SUSPEND_SRCS = sys-suspend.c pm_pam_conv.c
35 SUSPEND_OBJS = $(SUSPEND_SRCS:%.c=%.o)
36 SUSPEND = sys-suspend
37 SRCS = $(DAEMON_SRCS) $(PMCFG_SRCS) $(SUSPEND_SRCS)
38 OBJS = $(SRCS:%.c=%.o)
39 PROG = $(DAEMON) $(PMCFG) $(SUSPEND)
40 POWERCONF= power.conf
41 ETCFILES = $(POWERCONF)
42 POWERPERM = power
43 DEFAULTFILES = power.dfl
45 MANIFEST= power.xml
46 SVCMETHOD= svc-power
48 include ../Makefile.cmd
50 ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
52 TEXT_DOMAIN= SUNW_OST_OSCMD
54 XGETFLAGS += -a -x power_all.xcl
55 POFILE= power_all.po
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
60 i386_LDEVINFO=
62 LDEVINFO= -ldevinfo
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)
86 .PARALLEL: $(OBJS)
88 .KEEP_STATE:
90 all: $(PROG) $(POWERPERM).dfl $(ETCFILES)
92 install clean:
94 $(POWERCONF): $(POWERCONF).$(MACH)
96 $(DAEMON_OBJS): $(DAEMON_SRCS)
97 $(CC) $(CFLAGS) -D_REENTRANT $(CPPFLAGS) -o $@ -c $<
98 $(PROCESS_COMMENT) $@
100 $(DAEMON): $(DAEMON_OBJS)
101 $(CC) -o $@ $(DAEMON_OBJS) $(LDFLAGS) $(DAEMON_LDLIBS)
102 $(POST_PROCESS)
104 $(PMCFG_OBJS): pmconfig.h
106 $(PMCFG): $(PMCFG_OBJS)
107 $(LINK.c) -o $@ $(PMCFG_OBJS) $(PMCFG_LDLIBS)
108 $(POST_PROCESS)
110 $(SUSPEND): $(SUSPEND_OBJS)
111 $(LINK.c) -o $@ $(SUSPEND_OBJS) $(SUSPEND_LDLIBS)
112 $(POST_PROCESS)
114 install: all $(ROOTUSRSBINPMCFG) $(ROOTLIBPOWERDAEMON) $(ROOTUSRBINSUSPEND) \
115 $(ROOTETCFILES) $(ROOTETCDEFAULTFILES) \
116 $(ROOTMANIFEST) $(ROOTSVCMETHOD)
118 $(ROOTLIBPOWER):
119 $(INS.dir)
121 $(ROOTLIBPOWER)/%: %
122 $(INS.file)
124 $(ROOTLIBPOWERDAEMON): $(ROOTLIBPOWER)
126 $(POFILE): $(POFILES)
127 $(RM) $@
128 cat $(POFILES) > $@
130 check: $(CHKMANIFEST)
132 clean:
133 $(RM) $(OBJS) $(POWERCONF)
134 $(RM) $(POFILE) $(POFILES)
136 lint := LINTFLAGS=-auxn
137 lint:
138 $(LINT.c) $(DAEMON_SRCS)
139 $(LINT.c) $(PMCFG_SRCS)
140 $(LINT.c) $(SUSPEND_SRCS)
142 cstyle:
143 $(CSTYLE) $(SRCS)
145 %: %.$(MACH)
146 $(RM) $@
147 cat $< > $@
149 include ../Makefile.targ