home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / elm / elm2.3pl11 / utils / Makefile.SH < prev    next >
Encoding:
Makefile  |  1990-04-28  |  10.4 KB  |  412 lines

  1. case $CONFIG in
  2. '')
  3.     if test ! -f config.sh; then
  4.     ln ../config.sh . || \
  5.     ln ../../config.sh . || \
  6.     ln ../../../config.sh . || \
  7.     (echo "Can't find config.sh."; exit 1)
  8.     fi
  9.     . ./config.sh
  10.     ;;
  11. esac
  12. case "$0" in
  13. */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  14. esac
  15.  
  16. echo "Extracting utils/Makefile (with variable substitutions)"
  17. cat >Makefile <<!GROK!THIS!
  18.  
  19. # @(#)$Id: Makefile.SH,v 4.1 90/04/28 22:44:26 syd Exp $
  20. #
  21. #  Makefile for the Elm system utilities
  22. #
  23. #    Copyright (c) 1986, 1987 Dave Taylor
  24. #    Copyright (c) 1988, 1989, 1990 USENET Community Trust
  25. #
  26. # Bug reports, patches, comments, suggestions should be sent to:
  27. #
  28. #    Syd Weinstein - elm@DSI.COM
  29. #            dsinc!elm
  30. #
  31. # $Log:    Makefile.SH,v $
  32. # Revision 4.1  90/04/28  22:44:26  syd
  33. # checkin of Elm 2.3 as of Release PL0
  34. #
  35. # Variables
  36. #    Variables established by Configure
  37. CC        =    $cc
  38. CCFLAGS        =    $ccflags $xencf
  39. CHMOD        =    $chmod
  40. CP        =    $cp
  41. DEST        =    $bin
  42. ECHO        =    $echo
  43. LFLAGS        =    $ldflags $xenlf
  44. LIB        =    $lib
  45. LIB2        =     $libs
  46. LIBS        =    $termlib $dbm
  47. LINT        =    $lint
  48. LN        =    $ln
  49. MAKE        =    $make
  50. MV        =    $mv
  51. OPTIMIZE    =    $optimize
  52. RM        =     $rm -f
  53. TOUCH        =    $touch
  54. !GROK!THIS!
  55.  
  56. cat >>Makefile <<'!NO!SUBS!'
  57. #    Variables you may want to manually edit
  58. #        If you want debug logging then you'll
  59. #        want to uncomment the following.
  60. #DEBUG        =    -DDEBUG
  61.  
  62. #    Other general variables
  63. BIN        =    ../bin
  64. CFLAGS        =    $(CCFLAGS) $(OPTIMIZE) -I$(INCLDIR) $(DEBUG) $(DACSNET) 
  65. INCLDIR        =    ../hdrs
  66. LINTFLAGS    =    -I$(INCLDIR)
  67. SHELL        =    /bin/sh
  68.  
  69. #    Lists
  70. #        List of installed programs - excludes wnewmail, which is
  71. #        handled separately
  72. INSTALL_LIST    =    $(DEST)/answer        \
  73.             $(DEST)/arepdaemon    \
  74.             $(DEST)/autoreply    \
  75.             $(DEST)/checkalias    \
  76.             $(DEST)/fastmail    \
  77.             $(DEST)/frm        \
  78.             $(DEST)/listalias    \
  79.             $(DEST)/messages    \
  80.             $(DEST)/newalias    \
  81.             $(DEST)/newmail        \
  82.             $(DEST)/printmail    \
  83.             $(DEST)/readmsg
  84.  
  85. #        List of remotely install programs
  86. REMOTE_LIST    =    $(REMOTE)$(DEST)/answer        \
  87.             $(REMOTE)$(DEST)/arepdaemon    \
  88.             $(REMOTE)$(DEST)/autoreply    \
  89.             $(REMOTE)$(DEST)/checkalias    \
  90.             $(REMOTE)$(DEST)/fastmail    \
  91.             $(REMOTE)$(DEST)/frm        \
  92.             $(REMOTE)$(DEST)/listalias    \
  93.             $(REMOTE)$(DEST)/messages    \
  94.             $(REMOTE)$(DEST)/newalias    \
  95.             $(REMOTE)$(DEST)/newmail    \
  96.             $(REMOTE)$(DEST)/printmail    \
  97.             $(REMOTE)$(DEST)/readmsg
  98.  
  99. #        List of programs in bin directory
  100. BINARY_LIST    =    $(BIN)/answer        \
  101.             $(BIN)/arepdaemon    \
  102.             $(BIN)/autoreply    \
  103.             $(BIN)/checkalias    \
  104.             $(BIN)/fastmail        \
  105.             $(BIN)/frm        \
  106.             $(BIN)/listalias    \
  107.             $(BIN)/messages        \
  108.             $(BIN)/newalias        \
  109.             $(BIN)/newmail        \
  110.             $(BIN)/printmail    \
  111.             $(BIN)/readmsg
  112.  
  113. #        List of programs to $(LINT) - only C programs
  114. LINT_LIST    =    answer_lint    \
  115.             arepdaemon_lint    \
  116.             autoreply_lint    \
  117.             fastmail_lint    \
  118.             frm_lint    \
  119.             listalias_lint    \
  120.             newalias_lint    \
  121.             newmail_lint    \
  122.             readmsg_lint
  123.  
  124. #    List of all object files in all util programs (used in parallel makes)
  125. UTIL_OBJ    =    answer.o        \
  126.             arepdaem.o         \
  127.             autoreply.o        \
  128.             expand.o        \
  129.             fastmail.o        \
  130.             from.o            \
  131.             listalias.o        \
  132.             newalias.o        \
  133.             newmail.o        \
  134.             readmsg.o        \
  135.             ../src/opt_utils.o    \
  136.             ../src/string2.o    \
  137.             ../src/validname.o
  138.  
  139. #    Lists of source and object files for each C program
  140. ANSWER_SRC    =    answer.c ../src/opt_utils.c ../src/string2.c
  141. ANSWER_OBJ    =    answer.o ../src/opt_utils.o ../src/string2.o
  142. AREPDAEMON_SRC    =    arepdaem.c ../src/opt_utils.c ../src/errno.c
  143. AREPDAEMON_OBJ    =    arepdaem.o ../src/opt_utils.o ../src/errno.o
  144. AUTOREPLY_SRC    =    autoreply.c ../src/opt_utils.c
  145. AUTOREPLY_OBJ    =    autoreply.o ../src/opt_utils.o
  146. FASTMAIL_SRC    =    fastmail.c ../src/opt_utils.c
  147. FASTMAIL_OBJ    =    fastmail.o ../src/opt_utils.o
  148. FRM_SRC        =    from.c expand.c ../src/opt_utils.c ../src/string2.c
  149. FRM_OBJ        =    from.o expand.o ../src/opt_utils.o ../src/string2.o
  150. LISTALIAS_SRC    =    listalias.c
  151. LISTALIAS_OBJ    =    listalias.o
  152. NEWALIAS_SRC    =    newalias.c ../src/validname.c ../src/opt_utils.c ../src/string2.c
  153. NEWALIAS_OBJ    =    newalias.o ../src/validname.o ../src/opt_utils.o ../src/string2.o
  154. NEWMAIL_SRC    =    newmail.c expand.c ../src/opt_utils.c ../src/string2.c
  155. NEWMAIL_OBJ    =    newmail.o expand.o ../src/opt_utils.o ../src/string2.o
  156. READMSG_SRC    =    readmsg.c expand.c ../src/opt_utils.c ../src/string2.c
  157. READMSG_OBJ    =    readmsg.o expand.o ../src/opt_utils.o ../src/string2.o
  158.  
  159. # Standard targets
  160. all:            objects $(BINARY_LIST)
  161.  
  162. #    This unusual target enables highly efficial compilation of object files
  163. #    on systems that have the parallel make feature.
  164. objects:        $& $(UTIL_OBJ)
  165.  
  166. install:        $(INSTALL_LIST) $(DEST)/wnewmail
  167.  
  168. uninstall:        
  169.             $(RM) $(INSTALL_LIST) $(DEST)/wnewmail
  170.  
  171. #    This is the only target that gets installed even if not out-of-date
  172. #    with respect the files from which it is installed.
  173. rmt-install:        rmt-defined
  174.             -$(MV) $(DEST)/answer $(DEST)/answer.old
  175.             -$(MV) $(DEST)/arepdaemon $(DEST)/arepdaemon.old
  176.             -$(MV) $(DEST)/autoreply $(DEST)/autoreply.old
  177.             -$(MV) $(DEST)/checkalias $(DEST)/checkalias.old
  178.             -$(MV) $(DEST)/fastmail $(DEST)/fastmail.old
  179.             -$(MV) $(DEST)/frm $(DEST)/frm.old
  180.             -$(MV) $(DEST)/listalias $(DEST)/listalias.old
  181.             -$(MV) $(DEST)/messages $(DEST)/messages.old
  182.             -$(MV) $(DEST)/newalias $(DEST)/newalias.old
  183.             -$(MV) $(DEST)/newmail $(DEST)/newmail.old
  184.             -$(MV) $(DEST)/printmail $(DEST)/printmail.old
  185.             -$(MV) $(DEST)/readmsg $(DEST)/readmsg.old
  186.             -$(MV) $(DEST)/wnewmail $(DEST)/wnewmail.old
  187.             -$(RM) $(DEST)/answer.old
  188.             -$(RM) $(DEST)/arepdaemon.old
  189.             -$(RM) $(DEST)/autoreply.old
  190.             -$(RM) $(DEST)/checkalias.old
  191.             -$(RM) $(DEST)/fastmail.old
  192.             -$(RM) $(DEST)/frm.old
  193.             -$(RM) $(DEST)/listalias.old
  194.             -$(RM) $(DEST)/messages.old
  195.             -$(RM) $(DEST)/newalias.old
  196.             -$(RM) $(DEST)/newmail.old
  197.             -$(RM) $(DEST)/printmail.old
  198.             -$(RM) $(DEST)/readmsg.old
  199.             -$(RM) $(DEST)/wnewmail.old
  200.             $(CP) $(REMOTE_LIST) $(DEST)
  201.             $(LN) $(DEST)/newmail $(DEST)/wnewmail
  202.             $(CHMOD) a+rx $(INSTALL_LIST)
  203.  
  204. rmt-defined:
  205.     @(if [ "$(REMOTE)" = "" ];\
  206.       then\
  207.         $(ECHO) "You need to define 'REMOTE' as the remote file system";\
  208.         $(ECHO) "for this particular command. The easiest way to do this";\
  209.         $(ECHO) "to type:";\
  210.         $(ECHO) "        make REMOTE=<remote file system> rmt-install";\
  211.         exit 1;\
  212.       fi);
  213.  
  214. #    This rule allows us to put lint output for each program on the
  215. #    same file, but make sure we start off fresh each time.
  216. lint:            
  217.             $(RM) LINT.OUT; $(MAKE) -$(MAKEFLAGS) $(LINT_LIST)
  218.  
  219. clean:            
  220.             $(RM) $(UTIL_OBJ) $(BINARY_LIST)
  221.  
  222. # Dependencies and rules
  223. #    Dependencies and rules for compiling and linting C programs
  224. .PRECIOUS:        $(INCLDIR)/defs.h $(INCLDIR)/elm.h $(INCLDIR)/headers.h
  225.  
  226. $(BIN)/answer:        $(ANSWER_OBJ)
  227.             $(CC) $(LFLAGS) -o $@ $(ANSWER_OBJ) $(LIB2)
  228.  
  229. answer_lint:        $(ANSWER_SRC)
  230.             $(LINT) $(LINTFLAGS) $(ANSWER_SRC) >> LINT.OUT
  231.  
  232. $(BIN)/arepdaemon:    $(AREPDAEMON_OBJ)
  233.             $(CC) $(LFLAGS) -o $@ $(AREPDAEMON_OBJ) $(LIB2)
  234.  
  235. arepdaemon_lint:    $(AREPDAEMON_SRC)
  236.             $(LINT) $(LINTFLAGS) $(AREPDAEMON_SRC) >> LINT.OUT
  237.  
  238. $(BIN)/autoreply:    $(AUTOREPLY_OBJ)
  239.             $(CC) $(LFLAGS) -o $@ $(AUTOREPLY_OBJ) $(LIB2)
  240.  
  241. autoreply_lint:        $(AUTOREPLY_SRC)
  242.             $(LINT) $(LINTFLAGS) $(AUTOREPLY_SRC) >> LINT.OUT
  243.  
  244. $(BIN)/fastmail:    $(FASTMAIL_OBJ)
  245.             $(CC) $(LFLAGS) -o $@ $(FASTMAIL_OBJ) $(LIB2)
  246.  
  247. fastmail_lint:        $(FASTMAIL_SRC)
  248.             $(LINT) $(LINTFLAGS) $(FASTMAIL_SRC) >> LINT.OUT
  249.  
  250. $(BIN)/frm:        $(FRM_OBJ)
  251.             $(CC) $(LFLAGS) -o $@ $(FRM_OBJ) $(LIB2)
  252.  
  253. frm_lint:        $(FRM_SRC)
  254.             $(LINT) $(LINTFLAGS) $(FRM_SRC) >> LINT.OUT
  255.  
  256. $(BIN)/listalias:    $(LISTALIAS_OBJ)
  257.             $(CC) $(LFLAGS) -o $@ $(LISTALIAS_OBJ) $(LIB2)
  258.  
  259. listalias_lint:        $(LISTALIAS_SRC)
  260.             $(LINT) $(LINTFLAGS) $(LISTALIAS_SRC) >> LINT.OUT
  261.  
  262. $(BIN)/newalias:    $(NEWALIAS_OBJ)
  263.             $(CC) $(LFLAGS) -o $@ $(NEWALIAS_OBJ) $(LIB2)
  264.  
  265. newalias_lint:        $(NEWALIAS_SRC)
  266.             $(LINT) $(LINTFLAGS) $(NEWALIAS_SRC) >> LINT.OUT
  267.  
  268. $(BIN)/newmail:        $(NEWMAIL_OBJ)
  269.             $(CC) $(LFLAGS) -o $@ $(NEWMAIL_OBJ) $(LIB2)
  270.  
  271. newmail_lint:        $(NEWMAIL_SRC)
  272.             $(LINT) $(LINTFLAGS) $(NEWMAIL_SRC) >> LINT.OUT
  273.  
  274. $(BIN)/readmsg:        $(READMSG_OBJ)
  275.             $(CC) $(LFLAGS) -o $@ $(READMSG_OBJ) $(LIB2)
  276.  
  277. readmsg_lint:        $(READMSG_SRC)
  278.             $(LINT) $(LINTFLAGS) $(READMSG_SRC) >> LINT.OUT
  279.  
  280.  
  281. #    Rules to make shell scripts in bin directory
  282. $(BIN)/checkalias:    checkalias
  283.             $(CP) $? $@
  284.             $(CHMOD) u+w,a+rx $@
  285.  
  286. $(BIN)/messages:    messages
  287.             $(CP) $? $@
  288.             $(CHMOD) u+w,a+rx $@
  289.  
  290. $(BIN)/printmail:    printmail
  291.             $(CP) $? $@
  292.             $(CHMOD) u+w,a+rx $@
  293.  
  294. #    Dependencies of header files upon other header files they include
  295. $(INCLDIR)/defs.h:    $(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
  296.             $(CHMOD) u+w $@
  297.             $(TOUCH) $@
  298.  
  299. $(INCLDIR)/elm.h:    $(INCLDIR)/curses.h $(INCLDIR)/defs.h
  300.             $(CHMOD) u+w $@
  301.             $(TOUCH) $@
  302.  
  303. $(INCLDIR)/headers.h:    $(INCLDIR)/curses.h $(INCLDIR)/defs.h
  304.             $(CHMOD) u+w $@
  305.             $(TOUCH) $@
  306.  
  307. #    Rules to make objects from src directory
  308. ../src/opt_utils.o:
  309.             cd ../src; $(MAKE) -$(MAKEFLAGS) opt_utils.o
  310.  
  311. ../src/string2.o:
  312.             cd ../src; $(MAKE) -$(MAKEFLAGS) string2.o
  313.  
  314. ../src/validname.o:
  315.             cd ../src; $(MAKE) -$(MAKEFLAGS) validname.o
  316.  
  317. #    Dependencies of C object files
  318. answer.o:    $(INCLDIR)/defs.h
  319. arepdaem.o:    $(INCLDIR)/defs.h
  320. autoreply.o:    $(INCLDIR)/defs.h
  321. expand.o:    $(INCLDIR)/defs.h
  322. fastmail.o:    $(INCLDIR)/defs.h $(INCLDIR)/patchlevel.h
  323. from.o:        $(INCLDIR)/defs.h
  324. listalias.o:    $(INCLDIR)/defs.h $(INCLDIR)/sysdefs.h
  325. newalias.o:    $(INCLDIR)/defs.h $(INCLDIR)/sysdefs.h
  326. newmail.o:    $(INCLDIR)/defs.h
  327. readmsg.o:    $(INCLDIR)/defs.h
  328.  
  329. #    Dependencies and rules for installing programs from bin directory
  330. $(DEST)/answer:        $(BIN)/answer
  331.             -$(MV) $@ $@.old
  332.             -$(RM) $@.old
  333.             $(CP) $? $@
  334.             $(CHMOD) a+x $@
  335.  
  336. $(DEST)/arepdaemon:    $(BIN)/arepdaemon
  337.             -$(MV) $@ $@.old
  338.             -$(RM) $@.old
  339.             $(CP) $? $@
  340.             $(CHMOD) a+x $@
  341.  
  342. $(DEST)/autoreply:    $(BIN)/autoreply
  343.             -$(MV) $@ $@.old
  344.             -$(RM) $@.old
  345.             $(CP) $? $@
  346.             $(CHMOD) a+x $@
  347.             $(CHMOD) u+s $@
  348.  
  349. $(DEST)/checkalias:    $(BIN)/checkalias
  350.             -$(MV) $@ $@.old
  351.             -$(RM) $@.old
  352.             $(CP) $? $@
  353.             $(CHMOD) a+rx $@
  354.  
  355. $(DEST)/fastmail:    $(BIN)/fastmail
  356.             -$(MV) $@ $@.old
  357.             -$(RM) $@.old
  358.             $(CP) $? $@
  359.             $(CHMOD) a+x $@
  360.  
  361. $(DEST)/frm:        $(BIN)/frm
  362.             -$(MV) $@ $@.old
  363.             -$(RM) $@.old
  364.             $(CP) $? $@
  365.             $(CHMOD) a+x $@
  366.  
  367. $(DEST)/listalias:    $(BIN)/listalias
  368.             -$(MV) $@ $@.old
  369.             -$(RM) $@.old
  370.             $(CP) $? $@
  371.             $(CHMOD) a+x $@
  372.  
  373. $(DEST)/messages:    $(BIN)/messages
  374.             -$(MV) $@ $@.old
  375.             -$(RM) $@.old
  376.             $(CP) $? $@
  377.             $(CHMOD) a+rx $@
  378.  
  379. $(DEST)/newalias:    $(BIN)/newalias
  380.             -$(MV) $@ $@.old
  381.             -$(RM) $@.old
  382.             $(CP) $? $@
  383.             $(CHMOD) a+x $@
  384.  
  385. $(DEST)/newmail:    $(BIN)/newmail
  386.             -$(MV) $@ $@.old
  387.             -$(RM) $@.old
  388.             $(RM) $@
  389.             $(CP) $? $@
  390.             $(CHMOD) a+x $@
  391.  
  392. $(DEST)/printmail:    $(BIN)/printmail
  393.             -$(MV) $@ $@.old
  394.             -$(RM) $@.old
  395.             $(CP) $? $@
  396.             $(CHMOD) a+rx $@
  397.  
  398. $(DEST)/readmsg:    $(BIN)/readmsg
  399.             -$(MV) $@ $@.old
  400.             -$(RM) $@.old
  401.             $(CP) $? $@
  402.             $(CHMOD) a+x $@
  403.  
  404. $(DEST)/wnewmail:    $(DEST)/newmail
  405.             -$(MV) $@ $@.old
  406.             -$(RM) $@.old
  407.             $(RM) $@
  408.             $(LN) $? $@
  409.  
  410. !NO!SUBS!
  411.