home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / t / toaster.zip / Compat / Makefile < prev    next >
Makefile  |  1992-03-31  |  7KB  |  265 lines

  1. # This line is needed on some machines.
  2. MAKE=make
  3. #
  4. # Uncomment the next line if you are on a NeXT machine
  5. #NEXT=-DNeXT -bsd 
  6. #
  7. # Choose one of the following for your lexical analyzer
  8. #
  9. # This one is the old one that uses the C preprocessor.  uses .i files
  10. #
  11. #LEXICAL=lexical
  12. #
  13. # This one is faster, but can't handle complex #if's
  14. #
  15. LEXICAL=lex
  16. #
  17. # Chose one of these mallocs. 
  18. # This malloc is based on Lars', but faster.  It was written by
  19. # Satoria, of Darker Realms
  20. #
  21. MALLOC=smalloc
  22. #
  23. # Gnu malloc, fastest but uses most memory.
  24. #
  25. #MALLOC=gmalloc
  26. #
  27. # Boehm-Demers Garbage Collecting malloc package.
  28. #
  29. #MALLOC=gcmalloc
  30. #
  31. # Lars special malloc for LPmud. Uses least memory, but has an inefficient
  32. # recombination scheme that may slow down the game after long uptimes.
  33. #
  34. #MALLOC=malloc
  35. #
  36. # Use this "malloc" package if you are on a NeXT, or want to use the
  37. # system malloc.  sysmalloc.c is an empty file.
  38. #
  39. #MALLOC=sysmalloc
  40. #
  41. # Set MUD_LIB to the directory which contains the mud data. 
  42. #
  43. MUD_LIB = /local/mud/Lib/Compat/mudlib
  44. #
  45. # Set BINDIR to the directory where you want to install the executables.
  46. #
  47. BINDIR = /local/mud/Bin/Compat
  48. #
  49. # Define what random number generator to use.
  50. # If no one is specified, a guaranteed bad one will be used.
  51. # RANDOM (to use the random() system call) and DRAND48 (to use
  52. # the drand48() system call) are available.  For a NeXT, use
  53. # RANDOM.  If in doubt, do a 'man random' or a 'man drand48'
  54. # and see which is defined.
  55. RAND=DRAND48
  56. #
  57. # Flags to yacc.  probably don't need to be changed, but if you use 
  58. # bison, then take out the -d.
  59. #
  60. YFLAGS=-d
  61. #
  62. # Profiling information
  63. #
  64. PROFIL=
  65. #PROFIL=-p -DMARK
  66. #PROFIL=-pg
  67. #
  68. # Enable warnings from the compiler, if wanted.
  69. #
  70. WARN=
  71. #WARN= -Wall -Wshadow -Dlint
  72. #
  73. #  This is used for debugging, and unless you are trying to 
  74. #  debug code, don't define this. (It prints a trace of every
  75. #  instruction, so it's not feasible to have this to play the
  76. #  game with).
  77. #
  78. TRACE=
  79. #TRACE=-DTRACE_CODE
  80. #
  81. # Enable run time debugging. It will use more time and space.
  82. # When the flag is changed, be sure to recompile everything.
  83. # Simple comment out this line if not wanted.
  84. #
  85. #DEBUG=
  86. DEBUG=-DDEBUG
  87. #
  88. # These are the compiler flags.  The first is for cc, the second
  89. # is for gcc.
  90. #
  91. #FLAGS=-O -g -fstrength-reduce 
  92. FLAGS=-g
  93. #
  94. # Any extra compiler flags you wish to declare, put here.
  95. #
  96. #EXTRA=-DPORTNO=3000
  97. #
  98. MPATH=-DMUD_LIB='"$(MUD_LIB)"' 
  99. #
  100. # If you don't have 'strchr', then add next flag to CFLAGS.
  101. # -Dstrchr=index -Dstrrchr=rindex
  102. #
  103. # The BUG_FREE is for the stralloc package, and assumes that the
  104. # hashing functions are bug free.   -DSLOW_STATISTICS is for smalloc.c,
  105. # and should be taken out if you don't want the debugging information that
  106. # it provides.
  107. #
  108. CFLAGS= $(FLAGS) -D$(RAND) -DMALLOC_$(MALLOC) $(WARN) $(TRACE) $(PROFIL) $(DEBUG) $(MPATH) -DLEX_$(LEXICAL) -DBINDIR='"$(BINDIR)"' -DBUG_FREE $(EXTRA) $(NEXT) -DSLOW_STATISTICS
  109. #
  110. # Your compiler.  Use gcc if you have it, cc if you don't.
  111. #
  112. CC=cc
  113. #CC=gcc
  114. #
  115. # Add extra libraries here.
  116. #
  117. LIBS= -lm -lnet -lnsl_s -lndir
  118. MFLAGS = "BINDIR = $(BINDIR)" "MUD_LIB = $(MUD_LIB)" "MUDDIR = $(MUDDIR)"
  119. #
  120. # Add str.c here if you don't have memcpy() or strtol()
  121. # Uncomment the alloca.c if your system does not have alloca
  122. #
  123. SRC=$(LEXICAL).c main.c interpret.c simulate.c object.c backend.c \
  124.     comm1.c ed.c regexp.c wiz_list.c swap.c $(MALLOC).c call_out.c array.c \
  125.     parse.c otable.c dumpstat.c stralloc.c hash.c indentp.c port.c \
  126.     text.c memused.c vpopen.c access_check.c clilib.c \
  127.     prelang.y postlang.y simul_efun.c alloca.c
  128. #
  129. # Add str.o here if you don't have memcpy() or strtol()
  130. # Uncomment the alloca.o if your system does not have alloca
  131. #
  132. OBJ=lang.o $(LEXICAL).o main.o interpret.o simulate.o object.o backend.o \
  133.     comm1.o ed.o regexp.o wiz_list.o swap.o $(MALLOC).o call_out.o array.o \
  134.     parse.o otable.o dumpstat.o stralloc.o hash.o indentp.o port.o \
  135.     text.o memused.o vpopen.o access_check.o clilib.o simul_efun.o alloca.o
  136.  
  137. driver: $(OBJ) make_func 
  138.     $(CC) $(CFLAGS) $(OBJ) -o driver $(LIBS)
  139.  
  140. all:    driver utils 
  141.  
  142. list_funcs:
  143.     @$(CC) -E $(CFLAGS) func_spec.c
  144.  
  145. make_func.c: make_func.y
  146.     /local/monitors/risner/bin/yacc make_func.y
  147.     mv y.tab.c make_func.c
  148.  
  149. make_func: make_func.o
  150.     $(CC) make_func.o -o make_func
  151.  
  152. make_func.o: config.h
  153.  
  154. install: driver 
  155.     install -c $? $(BINDIR)/parse
  156.  
  157. install.utils:
  158.     (cd util; $(MAKE) $(MFLAGS) install)
  159.  
  160. utils:    
  161.     (cd util; $(MAKE) $(MFLAGS))
  162.  
  163. parse: driver
  164.     -mv parse parse.old
  165.     cp driver parse
  166.  
  167. LPmud.doc: LPmud.doc.me        # Does also depend on lfun_efun.me
  168.     nroff -me LPmud.doc.me > LPmud.doc
  169.  
  170. lfun_efun.me:: make_docs
  171.  
  172. lfun_efun.me::
  173.     make_docs lfun_efun.me
  174.  
  175. make_docs: make_docs.o
  176.     $(CC) make_docs.o -o make_docs
  177.  
  178. lint: *.c
  179.     lint *.c
  180.  
  181. gcmalloc.o:
  182.     cd gc; make "CFLAGS=-g -DLPMUD" gc.a
  183.     rm -f gcmalloc.o
  184.     ln -s gc/gc.a gcmalloc.o
  185.  
  186. call_out.o: object.h interpret.h
  187.  
  188. swap.o: swap.c object.h config.h interpret.h exec.h
  189.  
  190. lang.o: lang.c config.h object.h interpret.h exec.h instrs.h switch.h
  191.  
  192. lang.c lang.h: lang.y
  193.     /local/monitors/risner/bin/yacc -d lang.y
  194.     mv y.tab.c lang.c
  195.     mv y.tab.h lang.h
  196.  
  197. lexical.o: lexical.c config.h
  198.  
  199. lexical.c: lexical.l
  200.  
  201. interpret.o: interpret.h config.h object.h instrs.h exec.h patchlevel.h \
  202.     switch.h lang.h
  203.  
  204. simulate.o: interpret.h object.h config.h sent.h wiz_list.h exec.h lang.h
  205.  
  206. wiz_list.o: wiz_list.h interpret.h
  207.  
  208. main.o: config.h object.h interpret.h lex.h
  209.  
  210. clean:
  211.     -rm -f *.o lang.h lang.c lexical.c mon.out *.ln tags
  212.     -rm -f parse driver core frontend mudlib/core TAGS 
  213.     -rm -f config.status lpmud.log
  214.     (cd util ; echo "Cleaning in util." ; $(MAKE) clean)
  215.  
  216. frontend: comm2.o frontend.o
  217.     $(CC) $(CFLAGS) comm2.o frontend.o -o frontend $(LIBS)
  218.  
  219. tags: $(SRC)
  220.     ctags $(SRC)
  221.  
  222. TAGS: $(SRC)
  223.     etags $(SRC)
  224.  
  225. count_active: count_active.o
  226.     $(CC) count_active.o -o count_active
  227.  
  228. object.o: interpret.h object.h sent.h config.h wiz_list.h exec.h
  229.  
  230. backend.o: object.h config.h interpret.h wiz_list.h exec.h
  231.  
  232. comm1.o: comm.h sent.h interpret.h object.h config.h mudwho.h patchlevel.h
  233.  
  234. clilib.o: config.h
  235.  
  236. comm2.o: config.h comm.h
  237.  
  238. frontend.o: frontend.c config.h comm.h
  239.  
  240. ed.o: regexp.h object.h config.h interpret.h exec.h
  241.  
  242. regexp.o: regexp.h
  243.  
  244. otable.o: config.h object.h interpret.h
  245.  
  246. dumpstat.o: object.h interpret.h exec.h
  247.  
  248. parse_old.o: interpret.h config.h object.h wiz_list.h
  249.  
  250. parse.o: interpret.h config.h object.h wiz_list.h
  251.  
  252. stralloc.o: config.h
  253.  
  254. lex.o: config.h instrs.h interpret.h exec.h efun_defs.c lang.h lex.h
  255.  
  256. array.o: interpret.h object.h config.h wiz_list.h regexp.h
  257.  
  258. access_check.o: config.h
  259.  
  260. lang.y efun_defs.c: func_spec.c make_func prelang.y postlang.y config.h
  261.     ./make_func > efun_defs.c
  262.  
  263. simul_efun.o: interpret.h object.h exec.h
  264.