Print this page
3806 illumos build execs echo unnecessarily
Reviewed by: Garrett D'Amore <garrett.damore@gmail.com>
Reviewed by: Gary Mills <gary_mills@fastmail.fm>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/sa/Makefile
+++ new/usr/src/cmd/sa/Makefile
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21 #
22 22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 +# Copyright (c) 2013 Andrew Stormont. All rights reserved.
24 25 #
25 26 # cmd/sa/Makefile
26 27 #
27 28
28 29 MANIFEST = sar.xml
29 30 SVCMETHOD = svc-sar
30 31
31 32 include ../Makefile.cmd
32 33
33 34 ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
34 35
35 36 CERRWARN += -_gcc=-Wno-parentheses
36 37 CERRWARN += -_gcc=-Wno-uninitialized
37 38
38 39 GREP= grep
39 40
40 41 SADC= sadc
41 42 SADP= sadp
42 43 SAR= sar
43 44 TIMEX= timex
44 45 SA1= sa1
45 46 SA2= sa2
46 47
47 48 sadc := LDLIBS += -lkstat
48 49
49 50 # Executables produced
50 51 BINPROG= $(TIMEX)
51 52 SBINPROG= $(SAR)
52 53 LIBPROG= $(SADC)
53 54 LIBSHELL= $(SA1) $(SA2)
54 55 INITSHELL= $(PERF)
55 56
56 57 PROGS= $(BINPROG) $(SBINPROG) $(LIBPROG)
57 58 SHELLS= $(LIBSHELL)
58 59 TXTS= $(SADP).c README
59 60 ALL= $(PROGS) $(SHELLS)
60 61
61 62 # Source files
62 63 SADC_OBJECTS= $(SADC).o
63 64 srcs= $(TIMEX) $(SAR) $(SADC)
64 65 SRCS= $(srcs:%=%.c)
65 66 SHSRCS= $(SHELLS:%=%.sh)
66 67
67 68 # Set of target install directories
68 69 LIBSAD= $(ROOT)/usr/lib/sa
69 70 CROND= $(ROOT)/var/spool/cron
70 71 CRONTABSD= $(CROND)/crontabs
↓ open down ↓ |
37 lines elided |
↑ open up ↑ |
71 72
72 73 # Set of target install files
73 74 SYSCRONTAB= $(CRONTABSD)/sys
74 75 ROOTPROG= $(BINPROG:%=$(ROOTBIN)/%)
75 76 ROOTUSBINPROG= $(SBINPROG:%=$(ROOTUSRSBIN)/%)
76 77 ROOTLIBPROG= $(LIBPROG:%=$(LIBSAD)/%)
77 78 ROOTLIBSHELL= $(LIBSHELL:%=$(LIBSAD)/%)
78 79 ROOTSYMLINKS= $(SBINPROG:%=$(ROOTBIN)/%)
79 80
80 81 # Performance monitoring should not be enabled by default. Hence, these
81 -# entries are comments. Note the difficulty of inserting a literal #
82 -# in a makefile.... Wonderful parser here....
83 -COMMENT_CHAR:sh= echo \\043
84 -ENTRY1= '$(COMMENT_CHAR) 0 * * * 0-6 /usr/lib/sa/sa1'
85 -ENTRY2= '$(COMMENT_CHAR) 20,40 8-17 * * 1-5 /usr/lib/sa/sa1'
86 -ENTRY3= '$(COMMENT_CHAR) 5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A'
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 86
88 87 CLOBBERFILES= $(PROGS) $(SHELLS)
89 88
90 89 # Conditionals
91 90 $(LIBSAD)/$(SADC) := FILEMODE = 0555
92 91
93 92 .KEEP_STATE:
94 93
95 94 all: $(ALL) $(TXTS)
96 95
97 96 $(SADC): $(SADC_OBJECTS)
98 97 $(LINK.c) -o $@ $(SADC_OBJECTS) $(LDLIBS)
99 98 $(POST_PROCESS)
100 99
101 100 # The edit of SYSCRONTAB must be done unconditionally because of the
102 101 # creation of this file by a different component (Adm) and the possible
103 102 # backdating.
104 103 install: all $(ROOTPROG) $(ROOTUSBINPROG) \
105 104 $(ROOTINITSHELL) $(ROOTLIBSHELL) $(ROOTSYMLINKS) \
106 105 $(ROOTMANIFEST) $(ROOTSVCMETHOD) $(ROOTLIBPROG)
107 106 @if [ -f $(SYSCRONTAB) ]; \
108 107 then \
109 108 if $(GREP) "sa1" $(SYSCRONTAB) >/dev/null 2>&1 ; then :; \
110 109 else \
111 110 echo $(ENTRY1) >> $(SYSCRONTAB); \
112 111 echo $(ENTRY2) >> $(SYSCRONTAB); \
113 112 echo "$(SYSCRONTAB) modified"; \
114 113 fi; \
115 114 if $(GREP) "sa2" $(SYSCRONTAB) >/dev/null 2>&1 ; then :; \
116 115 else \
117 116 echo $(ENTRY3) >> $(SYSCRONTAB); \
118 117 fi; \
119 118 fi
120 119
121 120 $(LIBSAD)/%: %
122 121 $(INS.file)
123 122
124 123 $(ROOTSYMLINKS):
125 124 -$(RM) $@; $(SYMLINK) ../sbin/`basename $@` $@
126 125
127 126 $(ETCINITD)/%: %
128 127 $(INS.file)
129 128
130 129 check: $(CHKMANIFEST)
131 130
132 131 clean:
133 132 $(RM) $(SADC_OBJECTS) $(PROGS) $(SHELLS) $(SADP)
134 133
135 134 lint: lint_SRCS
136 135
137 136 include ../Makefile.targ
↓ open down ↓ |
41 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX