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.
24 # Copyright (c) 2013 Andrew Stormont. All rights reserved.
32 include ..
/Makefile.cmd
34 ROOTMANIFESTDIR
= $(ROOTSVCSYSTEM
)
36 CERRWARN
+= -Wno-parentheses
37 CERRWARN
+= -Wno-uninitialized
48 sadc
:= LDLIBS
+= -lkstat
50 # Executables produced
54 LIBSHELL
= $(SA1
) $(SA2
)
57 PROGS
= $(BINPROG
) $(SBINPROG
) $(LIBPROG
)
59 TXTS
= $(SADP
).c README
60 ALL
= $(PROGS
) $(SHELLS
)
63 SADC_OBJECTS
= $(SADC
).o
64 srcs
= $(TIMEX
) $(SAR
) $(SADC
)
66 SHSRCS
= $(SHELLS
:%=%.sh
)
68 # Set of target install directories
69 LIBSAD
= $(ROOT
)/usr
/lib
/sa
70 CROND
= $(ROOT
)/var
/spool
/cron
71 CRONTABSD
= $(CROND
)/crontabs
73 # Set of target install files
74 SYSCRONTAB
= $(CRONTABSD
)/sys
75 ROOTPROG
= $(BINPROG
:%=$(ROOTBIN
)/%)
76 ROOTUSBINPROG
= $(SBINPROG
:%=$(ROOTUSRSBIN
)/%)
77 ROOTLIBPROG
= $(LIBPROG
:%=$(LIBSAD
)/%)
78 ROOTLIBSHELL
= $(LIBSHELL
:%=$(LIBSAD
)/%)
79 ROOTSYMLINKS
= $(SBINPROG
:%=$(ROOTBIN
)/%)
81 # Performance monitoring should not be enabled by default. Hence, these
82 # entries are comments.
83 ENTRY1
= '$(POUND_SIGN) 0 * * * 0-6 /usr/lib/sa/sa1'
84 ENTRY2
= '$(POUND_SIGN) 20,40 8-17 * * 1-5 /usr/lib/sa/sa1'
85 ENTRY3
= '$(POUND_SIGN) 5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A'
87 CLOBBERFILES
= $(PROGS
) $(SHELLS
)
90 $(LIBSAD
)/$(SADC
) := FILEMODE
= 0555
96 $(SADC
): $(SADC_OBJECTS
)
97 $(LINK.c
) -o
$@
$(SADC_OBJECTS
) $(LDLIBS
)
100 # The edit of SYSCRONTAB must be done unconditionally because of the
101 # creation of this file by a different component (Adm) and the possible
103 install: all $(ROOTPROG
) $(ROOTUSBINPROG
) \
104 $(ROOTINITSHELL
) $(ROOTLIBSHELL
) $(ROOTSYMLINKS
) \
105 $(ROOTMANIFEST
) $(ROOTSVCMETHOD
) $(ROOTLIBPROG
)
106 @if
[ -f
$(SYSCRONTAB
) ]; \
108 if
$(GREP
) "sa1" $(SYSCRONTAB
) >/dev
/null
2>&1 ; then
:; \
110 echo
$(ENTRY1
) >> $(SYSCRONTAB
); \
111 echo
$(ENTRY2
) >> $(SYSCRONTAB
); \
112 echo
"$(SYSCRONTAB) modified"; \
114 if
$(GREP
) "sa2" $(SYSCRONTAB
) >/dev
/null
2>&1 ; then
:; \
116 echo
$(ENTRY3
) >> $(SYSCRONTAB
); \
124 -$(RM
) $@
; $(SYMLINK
) ..
/sbin
/`basename $@` $@
129 check: $(CHKMANIFEST
)
132 $(RM
) $(SADC_OBJECTS
) $(PROGS
) $(SHELLS
) $(SADP
)
135 include ..
/Makefile.targ