home *** CD-ROM | disk | FTP | other *** search
Makefile | 1991-02-14 | 4.2 KB | 140 lines |
- # Installation of kat (Keith's at package):
- #
- # 1) Modify the items between the 'Begin' and 'End' configuration
- # section lines to suit your installation
- #
- # 2) Type 'make' to build the binaries
- #
- # 3) Login as root and type 'make install' to install the binaries
- # and man pages, create the at queue directory (the parent of the
- # directory must exist) and working directory, and set protections.
- # (This must be done as root since at, atq, and atrm must run
- # setuid root in order to act on the queued jobs in a protected
- # queue directory.)
- #
- # 4) Add an entry for atrun in the root crontab (or your only crontab,
- # depending on your system) to run at the desired interval (e.g.,
- # every 15 minutes)
-
- # --- Begin configuration section ---
-
- # If your cpp(1) does not define a unique system type from the known working
- # types in the following list, try uncommenting one of the generic types
- # below as a first choice. If cpp(1) does define one but it is not listed,
- # modify at.h in the form used for the other systems and then comment out
- # the definitions below
-
- # Known system types defined by cpp(1): hpux i386 sequent sun ultrix
-
- # SYSTEM = -DGENERIC_BSD
- # SYSTEM = -DGENERIC_SYSV
-
- # Define the compiler to be used and the compilation flags
-
- CC = cc
- CFLAGS = $(SYSTEM) -O
- LDFLAGS =
- # LDFLAGS = -lseq # For Sequents to get getopt(3)
-
- # Add the following to ATRUN_FLAGS for the indicated effect:
- # -DMAXATPROC=n defines the maximum number of queued jobs
- # that will run concurrently (default is n=16 if not specified,
- # 0 sets no limit)
- # -DDEBUG compiles in code to permit debugging output from
- # atrun when it is run with the debug command line switch
- # (default is no extra debugging code compiled)
- # -DNOSYSLOG causes error and debug messages to be written to
- # a file instead of using syslog(3); requires -DDEBUG
-
- ATRUN_FLAGS =
-
- # Define the location of the at job files
- # ATDIR is the primary at directory and holds the queued jobs
- # PASTDIR is a working directory for jobs being run, usually a
- # subdirectory of ATDIR
-
- ATDIR = /usr/spool/at
- PASTDIR = $(ATDIR)/past
-
- # Define the install directory for the at binaries and man pages
-
- BINDIR = /usr/local/bin
- MANEXT = l
- MANDIR = /usr/man/man$(MANEXT)
-
- # --- End of configuration items ---
-
- # The following should not need to be changed
-
- AT_BINARIES = at atcat atq atrm atrun
- AT_SHELLS = atmod
- AT_OBJS = at.o atname.o dumpenv.o date.o permit.o
- ATCAT_OBJS = atcat.o permit.o
- ATQ_OBJS = atq.o permit.o qalloc.o
- ATRM_OBJS = atrm.o permit.o
- ATRUN_OBJS = atrun.o qalloc.o
-
- all:
- @(cd src; make -f ../Makefile binaries)
-
- binaries: $(AT_BINARIES)
- @echo "The binaries are ready for installation."
- @echo "Type 'make install' as root to install in $(BINDIR)."
-
- at: $(AT_OBJS)
- $(CC) $(CFLAGS) -o at $(AT_OBJS) $(LDFLAGS) -ll
-
- atcat: $(ATCAT_OBJS)
- $(CC) $(CFLAGS) -o atcat $(ATCAT_OBJS) $(LDFLAGS)
-
- atq: $(ATQ_OBJS)
- $(CC) $(CFLAGS) -o atq $(ATQ_OBJS) $(LDFLAGS)
-
- atrm: $(ATRM_OBJS)
- $(CC) $(CFLAGS) -o atrm $(ATRM_OBJS) $(LDFLAGS)
-
- atrun: $(ATRUN_OBJS)
- $(CC) $(CFLAGS) -o atrun $(ATRUN_OBJS) $(LDFLAGS)
-
- install: install.bin install.doc
- @echo "Installation complete."
- @echo "Remember to create the appropriate at.allow or at.deny file."
-
- install.bin:
- (cd src; cp $(AT_BINARIES) $(AT_SHELLS) $(BINDIR))
- (cd $(BINDIR) ; chmod 4711 $(AT_BINARIES); \
- chmod 751 atcat $(AT_SHELLS); chmod 700 atrun)
- -if test ! -d $(ATDIR) ; then mkdir $(ATDIR) ; chmod 755 $(ATDIR) ; fi
- -if test ! -d $(PASTDIR) ; then mkdir $(PASTDIR) ; \
- chmod 755 $(PASTDIR) ; fi
-
- install.man:
- (cd doc ; \
- cp at.1 $(MANDIR)/at.$(MANEXT) ; \
- cp atcat.1 $(MANDIR)/atcat.$(MANEXT) ; \
- cp atq.1 $(MANDIR)/atq.$(MANEXT) ; \
- cp atrm.1 $(MANDIR)/atrm.$(MANEXT) ; \
- cp atrun.8 $(MANDIR)/atrun.$(MANEXT))
- chmod 644 $(MANDIR)/at.$(MANEXT) \
- $(MANDIR)/atcat.$(MANEXT) \
- $(MANDIR)/atq.$(MANEXT) \
- $(MANDIR)/atrm.$(MANEXT) \
- $(MANDIR)/atrun.$(MANEXT)
-
- date.c: date.y lex.yy.c table.h
- @echo "expect 2 shift/reduce conflicts"
- yacc date.y
- mv y.tab.c date.c
-
- lex.yy.c: date.l
- lex date.l
-
- at.o atcat.o atq.o atrm.o atname.o: $($@:.o=.c) at.h
- $(CC) -c $(CFLAGS) -DATDIR=\"$(ATDIR)\" $<
-
- atrun.o: $($@:.o=.c) at.h
- $(CC) -c $(CFLAGS) $(ATRUN_FLAGS) -DATDIR=\"$(ATDIR)\" \
- -DPASTDIR=\"$(PASTDIR)\" $<
-
- permit.o qalloc.o: $($@:.o=.c) at.h
-