Makequest 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. # $NetBSD: Makequest,v 1.2 1995/03/23 08:29:08 cgd Exp $
  2. #
  3. # Hack or Quest Makefile.
  4. # on some systems the termcap library is in -ltermcap
  5. TERMLIB = -ltermlib
  6. # make hack
  7. GAME = quest
  8. GAMEDIR = /usr/games/lib/questdir
  9. CFLAGS = -g -DQUEST
  10. HACKCSRC = hack.Decl.c\
  11. hack.apply.c hack.bones.c hack.c hack.cmd.c hack.do.c\
  12. hack.do_name.c hack.do_wear.c hack.dog.c hack.eat.c hack.end.c\
  13. hack.engrave.c hack.fight.c hack.invent.c hack.ioctl.c\
  14. hack.lev.c hack.main.c hack.makemon.c hack.mhitu.c\
  15. hack.mklev.c hack.mkmaze.c hack.mkobj.c hack.mkshop.c\
  16. hack.mon.c hack.monst.c hack.o_init.c hack.objnam.c\
  17. hack.options.c hack.pager.c hack.potion.c hack.pri.c\
  18. hack.read.c hack.rip.c hack.rumors.c hack.save.c\
  19. hack.search.c hack.shk.c hack.shknam.c hack.steal.c\
  20. hack.termcap.c hack.timeout.c hack.topl.c\
  21. hack.track.c hack.trap.c hack.tty.c hack.unix.c\
  22. hack.u_init.c hack.vault.c\
  23. hack.wield.c hack.wizard.c hack.worm.c hack.worn.c hack.zap.c\
  24. hack.version.c rnd.c alloc.c
  25. CSOURCES = $(HACKCSRC) makedefs.c
  26. HSOURCES = hack.h hack.mfndpos.h config.h\
  27. def.edog.h def.eshk.h def.flag.h def.func_tab.h def.gold.h\
  28. def.mkroom.h\
  29. def.monst.h def.obj.h def.objclass.h def.objects.h\
  30. def.permonst.h def.rm.h def.trap.h def.wseg.h
  31. SOURCES = $(CSOURCES) $(HSOURCES)
  32. AUX = data help hh rumors hack.6 hack.sh
  33. DISTR = $(SOURCES) $(AUX) READ_ME Makefile date.h hack.onames.h
  34. HOBJ = hack.Decl.o hack.apply.o hack.bones.o hack.o hack.cmd.o hack.do.o\
  35. hack.do_name.o hack.do_wear.o hack.dog.o hack.eat.o hack.end.o\
  36. hack.engrave.o hack.fight.o hack.invent.o hack.ioctl.o\
  37. hack.lev.o hack.main.o hack.makemon.o hack.mhitu.o hack.mklev.o\
  38. hack.mkmaze.o hack.mkobj.o hack.mkshop.o hack.mon.o\
  39. hack.monst.o hack.o_init.o hack.objnam.o hack.options.o\
  40. hack.pager.o hack.potion.o hack.pri.o\
  41. hack.read.o hack.rip.o hack.rumors.o hack.save.o\
  42. hack.search.o hack.shk.o hack.shknam.o hack.steal.o\
  43. hack.termcap.o hack.timeout.o hack.topl.o\
  44. hack.track.o hack.trap.o\
  45. hack.tty.o hack.unix.o hack.u_init.o hack.vault.o hack.wield.o\
  46. hack.wizard.o hack.worm.o hack.worn.o hack.zap.o\
  47. hack.version.o rnd.o alloc.o
  48. $(GAME): $(HOBJ) Makefile
  49. @echo "Loading ..."
  50. @ld -X -o $(GAME) /lib/crt0.o $(HOBJ) $(TERMLIB) -lc
  51. all: $(GAME) lint
  52. @echo "Done."
  53. makedefs: makedefs.c
  54. cc -o makedefs makedefs.c
  55. hack.onames.h: makedefs def.objects.h
  56. makedefs > hack.onames.h
  57. lint:
  58. # lint cannot have -p here because (i) capitals are meaningful:
  59. # [Ww]izard, (ii) identifiers may coincide in the first six places:
  60. # doweararm() versus dowearring().
  61. # _flsbuf comes from <stdio.h>, a bug in the system libraries.
  62. @echo lint -axbh -DLINT ...
  63. @lint -axbh -DLINT $(HACKCSRC) | sed '/_flsbuf/d'
  64. diff:
  65. @- for i in $(SOURCES) $(AUX) ; do \
  66. cmp -s $$i $D/$$i || \
  67. ( echo diff $D/$$i $$i ; diff $D/$$i $$i ; echo ) ; done
  68. distribution: Makefile
  69. @- for i in READ_ME $(SOURCES) $(AUX) Makefile date.h hack.onames.h\
  70. ; do \
  71. cmp -s $$i $D/$$i || \
  72. ( echo cp $$i $D ; cp $$i $D ) ; done
  73. # the distribution directory also contains the empty files perm and record.
  74. install:
  75. rm -f $(GAMEDIR)/$(GAME)
  76. cp $(GAME) $(GAMEDIR)/$(GAME)
  77. chmod 04511 $(GAMEDIR)/$(GAME)
  78. rm -f $(GAMEDIR)/bones*
  79. # cp hack.6 /usr/man/man6
  80. clean:
  81. rm -f *.o
  82. depend:
  83. # For the moment we are lazy and disregard /usr/include files because
  84. # the sources contain them conditionally. Perhaps we should use cpp.
  85. # ( /bin/grep '^#[ ]*include' $$i | sed -n \
  86. # -e 's,<\(.*\)>,"/usr/include/\1",' \
  87. #
  88. for i in ${CSOURCES}; do \
  89. ( /bin/grep '^#[ ]*include[ ]*"' $$i | sed -n \
  90. -e 's/[^"]*"\([^"]*\)".*/\1/' \
  91. -e H -e '$$g' -e '$$s/\n/ /g' \
  92. -e '$$s/.*/'$$i': &/' -e '$$s/\.c:/.o:/p' \
  93. >> makedep); done
  94. for i in ${HSOURCES}; do \
  95. ( /bin/grep '^#[ ]*include[ ]*"' $$i | sed -n \
  96. -e 's/[^"]*"\([^"]*\)".*/\1/' \
  97. -e H -e '$$g' -e '$$s/\n/ /g' \
  98. -e '$$s/.*/'$$i': &\
  99. touch '$$i/p \
  100. >> makedep); done
  101. @echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
  102. @echo '$$r makedep' >>eddep
  103. @echo 'w' >>eddep
  104. @cp Makefile Makefile.bak
  105. ed - Makefile < eddep
  106. @rm -f eddep makedep
  107. @echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
  108. @echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
  109. @echo '# see make depend above' >> Makefile
  110. - diff Makefile Makefile.bak
  111. @rm -f Makefile.bak
  112. # DO NOT DELETE THIS LINE
  113. hack.Decl.o: hack.h def.mkroom.h
  114. hack.apply.o: hack.h def.edog.h def.mkroom.h
  115. hack.bones.o: hack.h
  116. hack.o: hack.h
  117. hack.cmd.o: hack.h def.func_tab.h
  118. hack.do.o: hack.h
  119. hack.do_name.o: hack.h
  120. hack.do_wear.o: hack.h
  121. hack.dog.o: hack.h hack.mfndpos.h def.edog.h def.mkroom.h
  122. hack.eat.o: hack.h
  123. hack.end.o: hack.h
  124. hack.engrave.o: hack.h
  125. hack.fight.o: hack.h
  126. hack.invent.o: hack.h def.wseg.h
  127. hack.ioctl.o: config.h
  128. hack.lev.o: hack.h def.mkroom.h def.wseg.h
  129. hack.main.o: hack.h
  130. hack.makemon.o: hack.h
  131. hack.mhitu.o: hack.h
  132. hack.mklev.o: hack.h def.mkroom.h
  133. hack.mkmaze.o: hack.h def.mkroom.h
  134. hack.mkobj.o: hack.h
  135. hack.mkshop.o: hack.h def.mkroom.h def.eshk.h
  136. hack.mon.o: hack.h hack.mfndpos.h
  137. hack.monst.o: hack.h def.eshk.h
  138. hack.o_init.o: config.h def.objects.h hack.onames.h
  139. hack.objnam.o: hack.h
  140. hack.options.o: config.h hack.h
  141. hack.pager.o: hack.h
  142. hack.potion.o: hack.h
  143. hack.pri.o: hack.h def.wseg.h
  144. hack.read.o: hack.h
  145. hack.rip.o: hack.h
  146. hack.rumors.o: hack.h
  147. hack.save.o: hack.h
  148. hack.search.o: hack.h
  149. hack.shk.o: hack.h hack.mfndpos.h def.mkroom.h def.eshk.h
  150. hack.shknam.o: hack.h
  151. hack.steal.o: hack.h
  152. hack.termcap.o: config.h def.flag.h
  153. hack.timeout.o: hack.h
  154. hack.topl.o: hack.h
  155. hack.track.o: hack.h
  156. hack.trap.o: hack.h def.mkroom.h
  157. hack.tty.o: hack.h
  158. hack.unix.o: hack.h def.mkroom.h
  159. hack.u_init.o: hack.h
  160. hack.vault.o: hack.h def.mkroom.h
  161. hack.wield.o: hack.h
  162. hack.wizard.o: hack.h
  163. hack.worm.o: hack.h def.wseg.h
  164. hack.worn.o: hack.h
  165. hack.zap.o: hack.h
  166. hack.version.o: date.h
  167. hack.h: config.h def.objclass.h def.monst.h def.gold.h def.trap.h def.obj.h def.flag.h def.rm.h def.permonst.h hack.onames.h
  168. touch hack.h
  169. def.objects.h: config.h def.objclass.h
  170. touch def.objects.h
  171. # DEPENDENCIES MUST END AT END OF FILE
  172. # IF YOU PUT STUFF HERE IT WILL GO AWAY
  173. # see make depend above