8354 sync regcomp(3C) with upstream (fix make catalog)
[unleashed/tickless.git] / usr / src / cmd / cron / Makefile
blobc9ffeadffe73e0d970612cccb70ba16483385abc
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.
26 DEFAULTFILES = cron.dfl
28 include ../Makefile.cmd
30 MANIFEST = cron.xml
32 ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
33 ROOTMETHOD = $(ROOTLIBSVCMETHOD)/svc-cron
35 CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util
36 CERRWARN += -_gcc=-Wno-parentheses
37 CERRWARN += -_gcc=-Wno-unused-label
38 CERRWARN += -_gcc=-Wno-uninitialized
39 CERRWARN += -_gcc=-Wno-unused-variable
40 CERRWARN += -_gcc=-Wno-unused-value
42 ROOTVAR = $(ROOT)/var
44 ROOTSPCRON = $(ROOTVAR)/spool/cron
45 ROOTCROND = $(ROOTETC)/cron.d
46 ROOTCRONTABS = $(ROOTSPCRON)/crontabs
47 ROOTATJOBS = $(ROOTSPCRON)/atjobs
48 ROOTLIBCRON = $(ROOTLIB)/cron
50 PROG1 = cron
51 PROG2 = at atq atrm crontab
52 XPG6PROG = crontab
53 XPG4PROG = at crontab
54 PROG = $(PROG1) $(PROG2)
56 SCRIPT = batch
57 XPG4SCRIPT = batch.xpg4
59 POFILE= $(PROG1)_cmd.po
60 POFILES1= at.po crontab.po funcs.po batch.po
61 POFILES= $(POFILES1) atrm.po
62 $(POFILES1) := XGETFLAGS= -a -x $(PROG1).xcl
64 ROOTDIRS = $(ROOTSPCRON) $(ROOTCROND) \
65 $(ROOTCRONTABS) $(ROOTATJOBS)
67 ROOTPROG = $(PROG1:%=$(ROOTUSRSBIN)/%) $(PROG2:%=$(ROOTBIN)/%) \
68 $(SCRIPT:%=$(ROOTBIN)/%) \
69 $(XPG6PROG:%=$(ROOTXPG6BIN)/%) \
70 $(XPG4PROG:%=$(ROOTXPG4BIN)/%) \
71 $(XPG4SCRIPT:%.xpg4=$(ROOTXPG4BIN)/%)
73 ROOTSYMLINK = $(ROOTLIBCRON) $(ROOTETC)/cron
75 GETRESPSRC= $(SRC)/common/util/getresponse.c
76 GETRESPOBJ= getresponse.o
77 COMMONOBJ1= permit.o
78 COMMONOBJ2= funcs.o
79 COMMONOBJS= $(COMMONOBJ1) $(COMMONOBJ2)
80 CRONOBJS= cron.o elm.o
81 ATOBJS= at.o att1.o att2.o
82 XPG4OBJS= values-xpg4.o
83 ATRMOBJS1= atrm.o
84 ATRMOBJS= $(ATRMOBJS1) $(GETRESPOBJ)
85 ATQOBJS= atq.o
86 CRONTABOBJS1= crontab.o
87 CRONTABOBJS= $(CRONTABOBJS1) $(GETRESPOBJ)
89 # /usr/xpg*/bin/crontab isn't linked with values-xpg*.o since it isn't
90 # required by any specific behavior differences; this makes these
91 # setuid variants less likely to accidently trip over differences that
92 # could unintentionally open up a security hole.
93 XPG4COMMONOBJS= $(COMMONOBJS:%=objs.xpg4/%)
94 XPG4CTOBJS= $(CRONTABOBJS:%=objs.xpg4/%)
95 XPG4ATOBJS= $(ATOBJS:%=objs.xpg4/%) $(XPG4OBJS:%=objs.xpg4/%)
96 XPG6COMMONOBJS= $(COMMONOBJS:%=objs.xpg6/%)
97 XPG6CTOBJS= $(CRONTABOBJS:%=objs.xpg6/%)
99 cron := POBJS = $(CRONOBJS) $(COMMONOBJ2)
100 at := POBJS = $(ATOBJS) $(COMMONOBJS)
101 at.xpg4 := POBJS = $(XPG4ATOBJS) $(XPG4COMMONOBJS)
102 atrm := POBJS = $(ATRMOBJS) $(COMMONOBJS)
103 atq := POBJS = $(ATQOBJS) $(COMMONOBJS)
104 crontab := POBJS = $(CRONTABOBJS) $(COMMONOBJS)
105 crontab.xpg4 := POBJS = $(XPG4CTOBJS) $(XPG4COMMONOBJS)
106 crontab.xpg6 := POBJS = $(XPG6CTOBJS) $(XPG6COMMONOBJS)
108 CFLAGS += $(CCVERBOSE)
110 NOBJS= $(CRONOBJS) $(ATOBJS) $(ATRMOBJS1) $(ATQOBJS) $(CRONTABOBJS1) \
111 $(COMMONOBJS)
112 OBJS = $(NOBJS) $(XPG4COMMONOBJS) $(XPG4ATOBJS) $(XPG4CTOBJS) \
113 $(XPG6COMMONOBJS) $(XPG6CTOBJS) $(GETRESPOBJ)
115 SRCS = $(NOBJS:%.o=%.c) $(GETRESPSRC)
117 CLOBBERFILES += $(SCRIPT) $(XPG4SCRIPT)
119 $(ROOTLIBCRON) := SYMLNKDEST = ../../etc/cron.d
120 $(ROOTETC)/cron := SYMLNKDEST = ../usr/sbin/cron
122 $(ROOTBIN)/at := FILEMODE = 04755
123 $(ROOTXPG4BIN)/at := FILEMODE = 04755
124 $(ROOTBIN)/atrm := FILEMODE = 04755
125 $(ROOTBIN)/atq := FILEMODE = 04755
126 $(ROOTBIN)/crontab := FILEMODE = 04555
127 $(ROOTXPG6BIN)/crontab := FILEMODE = 04555
128 $(ROOTXPG4BIN)/crontab := FILEMODE = 04555
129 $(ROOTUSRSBIN)/cron := FILEMODE = 0555
131 LDLIBS += -lbsm
133 at := LDLIBS += -lproject -lsecdb
134 at.xpg4 := LDLIBS += -lproject -lsecdb
135 atq := LDLIBS += -lsecdb
136 atrm := LDLIBS += -lsecdb
137 cron := LDLIBS += -lpam -lproject -lcontract -lzoneinfo
138 crontab := LDLIBS += -lsecdb -lpam -lzoneinfo
139 crontab.xpg6 := LDLIBS += -lsecdb -lpam -lzoneinfo
140 crontab.xpg4 := LDLIBS += -lsecdb -lpam -lzoneinfo
142 lint := LDLIBS += -lproject -lsecdb -lcontract -lpam
144 $(XPG4) := CFLAGS += -DXPG4
145 $(XPG6) := CFLAGS += -DXPG6
147 LINTFLAGS += -u
149 $(ROOTSVCSYSTEM)/cron.xml := FILEMODE = 0444
150 $(ROOTLIBSVCMETHOD)/svc-cron := FILEMODE = 0555
153 .KEEP_STATE:
155 all : $(PROG) $(XPG4) $(XPG6) $(SCRIPT) $(XPG4SCRIPT) $(FILES)
157 install : all $(ROOTPROG) $(ROOTETCDEFAULTFILES) $(ROOTSYMLINK) \
158 $(ROOTMANIFEST) $(ROOTMETHOD)
160 $(PROG) : $$(POBJS)
161 $(LINK.c) $(POBJS) -o $@ $(LDLIBS)
162 $(POST_PROCESS)
164 $(XPG4) : objs.xpg4 $$(POBJS)
165 $(LINK.c) $(POBJS) -o $@ $(LDLIBS)
166 $(POST_PROCESS)
168 $(XPG6) : objs.xpg6 $$(POBJS)
169 $(LINK.c) $(POBJS) -o $@ $(LDLIBS)
170 $(POST_PROCESS)
172 objs.xpg6/%.o: %.c
173 $(COMPILE.c) -o $@ $<
175 objs.xpg6:
176 -@mkdir -p $@
178 objs.xpg4/%.o: %.c
179 $(COMPILE.c) -o $@ $<
181 objs.xpg4:
182 -@mkdir -p $@
184 objs.xpg4/values-xpg4.o: ../../lib/common/common/values-xpg4.c
185 $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
187 %.o: $(SRC)/common/util/%.c
188 $(COMPILE.c) $(OUTPUT_OPTION) $<
189 $(POST_PROCESS_O)
191 objs.xpg4/%.o: $(SRC)/common/util/%.c
192 $(COMPILE.c) -o $@ $<
193 $(POST_PROCESS_O)
195 objs.xpg6/%.o: $(SRC)/common/util/%.c
196 $(COMPILE.c) -o $@ $<
197 $(POST_PROCESS_O)
199 att1.c : att1.y
200 $(YACC.y) -d att1.y
201 $(MV) y.tab.c att1.c
202 $(MV) y.tab.h att1.h
204 att2.c : att2.l att2.ed att1.c
205 $(LEX) att2.l
206 ed - lex.yy.c < att2.ed
207 $(MV) lex.yy.c att2.c
209 # Don't re-install directories installed by Targetdirs
210 #$(ROOTDIRS):
211 # $(INS.dir)
213 $(ROOTSYMLINK) :
214 $(RM) $@; $(SYMLINK) $(SYMLNKDEST) $@
216 check: $(CHKMANIFEST)
218 $(POFILE): $(POFILES)
219 $(RM) $@; cat $(POFILES) > $@
221 clean :
222 $(RM) $(OBJS) att1.h att1.c att2.c
224 lint : lint_SRCS
226 strip :
227 $(STRIP) $(PROG) $(XPG4) $(XPG6)
229 include ../Makefile.targ