dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / cron / Makefile
blob347e150d14e6fe25f9788f4591693ce672cb44b6
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 += -Wno-parentheses
37 CERRWARN += -Wno-unused-label
38 CERRWARN += -Wno-uninitialized
39 CERRWARN += -Wno-unused-variable
40 CERRWARN += -Wno-unused-value
42 CFLAGS += -DXPG4
44 ROOTVAR = $(ROOT)/var
46 ROOTSPCRON = $(ROOTVAR)/spool/cron
47 ROOTCROND = $(ROOTETC)/cron.d
48 ROOTCRONTABS = $(ROOTSPCRON)/crontabs
49 ROOTATJOBS = $(ROOTSPCRON)/atjobs
50 ROOTLIBCRON = $(ROOTLIB)/cron
52 PROG1 = cron
53 PROG2 = at atq atrm crontab
54 PROG = $(PROG1) $(PROG2)
56 SCRIPT = batch
58 POFILE= $(PROG1)_cmd.po
59 POFILES1= at_cmd.po crontab.po funcs.po batch.po
60 POFILES= $(POFILES1) atrm.po
61 $(POFILES1) := XGETFLAGS= -a -x $(PROG1).xcl
63 ROOTDIRS = $(ROOTSPCRON) $(ROOTCROND) \
64 $(ROOTCRONTABS) $(ROOTATJOBS)
66 ROOTPROG = $(PROG1:%=$(ROOTUSRSBIN)/%) $(PROG2:%=$(ROOTBIN)/%) \
67 $(SCRIPT:%=$(ROOTBIN)/%)
69 ROOTSYMLINK = $(ROOTLIBCRON) $(ROOTETC)/cron
71 GETRESPSRC= $(SRC)/common/util/getresponse.c
72 GETRESPOBJ= getresponse.o
73 COMMONOBJ1= permit.o
74 COMMONOBJ2= funcs.o
75 COMMONOBJS= $(COMMONOBJ1) $(COMMONOBJ2)
76 CRONOBJS= cron.o elm.o
77 ATOBJS= at_cmd.o att1.o att2.o values-xpg4.o
78 ATRMOBJS1= atrm.o
79 ATRMOBJS= $(ATRMOBJS1) $(GETRESPOBJ)
80 ATQOBJS= atq.o
81 CRONTABOBJS1= crontab.o
82 CRONTABOBJS= $(CRONTABOBJS1) $(GETRESPOBJ)
84 cron := POBJS = $(CRONOBJS) $(COMMONOBJ2)
85 at := POBJS = $(ATOBJS) $(COMMONOBJS)
86 atrm := POBJS = $(ATRMOBJS) $(COMMONOBJS)
87 atq := POBJS = $(ATQOBJS) $(COMMONOBJS)
88 crontab := POBJS = $(CRONTABOBJS) $(COMMONOBJS)
91 NOBJS= $(CRONOBJS) $(ATOBJS) $(ATRMOBJS1) $(ATQOBJS) $(CRONTABOBJS1) \
92 $(COMMONOBJS)
93 OBJS = $(NOBJS) $(GETRESPOBJ)
95 SRCS = $(NOBJS:%.o=%.c) $(GETRESPSRC)
97 CLOBBERFILES += $(SCRIPT)
99 $(ROOTLIBCRON) := SYMLNKDEST = ../../etc/cron.d
100 $(ROOTETC)/cron := SYMLNKDEST = ../usr/sbin/cron
102 $(ROOTBIN)/at := FILEMODE = 04755
103 $(ROOTBIN)/atrm := FILEMODE = 04755
104 $(ROOTBIN)/atq := FILEMODE = 04755
105 $(ROOTBIN)/crontab := FILEMODE = 04555
106 $(ROOTUSRSBIN)/cron := FILEMODE = 0555
108 LDLIBS += -lbsm
110 at := LDLIBS += -lproject -lsecdb
111 atq := LDLIBS += -lsecdb
112 atrm := LDLIBS += -lsecdb
113 cron := LDLIBS += -lpam -lproject -lcontract
114 crontab := LDLIBS += -lsecdb -lpam
117 $(ROOTSVCSYSTEM)/cron.xml := FILEMODE = 0444
118 $(ROOTLIBSVCMETHOD)/svc-cron := FILEMODE = 0555
121 .KEEP_STATE:
123 all : $(PROG) $(SCRIPT) $(FILES)
125 install : all $(ROOTPROG) $(ROOTETCDEFAULTFILES) $(ROOTSYMLINK) \
126 $(ROOTMANIFEST) $(ROOTMETHOD)
128 $(PROG) : $$(POBJS)
129 $(LINK.c) $(POBJS) -o $@ $(LDLIBS)
130 $(POST_PROCESS)
132 values-xpg4.o: ../../lib/crt/common/values-xpg4.c
133 $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
135 %.o: $(SRC)/common/util/%.c
136 $(COMPILE.c) $(OUTPUT_OPTION) $<
137 $(POST_PROCESS_O)
139 att1.c : att1.y
140 $(YACC.y) -d att1.y
141 $(MV) y.tab.c att1.c
142 $(MV) y.tab.h att1.h
144 att2.c : att2.l att2.ed att1.c
145 $(LEX) att2.l
146 ed - lex.yy.c < att2.ed
147 $(MV) lex.yy.c att2.c
149 $(ROOTSYMLINK) :
150 $(RM) $@; $(SYMLINK) $(SYMLNKDEST) $@
152 check: $(CHKMANIFEST)
154 $(POFILE): $(POFILES)
155 $(RM) $@; cat $(POFILES) > $@
157 clean :
158 $(RM) $(OBJS) att1.h att1.c att2.c
160 strip :
161 $(STRIP) $(PROG)
163 include ../Makefile.targ