home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Atari / Gnu / gdb36p4s.zoo / Makefile.dist < prev    next >
Makefile  |  1990-06-29  |  13KB  |  376 lines

  1. /* This file should be run through the C preprocessor by config.gdb
  2.    to produce the Makefile.  */
  3.  
  4. /* Define this to xgdb if you want to compile xgdb as well as gdb.  */
  5. XGDB=
  6. /* Place to install binaries.  */
  7. bindir=/usr/local/bin
  8. /* Place to install X binaries.  */
  9. xbindir=$(bindir)
  10.  
  11. /* System V: If you compile gdb with a compiler which uses the coff
  12.    encapsulation feature (this is a function of the compiler used, NOT
  13.    of the m-?.h file selected by config.gdb), you must make sure that
  14.    the GNU nm is the one that is used by munch.  */
  15.  
  16. /* If you are compiling with GCC, make sure that either 1) You use the
  17.  -traditional flag, or 2) You have the fixed include files where GCC
  18.  can reach them.  Otherwise the ioctl calls in inflow.c and readline.c 
  19.  will be incorrectly compiled.  The "fixincludes" script in the gcc
  20.  distribution will fix your include files up. */
  21. /* CC=gcc -traditional */
  22. CC=cc
  23.  
  24. /* It is also possible that you will need to add -I/usr/include/sys to the
  25.  CFLAGS section if your system doesn't have fcntl.h in /usr/include (which 
  26.  is where it should be according to Posix).  */
  27.  
  28. YACC=bison -y -v
  29. /* YACC=yacc */
  30. SHELL=/bin/sh
  31. MAKE=make
  32.  
  33. /* Set this up with gcc if you have gnu ld and the loader will print out
  34.  line numbers for undefinded refs.  */
  35. /* CC-LD=gcc -static */
  36. CC-LD=${CC}
  37.  
  38. /* If you are using the GNU C library, uncomment the following line.  */
  39. /* HAVE_VPRINTF_DEFINE = -DHAVE_VPRINTF */
  40.  
  41. /* -I. for "#include <obstack.h>".  Possibly regex.h also. */
  42.  
  43. /* M_CFLAGS, if defined, has system-dependent CFLAGS.  */
  44. #if !defined(M_CFLAGS)
  45. #define M_CFLAGS
  46. #endif
  47.  
  48. /* CFLAGS for both GDB and readline.  */
  49. GLOBAL_CFLAGS = -g M_CFLAGS
  50. CFLAGS = -I. ${HAVE_VPRINTF_DEFINE} ${GLOBAL_CFLAGS}
  51. /* None of the things in CFLAGS will do any harm, and on some systems
  52.    (e.g. SunOS4) it is important to use the M_CFLAGS.  */
  53. LDFLAGS = $(CFLAGS)
  54.  
  55. /*
  56.  define this to be "obstack.o" if you don't have the obstack library installed
  57.  you must at the same time define OBSTACK1 as "obstack.o" 
  58.  so that the dependencies work right.  Similarly with REGEX and "regex.o".
  59.  You must define REGEX and REGEX1 on USG machines.
  60.  If your sysyem is missing alloca(), or, more likely, it's there but
  61.  it doesn't work, define ALLOCA & ALLOCA1 */
  62. OBSTACK = obstack.o
  63. OBSTACK1 = obstack.o
  64.  
  65. #ifdef M_REGEX
  66. REGEX = M_REGEX
  67. REGEX1 = M_REGEX
  68. #else
  69. REGEX = 
  70. REGEX1 = 
  71. #endif
  72.  
  73. #ifdef M_ALLOCA
  74. ALLOCA = M_ALLOCA
  75. ALLOCA1 = M_ALLOCA
  76. #else
  77. ALLOCA = 
  78. ALLOCA1 =
  79. #endif
  80.  
  81. /*
  82.  define this to be "malloc.o" if you want to use the gnu malloc routine
  83.  (useful for debugging memory allocation problems in gdb).  Otherwise, leave
  84.  it blank. */
  85. /* GNU_MALLOC = */
  86. GNU_MALLOC = malloc.o
  87.  
  88. /* Flags to be used in compiling malloc.o
  89.  Specify range checking for storage allocation. */
  90. /* MALLOC_FLAGS = ${CFLAGS} */
  91. MALLOC_FLAGS = ${CFLAGS} -Drcheck -Dbotch=fatal_dump_core -DMSTATS
  92.  
  93. /*  Define SYSV if compiling on a system V or HP machine.  */
  94. #ifdef M_SYSV
  95. SYSV_DEFINE = -DSYSV
  96. #else
  97. SYSV_DEFINE =
  98. #endif
  99.  
  100. /* MUNCH_DEFINE should be -DSYSV if have System V-style nm,
  101.    or null if have BSD-style nm.  */ 
  102. #ifdef M_BSD_NM
  103. MUNCH_DEFINE = 
  104. #else
  105. MUNCH_DEFINE = ${SYSV_DEFINE}
  106. #endif
  107.  
  108. /* Flags that describe where you can find the termcap library.
  109.  You may need to make other arrangements for USG. */
  110. TERMCAP = -ltermcap
  111.  
  112. /* M_CLIBS, if defined, has system-dependent libs
  113.  For example, -lPW for System V to get alloca().  */
  114. #ifndef M_CLIBS
  115. #define M_CLIBS
  116. #endif
  117. CLIBS = ${ADD_FILES} ${TERMCAP} M_CLIBS
  118.  
  119. ADD_FILES = ${OBSTACK} ${REGEX} ${ALLOCA} ${GNU_MALLOC}
  120. ADD_DEPS = ${OBSTACK1} ${REGEX1} ${ALLOCA1} ${GNU_MALLOC}
  121.  
  122. SFILES = blockframe.c breakpoint.c dbxread.c coffread.c command.c core.c \
  123.      environ.c eval.c expprint.c findvar.c infcmd.c inflow.c infrun.c \
  124.      kdb-start.c main.c printcmd.c \
  125.      remote.c source.c stack.c standalone.c stuff.c symmisc.c symtab.c \
  126.      utils.c valarith.c valops.c valprint.c values.c version.c expread.y \
  127.      xgdb.c cplus-dem.c
  128.  
  129. DEPFILES = umax-dep.c gould-dep.c default-dep.c sun3-dep.c \
  130.        sparc-dep.c hp9k320-dep.c hp300bsd-dep.c news-dep.c i386-dep.c \
  131.        symmetry-dep.c convex-dep.c altos-dep.c isi-dep.c pyr-dep.c
  132.  
  133. PINSNS = gld-pinsn.c i386-pinsn.c sparc-pinsn.c vax-pinsn.c m68k-pinsn.c \
  134.      ns32k-pinsn.c convex-pinsn.c pyr-pinsn.c
  135.  
  136. HFILES = command.h defs.h environ.h expression.h frame.h getpagesize.h \
  137.      inferior.h symseg.h symtab.h value.h wait.h \
  138.      a.out.encap.h a.out.gnu.h stab.gnu.h 
  139.  
  140. OPCODES = m68k-opcode.h pn-opcode.h sparc-opcode.h npl-opcode.h vax-opcode.h \
  141.       ns32k-opcode.h convex-opcode.h pyr-opcode.h
  142.  
  143. MFILES = m-hp9k320.h m-hp300bsd.h m-i386.h m-i386gas.h \
  144.   m-i386-sv32.h m-i386g-sv32.h m-isi.h m-merlin.h \
  145.   m-altos.h m-news.h m-newsos3.h m-npl.h m-pn.h \
  146.   m-sparc.h m-sun2.h m-sun3.h m-sun2os4.h \
  147.   m-sun3os4.h m-sun4os4.h m-umax.h m-vax.h m-symmetry.h m-convex.h \
  148.   m-pyr.h
  149.  
  150. /* This list of files really shouldn't be in this makefile, but I can't think
  151.    of any good way to get the readline makefile to tell us what files
  152.    to put in our tarfile.  */
  153. READLINE = readline.c history.c funmap.c \
  154.   emacs_keymap.c vi_keymap.c vi_mode.c keymaps.c \
  155.   readline.h history.h keymaps.h chardefs.h \
  156.   inc-readline.texinfo inc-history.texinfo \
  157.   readline.texinfo history.texinfo \
  158.   Makefile ChangeLog
  159.  
  160. REMOTE_EXAMPLES = remote-sa.m68k.shar remote-multi.shar
  161.  
  162. POSSLIBS = obstack.h obstack.c regex.c regex.h malloc.c alloca.c
  163.  
  164. TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c
  165.  
  166. OTHERS = Makefile.dist createtags munch config.gdb ChangeLog README TAGS \
  167.      gdb.texinfo .gdbinit COPYING expread.tab.c stab.def \
  168.      XGDB-README copying.c Projects Convex.notes copying.awk hp-include
  169.  
  170. TAGFILES = ${SFILES} ${DEPFILES} ${PINSNS} ${HFILES} ${OPCODES} ${MFILES} \
  171.        ${POSSLIBS} 
  172. TARFILES = ${TAGFILES} ${OTHERS} ${REMOTE_EXAMPLES}
  173.  
  174. OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
  175.     values.o eval.o valops.o valarith.o valprint.o printcmd.o \
  176.     symtab.o symmisc.o coffread.o dbxread.o infcmd.o infrun.o remote.o \
  177.     command.o utils.o expread.o expprint.o pinsn.o environ.o version.o \
  178.     copying.o cplus-dem.o ${READLINEOBS}
  179.  
  180. TSOBS = core.o inflow.o dep.o
  181.  
  182. NTSOBS = standalone.o
  183.  
  184. TSSTART = /lib/crt0.o
  185.  
  186. NTSSTART = kdb-start.o
  187.  
  188. RL_LIB = readline/libreadline.a
  189.  
  190. /* Do some fancy trickery to produce a line like
  191.    -DM_MAKEDEFINE="-DM_SYSV -DM_BSD_NM".
  192. */
  193. MD=M_MAKEDEFINE
  194.  
  195. /* Avoid funny things that Sun's make throws in for us. */
  196. /* TARGET_ARCH is supposed to get around it putting in the machine type.
  197.    If the "things" up there really is plural, we'll need to do something
  198.    else as well.  */
  199. /*.c.o:
  200.     ${CC} -c ${CFLAGS} $< */
  201. TARGET_ARCH=
  202.  
  203. all: gdb $(XGDB)
  204.  
  205. install: gdb $(XGDB)
  206.     cp gdb $(bindir)/gdb.new
  207.     mv $(bindir)/gdb.new $(bindir)/gdb
  208.     -if [ "$(XGDB)" = xgdb ]; then \
  209.         cp xgdb $(xbindir)/xgdb.new; \
  210.         mv $(xbindir)/xgdb.new $(xbindir)xgdb; \
  211.     fi
  212.  
  213. gdb : $(OBS) $(TSOBS) ${ADD_DEPS} ${RL_LIB}
  214.     rm -f init.c
  215.     ./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
  216.     ${CC-LD} $(LDFLAGS) -o gdb init.c $(OBS) $(TSOBS) ${RL_LIB} $(CLIBS)
  217.  
  218. /* This is useful when debugging GDB, because Unix doesn't let you run GDB
  219.    on itself without copying the executable.  So "make gdb1" will make
  220.    gdb and put a copy in gdb1, and you can run it with "gdb gdb1".  */
  221. gdb1 : gdb
  222.     cp gdb gdb1
  223.  
  224. Makefile : Makefile.dist
  225.     cp Makefile.dist tmp.c
  226.     $(CC) -E >Makefile tmp.c $(MD) "-DM_MAKEDEFINE=$(MD)"
  227.     -rm tmp.c
  228. /* This did not work-- -Usparc became "-Usparc" became "-Usparc.
  229.    Or something like that.  */
  230. /*    $(CC) -E >Makefile tmp.c $(MD) "-DM_MAKEDEFINE=\"$(MD)\"" */
  231.  
  232. xgdb : $(OBS) $(TSOBS) xgdb.o ${ADD_DEPS} ${RL_LIB}
  233.     rm -f init.c
  234.     ./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) xgdb.o > init.c
  235.     $(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o \
  236.     -lXaw -lXmu -lXt -lX11 ${RL_LIB} $(CLIBS)
  237.  
  238. /* Old (pre R3) xgdb comp.
  239.     $(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o \
  240.     -lXaw -lXt -lX11 $(CLIBS) */
  241.  
  242. kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${RL_LIB}
  243.     rm -f init.c
  244.     ./munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
  245.     $(CC) $(LDFLAGS) -c init.c $(CLIBS) 
  246.     ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o ${RL_LIB} -lc $(CLIBS)
  247.  
  248. /* If it can figure out the appropriate order, createtags will make sure
  249.  that the proper m-*, *-dep, *-pinsn, and *-opcode files come first
  250.  in the tags list.  It will attempt to do the same for dbxread.c and 
  251.  coffread.c.  This makes using M-. on machine dependent routines much 
  252.  easier.  */
  253.  
  254. TAGS: ${TAGFILES}
  255.     createtags ${TAGFILES}
  256. tags: TAGS
  257.  
  258. gdb.tar: ${TARFILES}
  259.     rm -f gdb.tar
  260.     mkdir dist-gdb
  261.     cd dist-gdb ; for i in ${TARFILES} ; do ln -s ../$$i . ; done
  262.     mkdir dist-gdb/readline
  263.     cd dist-gdb/readline ; for i in ${READLINE} ; do ln -s ../../readline/$$i . ; done
  264.     tar chf gdb.tar dist-gdb
  265.     rm -rf dist-gdb
  266.  
  267. /* Remove gdb.tar.Z so stupid compress doesn't ask whether we want to
  268.    overwrite it.  compress -f is not what we want, because we do want
  269.    to know if compress would not make it smaller.  */
  270. gdb.tar.Z: gdb.tar
  271.     if [ -f gdb.tar.Z ]; then rm -f gdb.tar.Z; else true; fi
  272.     compress gdb.tar
  273.  
  274. clean:
  275.     rm -f ${OBS} ${TSOBS} ${NTSOBS} ${OBSTACK} ${REGEX} ${GNU_MALLOC}
  276.     rm -f init.c init.o
  277.     rm -f xgdb.o xgdb
  278.     rm -f gdb core gdb.tar gdb.tar.Z make.log
  279.     rm -f gdb[0-9]
  280.     cd readline ; make clean
  281.  
  282. distclean: clean expread.tab.c TAGS
  283.     rm -f dep.c opcode.h param.h pinsn.c config.status
  284.     rm -f y.output yacc.acts yacc.tmp
  285.     rm -f ${TESTS} Makefile
  286.  
  287. realclean: clean
  288.     rm -f expread.tab.c TAGS
  289.     rm -f dep.c opcode.h param.h pinsn.c config.status
  290.     rm -f Makefile
  291.  
  292. xgdb.o : defs.h param.h symtab.h frame.h
  293.  
  294. /* Make copying.c from COPYING */
  295. copying.c : COPYING copying.awk
  296.     awk -f copying.awk < COPYING > copying.c
  297.  
  298. expread.tab.c : expread.y
  299.     @echo 'Expect 4 shift/reduce conflict.'
  300.     ${YACC} expread.y
  301.     mv y.tab.c expread.tab.c
  302.  
  303. expread.o : expread.tab.c defs.h param.h symtab.h frame.h expression.h
  304.     $(CC) -c ${CFLAGS} expread.tab.c
  305.     mv expread.tab.o expread.o
  306.  
  307. readline/libreadline.a : force_update
  308.     cd readline ; ${MAKE} "SYSV=${SYSV_DEFINE}" \
  309.         "DEBUG_FLAGS=${GLOBAL_CFLAGS}" "CC=${CC}" libreadline.a
  310.  
  311. force_update :
  312.  
  313. /* this is for the g++ name demangling code */
  314. cplus-dem.o : cplus-dem.c
  315.     ${CC} -c -g -Dnounderscore cplus-dem.c
  316.  
  317. /* Only useful if you are using the gnu malloc routines.  */
  318. malloc.o : malloc.c
  319.     ${CC} -c ${MALLOC_FLAGS} malloc.c
  320.  
  321. /* dep.o depends on config.status in case someone reconfigures gdb out
  322.  from under an already compiled gdb.  */
  323. dep.o : dep.c config.status defs.h param.h frame.h inferior.h obstack.h \
  324.     a.out.encap.h
  325.  
  326. /* pinsn.o depends on config.status in case someone reconfigures gdb out
  327.  from under an already compiled gdb.  */
  328. pinsn.o : pinsn.c config.status defs.h param.h symtab.h obstack.h symseg.h \
  329.       frame.h opcode.h
  330.  
  331. /* The rest of this is a standard dependencies list (hand edited output of
  332.    cpp -M).  It does not include dependencies of .o files on .c files. */
  333. /* All files which depend on config.status also depend on param.h in case
  334.    someone reconfigures gdb out from under an already compiled gdb.  */
  335. blockframe.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h 
  336. breakpoint.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h
  337. coffread.o : defs.h param.h config.status 
  338. command.o : command.h defs.h
  339. core.o : defs.h  param.h config.status a.out.encap.h
  340. dbxread.o : param.h config.status defs.h symtab.h obstack.h symseg.h a.out.encap.h \
  341.         stab.gnu.h
  342. environ.o : environ.h 
  343. eval.o : defs.h  param.h config.status symtab.h obstack.h symseg.h value.h expression.h 
  344. expprint.o : defs.h symtab.h obstack.h symseg.h param.h config.status expression.h
  345. findvar.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h value.h 
  346. infcmd.o : defs.h  param.h config.status symtab.h obstack.h symseg.h frame.h inferior.h \
  347.        environ.h value.h
  348. inflow.o : defs.h  param.h config.status frame.h inferior.h
  349. infrun.o : defs.h  param.h config.status symtab.h obstack.h symseg.h frame.h inferior.h \
  350.        wait.h
  351. kdb-start.o : defs.h param.h config.status 
  352. main.o : defs.h  command.h param.h config.status
  353. malloc.o :  getpagesize.h
  354. obstack.o : obstack.h 
  355. printcmd.o :  defs.h param.h config.status frame.h symtab.h obstack.h symseg.h value.h \
  356.           expression.h 
  357. regex.o : regex.h 
  358. remote.o : defs.h  param.h config.status frame.h inferior.h wait.h
  359. source.o : defs.h  symtab.h obstack.h symseg.h param.h config.status
  360. stack.o :  defs.h param.h config.status symtab.h obstack.h symseg.h frame.h 
  361. standalone.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h \
  362.            inferior.h wait.h 
  363. symmisc.o : defs.h symtab.h obstack.h symseg.h obstack.h 
  364. symtab.o : defs.h  symtab.h obstack.h symseg.h param.h config.status  obstack.h
  365. utils.o : defs.h  param.h config.status 
  366. valarith.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h expression.h 
  367. valops.o :  defs.h param.h config.status symtab.h obstack.h symseg.h value.h frame.h \
  368.         inferior.h
  369. valprint.o :  defs.h param.h config.status symtab.h obstack.h symseg.h value.h 
  370. values.o :  defs.h param.h config.status symtab.h obstack.h symseg.h value.h 
  371.  
  372. robotussin.h : getpagesize.h   
  373. symtab.h : obstack.h symseg.h 
  374. a.out.encap.h : a.out.gnu.h
  375.  
  376.