1#/* Copyright 1988,1990,1993,1994 by Paul Vixie
2# * All rights reserved
3# */
4
5##
6## Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
7## Copyright (c) 1997,2000 by Internet Software Consortium, Inc.
8##
9## Permission to use, copy, modify, and distribute this software for any
10## purpose with or without fee is hereby granted, provided that the above
11## copyright notice and this permission notice appear in all copies.
12##
13## THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
14## WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15## MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
16## ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17## WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18## ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
19## OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20##
21
22# Makefile for ISC cron
23#
24# Id: Makefile,v 1.9 2004/01/23 18:56:42 vixie Exp
25#
26# vix 03mar88 [moved to RCS, rest of log is in there]
27# vix 30mar87 [goodbye, time.c; hello, getopt]
28# vix 12feb87 [cleanup for distribution]
29# vix 30dec86 [written]
30
31# NOTES:
32#         'make' can be done by anyone
33#         'make install' must be done by root
34#
35#         this package needs getopt(3), bitstring(3), and BSD install(8).
36#
37#         the configurable stuff in this makefile consists of compilation
38#         options (use -O, cron runs forever) and destination directories.
39#         SHELL is for the 'augumented make' systems where 'make' imports
40#         SHELL from the environment and then uses it to run its commands.
41#         if your environment SHELL variable is /bin/csh, make goes real
42#         slow and sometimes does the wrong thing.
43#
44#         this package needs the 'bitstring macros' library, which is
45#         available from me or from the comp.sources.unix archive.  if you
46#         put 'bitstring.h' in a non-standard place (i.e., not intuited by
47#         cc(1)), you will have to define INCLUDE to set the include
48#         directory for cc.  INCLUDE should be `-Isomethingorother'.
49#
50#         there's more configuration info in config.h; edit that first!
51
52#################################### begin configurable stuff
53#<<DESTROOT is assumed to have ./etc, ./bin, and ./man subdirectories>>
54DESTROOT  =         $(DESTDIR)/usr
55DESTSBIN  =         $(DESTROOT)/sbin
56DESTBIN             =         $(DESTROOT)/bin
57DESTMAN             =         $(DESTROOT)/share/man
58#<<need bitstring.h>>
59INCLUDE             =         -I.
60#INCLUDE  =
61#<<need getopt()>>
62LIBS                = -lutil
63#<<optimize or debug?>>
64#CDEBUG             =         -O
65CDEBUG              =         -g
66#<<lint flags of choice?>>
67LINTFLAGS =         -hbxa $(INCLUDE) $(DEBUGGING)
68#<<want to use a nonstandard CC?>>
69CC                  =         gcc -Wall -Wno-unused -Wno-comment
70#<<manifest defines>>
71DEFS                =
72#(SGI IRIX systems need this)
73#DEFS               =         -D_BSD_SIGNALS -Dconst=
74#<<the name of the BSD-like install program>>
75#INSTALL = installbsd
76INSTALL = install
77#<<any special load flags>>
78LDFLAGS             =
79#################################### end configurable stuff
80
81SHELL               =         /bin/sh
82CFLAGS              =         $(CDEBUG) $(INCLUDE) $(DEFS)
83
84INFOS               =         README CHANGES FEATURES INSTALL CONVERSION THANKS MAIL
85MANPAGES  =         bitstring.3 crontab.5 crontab.1 cron.8 putman.sh
86HEADERS             =         bitstring.h cron.h config.h pathnames.h externs.h \
87                              macros.h structs.h funcs.h globals.h
88SOURCES             =         cron.c crontab.c database.c do_command.c entry.c \
89                              env.c job.c user.c popen.c misc.c pam_auth.c pw_dup.c
90SHAR_SOURCE         =         $(INFOS) $(MANPAGES) Makefile $(HEADERS) $(SOURCES)
91LINT_CRON =         cron.c database.c user.c entry.c \
92                              misc.c job.c do_command.c env.c popen.c pw_dup.c
93LINT_CRONTAB        =         crontab.c misc.c entry.c env.c
94CRON_OBJ  =         cron.o database.o user.o entry.o job.o do_command.o \
95                              misc.o env.o popen.o pw_dup.o
96CRONTAB_OBJ         =         crontab.o misc.o entry.o env.o pw_dup.o closeall.o
97
98all                 :         cron crontab
99
100lint                :
101                              lint $(LINTFLAGS) $(LINT_CRON) $(LIBS) \
102                              |grep -v "constant argument to NOT" 2>&1
103                              lint $(LINTFLAGS) $(LINT_CRONTAB) $(LIBS) \
104                              |grep -v "constant argument to NOT" 2>&1
105
106cron                :         $(CRON_OBJ)
107                              $(CC) $(LDFLAGS) -o cron $(CRON_OBJ) $(LIBS)
108
109crontab             :         $(CRONTAB_OBJ)
110                              $(CC) $(LDFLAGS) -o crontab $(CRONTAB_OBJ) $(LIBS)
111
112install             :         all
113                              $(INSTALL) -c -m  111 -o root -s cron    $(DESTSBIN)/
114                              $(INSTALL) -c -m 4111 -o root -s crontab $(DESTBIN)/
115#                             $(INSTALL) -c -m  111 -o root -g crontab -s cron $(DESTSBIN)/
116#                             $(INSTALL) -c -m 2111 -o root -g crontab -s crontab $(DESTBIN)/
117                              sh putman.sh crontab.1 $(DESTMAN)
118                              sh putman.sh cron.8    $(DESTMAN)
119                              sh putman.sh crontab.5 $(DESTMAN)
120
121distclean :         clean
122                              rm -f *.orig *.rej *.BAK *.CKP *~ #*
123                              rm -f a.out core tags
124
125clean               :
126                              rm -f *.o
127                              rm -f cron crontab
128
129tags                :;        ctags ${SOURCES}
130
131kit                 :         $(SHAR_SOURCE)
132                              shar $(SHAR_SOURCE) >kit
133
134$(CRON_OBJ)         :         cron.h config.h externs.h pathnames.h Makefile
135$(CRONTAB_OBJ)      :         cron.h config.h externs.h pathnames.h Makefile
136