home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2756 / Makefile < prev    next >
Encoding:
Makefile  |  1991-02-14  |  4.2 KB  |  140 lines

  1. #    Installation of kat (Keith's at package):
  2. #
  3. #    1) Modify the items between the 'Begin' and 'End' configuration
  4. #    section lines to suit your installation
  5. #
  6. #    2) Type 'make' to build the binaries
  7. #
  8. #    3) Login as root and type 'make install' to install the binaries
  9. #    and man pages, create the at queue directory (the parent of the
  10. #    directory must exist) and working directory, and set protections.
  11. #    (This must be done as root since at, atq, and atrm must run
  12. #    setuid root in order to act on the queued jobs in a protected
  13. #    queue directory.)
  14. #
  15. #    4) Add an entry for atrun in the root crontab (or your only crontab,
  16. #    depending on your system) to run at the desired interval (e.g.,
  17. #    every 15 minutes)
  18.  
  19. #    --- Begin configuration section ---
  20.  
  21. # If your cpp(1) does not define a unique system type from the known working
  22. # types in the following list, try uncommenting one of the generic types
  23. # below as a first choice.  If cpp(1) does define one but it is not listed,
  24. # modify at.h in the form used for the other systems and then comment out
  25. # the definitions below
  26.  
  27. # Known system types defined by cpp(1): hpux i386 sequent sun ultrix
  28.  
  29. # SYSTEM = -DGENERIC_BSD
  30. # SYSTEM = -DGENERIC_SYSV
  31.  
  32. #    Define the compiler to be used and the compilation flags
  33.  
  34. CC = cc
  35. CFLAGS = $(SYSTEM) -O
  36. LDFLAGS =
  37. # LDFLAGS = -lseq            # For Sequents to get getopt(3)
  38.  
  39. #    Add the following to ATRUN_FLAGS for the indicated effect:
  40. #        -DMAXATPROC=n defines the maximum number of queued jobs
  41. #            that will run concurrently (default is n=16 if not specified,
  42. #           0 sets no limit)
  43. #        -DDEBUG compiles in code to permit debugging output from
  44. #            atrun when it is run with the debug command line switch
  45. #            (default is no extra debugging code compiled)
  46. #        -DNOSYSLOG causes error and debug messages to be written to
  47. #            a file instead of using syslog(3); requires -DDEBUG
  48.  
  49. ATRUN_FLAGS =
  50.  
  51. #    Define the location of the at job files
  52. #        ATDIR is the primary at directory and holds the queued jobs
  53. #        PASTDIR is a working directory for jobs being run, usually a
  54. #            subdirectory of ATDIR
  55.  
  56. ATDIR = /usr/spool/at
  57. PASTDIR = $(ATDIR)/past
  58.  
  59. #    Define the install directory for the at binaries and man pages
  60.  
  61. BINDIR = /usr/local/bin
  62. MANEXT = l
  63. MANDIR = /usr/man/man$(MANEXT)
  64.  
  65. #    --- End of configuration items ---
  66.  
  67. #    The following should not need to be changed
  68.  
  69. AT_BINARIES = at atcat atq atrm atrun
  70. AT_SHELLS = atmod
  71. AT_OBJS = at.o atname.o dumpenv.o date.o permit.o
  72. ATCAT_OBJS = atcat.o permit.o
  73. ATQ_OBJS = atq.o permit.o qalloc.o
  74. ATRM_OBJS = atrm.o permit.o
  75. ATRUN_OBJS = atrun.o qalloc.o
  76.  
  77. all:
  78.     @(cd src; make -f ../Makefile binaries)
  79.  
  80. binaries: $(AT_BINARIES)
  81.     @echo "The binaries are ready for installation."
  82.     @echo "Type 'make install' as root to install in $(BINDIR)."
  83.  
  84. at: $(AT_OBJS)
  85.     $(CC) $(CFLAGS) -o at $(AT_OBJS) $(LDFLAGS) -ll
  86.  
  87. atcat: $(ATCAT_OBJS)
  88.     $(CC) $(CFLAGS) -o atcat $(ATCAT_OBJS) $(LDFLAGS)
  89.  
  90. atq: $(ATQ_OBJS)
  91.     $(CC) $(CFLAGS) -o atq $(ATQ_OBJS) $(LDFLAGS)
  92.  
  93. atrm: $(ATRM_OBJS)
  94.     $(CC) $(CFLAGS) -o atrm $(ATRM_OBJS) $(LDFLAGS)
  95.  
  96. atrun: $(ATRUN_OBJS)
  97.     $(CC) $(CFLAGS) -o atrun $(ATRUN_OBJS) $(LDFLAGS)
  98.  
  99. install: install.bin install.doc
  100.     @echo "Installation complete."
  101.     @echo "Remember to create the appropriate at.allow or at.deny file."
  102.  
  103. install.bin:
  104.     (cd src; cp $(AT_BINARIES) $(AT_SHELLS) $(BINDIR))
  105.     (cd $(BINDIR) ; chmod 4711 $(AT_BINARIES); \
  106.         chmod 751 atcat $(AT_SHELLS); chmod 700 atrun)
  107.     -if test ! -d $(ATDIR) ; then mkdir $(ATDIR) ; chmod 755 $(ATDIR) ; fi
  108.     -if test ! -d $(PASTDIR) ; then mkdir $(PASTDIR) ; \
  109.         chmod 755 $(PASTDIR) ; fi
  110.  
  111. install.man:
  112.     (cd doc ; \
  113.     cp at.1 $(MANDIR)/at.$(MANEXT) ; \
  114.     cp atcat.1 $(MANDIR)/atcat.$(MANEXT) ; \
  115.     cp atq.1 $(MANDIR)/atq.$(MANEXT) ; \
  116.     cp atrm.1 $(MANDIR)/atrm.$(MANEXT) ; \
  117.     cp atrun.8 $(MANDIR)/atrun.$(MANEXT))
  118.     chmod 644 $(MANDIR)/at.$(MANEXT) \
  119.         $(MANDIR)/atcat.$(MANEXT) \
  120.         $(MANDIR)/atq.$(MANEXT) \
  121.         $(MANDIR)/atrm.$(MANEXT) \
  122.         $(MANDIR)/atrun.$(MANEXT)
  123.  
  124. date.c: date.y lex.yy.c table.h
  125.     @echo "expect 2 shift/reduce conflicts"
  126.     yacc date.y
  127.     mv y.tab.c date.c
  128.  
  129. lex.yy.c: date.l
  130.     lex date.l
  131.  
  132. at.o atcat.o atq.o atrm.o atname.o: $($@:.o=.c) at.h
  133.     $(CC) -c $(CFLAGS) -DATDIR=\"$(ATDIR)\" $<
  134.  
  135. atrun.o: $($@:.o=.c) at.h
  136.     $(CC) -c $(CFLAGS) $(ATRUN_FLAGS) -DATDIR=\"$(ATDIR)\" \
  137.         -DPASTDIR=\"$(PASTDIR)\" $<
  138.  
  139. permit.o qalloc.o: $($@:.o=.c) at.h
  140.