12311Sjkh#/* Copyright 1988,1990,1993,1994 by Paul Vixie
22311Sjkh# * All rights reserved
32311Sjkh# *
42311Sjkh# * Distribute freely, except: don't remove my name from the source or
52311Sjkh# * documentation (don't take credit for my work), mark your changes (don't
62311Sjkh# * get me blamed for your possible bugs), don't alter or remove this
72311Sjkh# * notice.  May be sold if buildable source is provided to buyer.  No
82311Sjkh# * warrantee of any kind, express or implied, is included with this
92311Sjkh# * software; use at your own risk, responsibility for damages (if any) to
102311Sjkh# * anyone resulting from the use of this software rests entirely with the
112311Sjkh# * user.
122311Sjkh# *
132311Sjkh# * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
142311Sjkh# * I'll try to keep a version up to date.  I can be reached as follows:
152311Sjkh# * Paul Vixie          <paul@vix.com>          uunet!decwrl!vixie!paul
162311Sjkh# */
172311Sjkh
182311Sjkh# Makefile for vixie's cron
192311Sjkh#
2050479Speter# $FreeBSD$
212311Sjkh#
222311Sjkh# vix 03mar88 [moved to RCS, rest of log is in there]
232311Sjkh# vix 30mar87 [goodbye, time.c; hello, getopt]
242311Sjkh# vix 12feb87 [cleanup for distribution]
252311Sjkh# vix 30dec86 [written]
262311Sjkh
272311Sjkh# NOTES:
282311Sjkh#	'make' can be done by anyone
292311Sjkh#	'make install' must be done by root
302311Sjkh#
312311Sjkh#	this package needs getopt(3), bitstring(3), and BSD install(8).
322311Sjkh#
332311Sjkh#	the configurable stuff in this makefile consists of compilation
342311Sjkh#	options (use -O, cron runs forever) and destination directories.
352311Sjkh#	SHELL is for the 'augumented make' systems where 'make' imports
362311Sjkh#	SHELL from the environment and then uses it to run its commands.
372311Sjkh#	if your environment SHELL variable is /bin/csh, make goes real
388857Srgrimes#	slow and sometimes does the wrong thing.
392311Sjkh#
402311Sjkh#	this package needs the 'bitstring macros' library, which is
412311Sjkh#	available from me or from the comp.sources.unix archive.  if you
422311Sjkh#	put 'bitstring.h' in a non-standard place (i.e., not intuited by
432311Sjkh#	cc(1)), you will have to define INCLUDE to set the include
442311Sjkh#	directory for cc.  INCLUDE should be `-Isomethingorother'.
452311Sjkh#
462311Sjkh#	there's more configuration info in config.h; edit that first!
472311Sjkh
482311Sjkh#################################### begin configurable stuff
492311Sjkh#<<DESTROOT is assumed to have ./etc, ./bin, and ./man subdirectories>>
502311SjkhDESTROOT	=	$(DESTDIR)/usr
512311SjkhDESTSBIN	=	$(DESTROOT)/sbin
522311SjkhDESTBIN		=	$(DESTROOT)/bin
532311SjkhDESTMAN		=	$(DESTROOT)/share/man
542311Sjkh#<<need bitstring.h>>
552311SjkhINCLUDE		=	-I.
562311Sjkh#INCLUDE	=
572311Sjkh#<<need getopt()>>
582311SjkhLIBS		=
592311Sjkh#<<optimize or debug?>>
602311Sjkh#OPTIM		=	-O
612311SjkhOPTIM		=	-g
622311Sjkh#<<ATT or BSD or POSIX?>>
632311Sjkh# (ATT untested)
642311Sjkh#COMPAT		=	-DATT
652311Sjkh#(BSD is only needed if <sys/params.h> does not define it, as on ULTRIX)
662311Sjkh#COMPAT		=	-DBSD
672311Sjkh# (POSIX)
682311Sjkh#COMPAT		=	-DPOSIX
692311Sjkh#<<lint flags of choice?>>
702311SjkhLINTFLAGS	=	-hbxa $(INCLUDE) $(COMPAT) $(DEBUGGING)
712311Sjkh#<<want to use a nonstandard CC?>>
722311Sjkh#CC		=	vcc
732311Sjkh#<<manifest defines>>
742311SjkhDEFS		=
752311Sjkh#(SGI IRIX systems need this)
762311Sjkh#DEFS		=	-D_BSD_SIGNALS -Dconst=
772311Sjkh#<<the name of the BSD-like install program>>
782311Sjkh#INSTALL = installbsd
792311SjkhINSTALL = install
802311Sjkh#<<any special load flags>>
812311SjkhLDFLAGS		=
822311Sjkh#################################### end configurable stuff
832311Sjkh
842311SjkhSHELL		=	/bin/sh
852311SjkhCFLAGS		=	$(OPTIM) $(INCLUDE) $(COMPAT) $(DEFS)
862311Sjkh
872311SjkhINFOS		=	README CHANGES FEATURES INSTALL CONVERSION THANKS MAIL
882311SjkhMANPAGES	=	bitstring.3 crontab.5 crontab.1 cron.8 putman.sh
892311SjkhHEADERS		=	bitstring.h cron.h config.h pathnames.h \
902311Sjkh			externs.h compat.h
912311SjkhSOURCES		=	cron.c crontab.c database.c do_command.c entry.c \
922311Sjkh			env.c job.c user.c popen.c misc.c compat.c
932311SjkhSHAR_SOURCE	=	$(INFOS) $(MANPAGES) Makefile $(HEADERS) $(SOURCES)
942311SjkhLINT_CRON	=	cron.c database.c user.c entry.c compat.c \
952311Sjkh			misc.c job.c do_command.c env.c popen.c
962311SjkhLINT_CRONTAB	=	crontab.c misc.c entry.c env.c compat.c
972311SjkhCRON_OBJ	=	cron.o database.o user.o entry.o job.o do_command.o \
982311Sjkh			misc.o env.o popen.o compat.o
992311SjkhCRONTAB_OBJ	=	crontab.o misc.o entry.o env.o compat.o
1002311Sjkh
1012311Sjkhall		:	cron crontab
1022311Sjkh
1032311Sjkhlint		:
1042311Sjkh			lint $(LINTFLAGS) $(LINT_CRON) $(LIBS) \
1052311Sjkh			|grep -v "constant argument to NOT" 2>&1
1062311Sjkh			lint $(LINTFLAGS) $(LINT_CRONTAB) $(LIBS) \
1072311Sjkh			|grep -v "constant argument to NOT" 2>&1
1082311Sjkh
1092311Sjkhcron		:	$(CRON_OBJ)
1102311Sjkh			$(CC) $(LDFLAGS) -o cron $(CRON_OBJ) $(LIBS)
1112311Sjkh
1122311Sjkhcrontab		:	$(CRONTAB_OBJ)
1132311Sjkh			$(CC) $(LDFLAGS) -o crontab $(CRONTAB_OBJ) $(LIBS)
1142311Sjkh
1152311Sjkhinstall		:	all
1162311Sjkh			$(INSTALL) -c -m  111 -o root -s cron    $(DESTSBIN)/
1172311Sjkh			$(INSTALL) -c -m 4111 -o root -s crontab $(DESTBIN)/
1182311Sjkh			sh putman.sh crontab.1 $(DESTMAN)
1192311Sjkh			sh putman.sh cron.8    $(DESTMAN)
1202311Sjkh			sh putman.sh crontab.5 $(DESTMAN)
1212311Sjkh
1222311Sjkhclean		:;	rm -f *.o cron crontab a.out core tags *~ #*
1232311Sjkh
1242311Sjkhkit		:	$(SHAR_SOURCE)
1252311Sjkh			makekit -m -s99k $(SHAR_SOURCE)
1262311Sjkh
1272311Sjkh$(CRON_OBJ)	:	cron.h compat.h config.h externs.h pathnames.h Makefile
1282311Sjkh$(CRONTAB_OBJ)	:	cron.h compat.h config.h externs.h pathnames.h Makefile
129