home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume12 / torus / part01 / Makefile < prev    next >
Makefile  |  1991-05-15  |  6KB  |  197 lines

  1. # Makefile written by Paul Pomes, University of Illinois,
  2. # Computing Services Office
  3. #
  4. # Copyright (C) 1986 by Paul Pomes and the University of Illinois Board
  5. # of Trustees
  6. #
  7. # This Makefile is distributed in the hope that it will be useful,
  8. # but without any warranty.  No author or distributor accepts
  9. # responsibility to anyone for the consequences of using it or for
  10. # whether it serves any particular purpose or works at all, unless
  11. # s/he says so in writing.
  12. #
  13. # Everyone is granted permission to copy, modify and redistribute
  14. # this Makefile under the following conditions:
  15. #
  16. #    Permission is granted to anyone to make or distribute copies
  17. #    of Makefile source code, either as received or modified, in any
  18. #    medium, provided that all copyright notices, permission and
  19. #    nonwarranty notices are preserved, and that the distributor
  20. #    grants the recipient permission for further redistribution as
  21. #    permitted by this document, and gives him and points out to
  22. #    him an exact copy of this document to inform him of his rights.
  23. #
  24. #    Permission is granted to distribute this Makefile in compiled
  25. #    or executable form under the same conditions applying for
  26. #    source code, provided that either
  27. #    A. it is accompanied by the corresponding machine-readable
  28. #       source code, or
  29. #    B. it is accompanied by a written offer, with no time limit,
  30. #       to give anyone a machine-readable copy of the corresponding
  31. #       source code in return for reimbursement of the cost of
  32. #       distribution.  This written offer must permit verbatim
  33. #       duplication by anyone.
  34. #    C. it is distributed by someone who received only the
  35. #       executable form, and is accompanied by a copy of the
  36. #       written offer of source code which he received along with it.
  37. #
  38. # In other words, you are welcome to use, share and improve this
  39. # Makefile.  You are forbidden to forbid anyone else to use, share
  40. # and improve what you give them.   Help stamp out software-hoarding!
  41. #
  42. # UUCP:     {ihnp4,seismo}!uiucuxc!paul
  43. # Internet: paul@uxc.cso.uiuc.edu   BITNET: paul@uiucuxc
  44. # MILNET:   paul@uiucuxc.arpa       CSNET:  paul%uxc@uiuc.csnet
  45. # US Mail:  Univ of Illinois, CSO, 1304 W Springfield Ave, Urbana, IL  61801
  46.  
  47. # .PREFIXES:    ./RCS
  48. .SUFFIXES:    .c,v .h,v .y,v
  49.  
  50. CC     = cc
  51. CO     = co
  52. RM     = /bin/rm -f
  53.  
  54. HOF_FILE= ${DESTLIB}/robots2_hof
  55. TMP_FILE= ${DESTLIB}/robots2_tmp
  56. T_HOF_FILE= ${DESTLIB}/torus_hof
  57. T_TMP_FILE= ${DESTLIB}/torus_tmp
  58.  
  59. # -DBSD42 provides big performance win
  60.  
  61. DEFS   = -DBSD42 -DHOF_FILE='"${HOF_FILE}"' -DTMP_FILE='"${TMP_FILE}"' -DT_HOF_FILE='"${T_HOF_FILE}"' -DT_TMP_FILE='"${T_TMP_FILE}"'
  62. CFLAGS = ${DEFS} -O
  63. FFLAGS = ${DEFS}
  64. PFLAGS = ${DEFS}
  65. LFLAGS = 
  66. YFLAGS = 
  67. LDFLAGS= 
  68. LIBS   = -lcurses -ltermcap
  69.  
  70. DESTBIN= /home/oak/grad/tadpole/topology
  71. DESTETC= /home/oak/grad/tadpole/topology/etc
  72. DESTLIB= /home/oak/grad/tadpole/topology/lib
  73. MS     = l
  74.  
  75.  
  76. HDRS   = robots.h
  77. SRCS   = good.c main.c opt.c robot.c score.c user.c
  78. OBJS   = good.o main.o opt.o robot.o score.o user.o
  79. VERS   = 
  80.  
  81. .c,v.o:
  82.     ${CO} -q $*.c
  83.     ${CC} ${CFLAGS} -c $*.c
  84.     ${RM} $*.c
  85.  
  86. .c,v.c:
  87.     ${CO} -q $*.c
  88.  
  89. .h,v.h:
  90.     ${CO} -q $*.h
  91.  
  92. .y,v.y:
  93.     ${CO} -q $*.y
  94.  
  95. all:    torus
  96.  
  97. torus:    ${OBJS}
  98.     ${CC} -o torus ${LDFLAGS} ${OBJS} ${LIBS}
  99.  
  100. install:    torus
  101.     install -s -m 2511 -g games torus ${DESTBIN}
  102.     touch ${HOF_FILE} ${TMP_FILE}
  103.     chmod 664 ${HOF_FILE} ${TMP_FILE}
  104.     chgrp games ${HOF_FILE} ${TMP_FILE}
  105.     touch ${T_HOF_FILE} ${T_TMP_FILE}
  106.     chmod 664 ${T_HOF_FILE} ${T_TMP_FILE}
  107.     chgrp games ${T_HOF_FILE} ${T_TMP_FILE}
  108.     install -c -m 444 torus.6 ${MANDIR}/torus.${MS}
  109.  
  110. uninstall:    /tmp
  111.     rm -f ${DESTBIN}/torus \
  112.         ${MANDIR}/torus.${MS} ${CATDIR}/torus.${MS} \
  113.         ${HOF_FILE} ${TMP_FILE}
  114.  
  115. lint:    ${HDRS} ${SRCS}
  116.     lint -habx ${DEFS} ${SRCS}
  117.  
  118. shar:    ${HDRS} ${SRCS} ${OTHERS}
  119.     shar ${HDRS} ${SRCS} ${OTHERS} > torus.shar
  120.  
  121. tags:    ${HDRS} ${SRCS}
  122.     ctags ${HDRS} ${SRCS}
  123.  
  124. clean:
  125.     @echo "Removing object and junk files."
  126.     rm -f robots2 *.o core a.out make.log lint.out Makefile.bak torus.shar
  127.  
  128. clobber:
  129.     @echo "Removing read-only source files that have RCS parents."
  130.     @echo "Error code 1 indicates last file in SRCS list was not removed."
  131.     @echo "(Which is OK)"
  132.     make clean
  133.     -if [ `whoami` != root ]; then \
  134.        for i in ${HDRS} ${SRCS}; do \
  135.           if [ ! -w $$i ]; then \
  136.              ( if   [ -f $$i,v ];     then rm -f $$i; \
  137.                elif [ -f RCS/$$i,v ]; then rm -f $$i; \
  138.              fi ); \
  139.           else echo $$i "writeable, not removed"; \
  140.           fi; \
  141.        done; \
  142.     else echo "Running \"make clobber\" as root will zap ALL SRCS,\
  143.         RCS'ed or not (not done)."; \
  144.     fi
  145.  
  146. compress:
  147.     make clean
  148.     @echo "Compressing source and RCS files."
  149.     find . -size +2 \( -name \*.h -o -name \*.c -o -name \*.f \
  150.         -o -name \*.p -o -name \*.l -o -name \*.y -o -name \*,v \) \
  151.         -exec compress {} \;
  152.  
  153. uncompress:
  154.     uncompressdir .
  155.  
  156. # RCS stuff
  157.  
  158. ci:        ${HDRS} ${SRCS}
  159.         -ci $?
  160.         @touch ci
  161.  
  162. coall:
  163.         co -l ${HDRS} ${SRCS}
  164.  
  165. update:
  166.         ci -sDist -u -f${VERS} ${HDRS} ${SRCS}
  167.         @touch ci
  168.  
  169. depend:
  170.     grep '^#[     ]*include' /dev/null ${SRCS} \
  171.         | sed -e '/"/s/:[^"]*"\([^"]*\)".*/: \1/' \
  172.               -e '/</s/:[^<]*<\([^>]*\)>.*/: \/usr\/include\/\1/' \
  173.         | sed -e 's/\.c:/.o:/' -e 's/\.p:/.o:/' \
  174.             -e 's/\.y:/.o:/' -e 's/\.l:/.o:/' >makedep
  175.     echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
  176.     echo '$$r makedep' >>eddep
  177.     echo 'w' >>eddep
  178.     cp Makefile Makefile.bak
  179.     ed - Makefile < eddep
  180.     rm eddep makedep
  181.     echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
  182.     echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
  183.     echo '# see make depend above' >> Makefile
  184.  
  185. # DO NOT DELETE THIS LINE -- make depend uses it
  186.  
  187. good.o: robots.h
  188. main.o: robots.h
  189. main.o: /usr/include/sys/stat.h
  190. opt.o: robots.h
  191. robot.o: robots.h
  192. score.o: robots.h
  193. user.o: robots.h
  194. # DEPENDENCIES MUST END AT END OF FILE
  195. # IF YOU PUT STUFF HERE IT WILL GO AWAY
  196. # see make depend above
  197.