Makefile revision 9ba7e32f37631a29f011e29a926eab05899802ca
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# CDDL HEADER START
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# The contents of this file are subject to the terms of the
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# Common Development and Distribution License (the "License").
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# You may not use this file except in compliance with the License.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# or http://www.opensolaris.org/os/licensing.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# See the License for the specific language governing permissions
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# and limitations under the License.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# When distributing Covered Code, include this CDDL HEADER in each
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# If applicable, add the following below this CDDL HEADER, with the
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# fields enclosed by brackets "[]" replaced with your own identifying
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# information: Portions Copyright [yyyy] [name of copyright owner]
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# CDDL HEADER END
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# Use is subject to license terms.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#pragma ident "%Z%%M% %I% %E% SMI"
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# cmd/sa/Makefile
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesMANIFEST = sar.xml
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSVCMETHOD = svc-sar
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
5c0419d51818eb02045cf923a9fe456127a44c60wroweinclude ../Makefile.cmd
5c0419d51818eb02045cf923a9fe456127a44c60wrowe
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesGREP= grep
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSADC= sadc
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSADP= sadp
d266c3777146d36a4c23c17aad6f153aebea1bf4jortonSAR= sar
d266c3777146d36a4c23c17aad6f153aebea1bf4jortonTIMEX= timex
d266c3777146d36a4c23c17aad6f153aebea1bf4jortonSAG= sag
d266c3777146d36a4c23c17aad6f153aebea1bf4jortonSA1= sa1
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSA2= sa2
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholessadc := LDLIBS += -lkstat
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# Executables produced
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesBINPROG= $(TIMEX)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSBINPROG= $(SAR) $(SAG)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesLIBPROG= $(SADC)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesLIBSHELL= $(SA1) $(SA2)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesINITSHELL= $(PERF)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesPROGS= $(BINPROG) $(SBINPROG) $(LIBPROG)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSHELLS= $(LIBSHELL)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesTXTS= $(SADP).c README
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesALL= $(PROGS) $(SHELLS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# Source files
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSAG_OBJECTS= $(SAG)a.o $(SAG)b.o
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSADC_OBJECTS= $(SADC).o
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholessrcs= $(TIMEX) $(SAR) $(SADC)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSRCS= $(srcs:%=%.c) $(SAG_OBJECTS:%.o=%.c)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSHSRCS= $(SHELLS:%=%.sh)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# Set of target install directories
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesLIBSAD= $(ROOT)/usr/lib/sa
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesCROND= $(ROOT)/var/spool/cron
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesCRONTABSD= $(CROND)/crontabs
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# Set of target install files
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSYSCRONTAB= $(CRONTABSD)/sys
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesROOTPROG= $(BINPROG:%=$(ROOTBIN)/%)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesROOTUSBINPROG= $(SBINPROG:%=$(ROOTUSRSBIN)/%)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesROOTLIBPROG= $(LIBPROG:%=$(LIBSAD)/%)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesROOTLIBSHELL= $(LIBSHELL:%=$(LIBSAD)/%)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesROOTSYMLINKS= $(SBINPROG:%=$(ROOTBIN)/%)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# Performance monitoring should not be enabled by default. Hence, these
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# entries are comments. Note the difficulty of inserting a literal #
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# in a makefile.... Wonderful parser here....
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesCOMMENT_CHAR:sh= echo \\043
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesENTRY1= '$(COMMENT_CHAR) 0 * * * 0-6 /usr/lib/sa/sa1'
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesENTRY2= '$(COMMENT_CHAR) 20,40 8-17 * * 1-5 /usr/lib/sa/sa1'
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesENTRY3= '$(COMMENT_CHAR) 5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A'
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesCLOBBERFILES= $(PROGS) $(SHELLS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# Conditionals
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes$(SYSCRONTAB) := OWNER = root
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes$(SYSCRONTAB) := GROUP = sys
f8fc4173f3b9715e5945b668ba511b77573dc1d1minfrin$(ROOTBIN)/$(TIMEX) := GROUP = sys
f8fc4173f3b9715e5945b668ba511b77573dc1d1minfrin# $(ROOTUSRSBIN)/$(SADP) := FILEMODE = 2555
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# $(ROOTUSRSBIN)/$(SADP) := GROUP = sys
f8fc4173f3b9715e5945b668ba511b77573dc1d1minfrin$(LIBSAD)/$(SADC) := FILEMODE = 0555
f8fc4173f3b9715e5945b668ba511b77573dc1d1minfrin$(LIBSAD)/$(SADC) := GROUP = bin
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes.KEEP_STATE:
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesall: $(ALL) $(TXTS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes$(SAG): $(SAG_OBJECTS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(LINK.c) -o $@ $(SAG_OBJECTS) $(LDLIBS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(POST_PROCESS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes$(SADC): $(SADC_OBJECTS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(LINK.c) -o $@ $(SADC_OBJECTS) $(LDLIBS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(POST_PROCESS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# The edit of SYSCRONTAB must be done unconditionally because of the
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# creation of this file by a different component (Adm) and the possible
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# backdating.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesinstall: all $(ROOTPROG) $(ROOTUSBINPROG) \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(ROOTINITSHELL) $(ROOTLIBSHELL) $(ROOTSYMLINKS) \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(ROOTMANIFEST) $(ROOTSVCMETHOD) $(ROOTLIBPROG)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes @if [ -f $(SYSCRONTAB) ]; \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes then \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes if $(GREP) "sa1" $(SYSCRONTAB) >/dev/null 2>&1 ; then :; \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes else \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes echo $(ENTRY1) >> $(SYSCRONTAB); \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes echo $(ENTRY2) >> $(SYSCRONTAB); \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes echo "$(SYSCRONTAB) modified"; \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes fi; \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes if $(GREP) "sa2" $(SYSCRONTAB) >/dev/null 2>&1 ; then :; \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes else \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes echo $(ENTRY3) >> $(SYSCRONTAB); \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes fi; \
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes fi
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes$(LIBSAD)/%: %
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(INS.file)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes$(ROOTSYMLINKS):
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes -$(RM) $@; $(SYMLINK) ../sbin/`basename $@` $@
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes$(ETCINITD)/%: %
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(INS.file)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholescheck: $(CHKMANIFEST)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesclean:
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(RM) $(SAG_OBJECTS) $(SADC_OBJECTS) $(PROGS) $(SHELLS) $(SADP)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholeslint: lint_SRCS
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesinclude ../Makefile.targ
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes