Makefile revision 5009f7885e2c6a7e13fe9ad876bd812add4754ef
0N/A#
553N/A# CDDL HEADER START
0N/A#
0N/A# The contents of this file are subject to the terms of the
0N/A# Common Development and Distribution License (the "License").
0N/A# You may not use this file except in compliance with the License.
0N/A#
0N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0N/A# or http://www.opensolaris.org/os/licensing.
0N/A# See the License for the specific language governing permissions
0N/A# and limitations under the License.
0N/A#
0N/A# When distributing Covered Code, include this CDDL HEADER in each
0N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A# If applicable, add the following below this CDDL HEADER, with the
0N/A# fields enclosed by brackets "[]" replaced with your own identifying
0N/A# information: Portions Copyright [yyyy] [name of copyright owner]
0N/A#
553N/A# CDDL HEADER END
553N/A#
553N/A#
0N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
0N/A# Use is subject to license terms.
0N/A#
0N/A# cmd/power/Makefile
0N/A#
0N/A
0N/ADAEMON_SRCS = powerd.c sysstat.c
0N/ADAEMON_OBJS = $(DAEMON_SRCS:%.c=%.o)
288N/ADAEMON = powerd
0N/APMCFG_SRCS = conf.c parse.c handlers.c
0N/APMCFG_OBJS = $(PMCFG_SRCS:%.c=%.o)
0N/APMCFG = pmconfig
0N/ASUSPEND_SRCS = sys-suspend.c pm_pam_conv.c
0N/ASUSPEND_OBJS = $(SUSPEND_SRCS:%.c=%.o)
0N/ASUSPEND = sys-suspend
0N/ASRCS = $(DAEMON_SRCS) $(PMCFG_SRCS) $(SUSPEND_SRCS)
0N/AOBJS = $(SRCS:%.c=%.o)
0N/ASCRIPTS = sysidpm.sh
0N/ASYSIDPM = sysidpm
0N/APROG = $(DAEMON) $(PMCFG) $(SYSIDPM) $(SUSPEND)
0N/APOWERCONF= power.conf
0N/AETCFILES = $(POWERCONF)
0N/APOWERPERM = power
0N/ADEFAULTFILES = power.dfl
0N/A
MANIFEST= power.xml
SVCMETHOD= svc-power
include ../Makefile.cmd
ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
TEXT_DOMAIN= SUNW_OST_OSCMD
XGETFLAGS += -a -x power_all.xcl
POFILE= power_all.po
POFILES= $(PMCFG_SRCS:%.c=%.po) $(SUSPEND_SRCS:%.c=%.po)
# needed because POFILES is deleted by clobber, but it's under
# SCCS control here.
OPOFILES= sysidpm.po
# pmconfig only needs libdevinfo on sparc
sparc_LDEVINFO= -ldevinfo -lefi -ladm -lzfs -lnvpair
i386_LDEVINFO=
LDEVINFO= -ldevinfo
DAEMON_LDLIBS = $(LDLIBS.cmd) -lkstat $(LDEVINFO)
PMCFG_LDLIBS = $(LDLIBS.cmd) -lsmbios -lkstat $($(MACH)_LDEVINFO)
SUSPEND_LDLIBS = $(LDLIBS.cmd) -lbsm -lpam -lsecdb
ROOTUSRSBINPMCFG= $(PMCFG:%=$(ROOTUSRSBIN)/%)
$(ROOTUSRSBINPMCFG) := FILEMODE= 4555
ROOTUSRBINSUSPEND= $(SUSPEND:%=$(ROOTBIN)/%)
$(ROOTUSRBINSUSPEND) := FILEMODE= 4555
ROOTLIBPOWER= $(ROOTLIB)/power
ROOTLIBPOWERDAEMON= $(DAEMON:%=$(ROOTLIBPOWER)/%)
$(ROOTLIBPOWER) := FILEMODE= 755
$(ROOTLIBPOWERDAEMON) := FILEMODE= 555
ROOTETCFILES= $(ETCFILES:%=$(ROOTETC)/%)
$(ROOTETCFILES) := FILEMODE= 644
ROOTUSRSBINSYSIDPM= $(SYSIDPM:%=$(ROOTUSRSBIN)/%)
$(ROOTUSRSBINSYSIDPM) := FILEMODE= 755
#
# lint pass one enforcement
#
CFLAGS += $(CCVERBOSE)
.PARALLEL: $(OBJS)
.KEEP_STATE:
all: $(PROG) $(POWERPERM).dfl $(ETCFILES) $(SCRIPTS)
install clean:
$(POWERCONF): $(POWERCONF).$(MACH)
$(DAEMON_OBJS): $(DAEMON_SRCS)
$(CC) $(CFLAGS) -D_REENTRANT $(CPPFLAGS) -o $@ -c $<
$(PROCESS_COMMENT) $@
$(DAEMON): $(DAEMON_OBJS)
$(CC) -o $@ $(DAEMON_OBJS) $(LDFLAGS) $(DAEMON_LDLIBS)
$(POST_PROCESS)
$(PMCFG_OBJS): pmconfig.h
$(PMCFG): $(PMCFG_OBJS)
$(LINK.c) -o $@ $(PMCFG_OBJS) $(PMCFG_LDLIBS)
$(POST_PROCESS)
$(SUSPEND): $(SUSPEND_OBJS)
$(LINK.c) -o $@ $(SUSPEND_OBJS) $(SUSPEND_LDLIBS)
$(POST_PROCESS)
install: all $(ROOTUSRSBINPMCFG) $(ROOTLIBPOWERDAEMON) $(ROOTUSRBINSUSPEND) \
$(ROOTETCFILES) $(ROOTUSRSBINSYSIDPM) $(ROOTETCDEFAULTFILES) \
$(ROOTMANIFEST) $(ROOTSVCMETHOD)
$(ROOTLIBPOWER):
$(INS.dir)
$(ROOTLIBPOWER)/%: %
$(INS.file)
$(ROOTLIBPOWERDAEMON): $(ROOTLIBPOWER)
$(OPOFILES):
@
$(POFILE): $(POFILES) $(OPOFILES)
$(RM) $@
cat $(POFILES) $(OPOFILES) > $@
check: $(CHKMANIFEST)
clean:
$(RM) $(OBJS) $(SYSIDPM) $(POWERCONF)
$(RM) $(POFILE) $(POFILES)
lint := LINTFLAGS=-auxn
lint:
$(LINT.c) $(DAEMON_SRCS)
$(LINT.c) $(PMCFG_SRCS)
$(LINT.c) $(SUSPEND_SRCS)
cstyle:
$(CSTYLE) $(SRCS)
%: %.$(MACH)
$(RM) $@
cat $< > $@
include ../Makefile.targ