Merge commit 'b1e7e97d3b60469b243b3b2e22c7d8cbd11c7c90'
[unleashed.git] / usr / src / cmd / cron / Makefile
blob96e5dc8e97ca7faac8996147b0d6f96e1cdd3d4c
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)
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
101 $(ROOTBIN)/at := FILEMODE = 04755
102 $(ROOTBIN)/atrm := FILEMODE = 04755
103 $(ROOTBIN)/atq := FILEMODE = 04755
104 $(ROOTBIN)/crontab := FILEMODE = 04555
105 $(ROOTUSRSBIN)/cron := FILEMODE = 0555
107 at := LDLIBS += -lproject -lsecdb
108 atq := LDLIBS += -lsecdb
109 atrm := LDLIBS += -lsecdb
110 cron := LDLIBS += -lpam -lproject -lcontract
111 crontab := LDLIBS += -lsecdb -lpam
114 $(ROOTSVCSYSTEM)/cron.xml := FILEMODE = 0444
115 $(ROOTLIBSVCMETHOD)/svc-cron := FILEMODE = 0555
118 .KEEP_STATE:
120 all : $(PROG) $(SCRIPT) $(FILES)
122 install : all $(ROOTPROG) $(ROOTETCDEFAULTFILES) $(ROOTSYMLINK) \
123 $(ROOTMANIFEST) $(ROOTMETHOD)
125 $(PROG) : $$(POBJS)
126 $(LINK.c) $(POBJS) -o $@ $(LDLIBS)
127 $(POST_PROCESS)
129 values-xpg4.o: ../../lib/crt/common/values-xpg4.c
130 $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
132 %.o: $(SRC)/common/util/%.c
133 $(COMPILE.c) $(OUTPUT_OPTION) $<
134 $(POST_PROCESS_O)
136 att1.c : att1.y
137 $(YACC.y) -d att1.y
138 $(MV) y.tab.c att1.c
139 $(MV) y.tab.h att1.h
141 att2.c : att2.l att2.ed att1.c
142 $(LEX) att2.l
143 ed - lex.yy.c < att2.ed
144 $(MV) lex.yy.c att2.c
146 $(ROOTSYMLINK) :
147 $(RM) $@; $(SYMLINK) $(SYMLNKDEST) $@
149 check: $(CHKMANIFEST)
151 $(POFILE): $(POFILES)
152 $(RM) $@; cat $(POFILES) > $@
154 clean :
155 $(RM) $(OBJS) att1.h att1.c att2.c
157 strip :
158 $(STRIP) $(PROG)
160 include ../Makefile.targ