[gnu.gdb.bug] minor Makefile bug

johns@MACONDO.CCSF.CALTECH.EDU (John Salmon) (02/22/90)

On Decstations, and possibly other systems, malloc, and
free are provided by libX11.a.  Thus, placing malloc.o
after -lX11 in the Makefile generates an error during
linkage.  The following patch fixes the problem, by not
incorporating $(ADD_FILES) into $(CLIB) in the Makefile.

diff -c Makefile.dist Makefile.dist-dist
*** Makefile.dist	Wed Feb 21 10:55:41 1990
--- Makefile.dist-orig	Wed Feb 21 10:34:36 1990
***************
*** 114,120 ****
  #ifndef M_CLIBS
  #define M_CLIBS
  #endif
! CLIBS = ${TERMCAP} M_CLIBS
  
  ADD_FILES = ${OBSTACK} ${REGEX} ${ALLOCA} ${GNU_MALLOC}
  ADD_DEPS = ${OBSTACK1} ${REGEX1} ${ALLOCA1} ${GNU_MALLOC}
--- 114,120 ----
  #ifndef M_CLIBS
  #define M_CLIBS
  #endif
! CLIBS = ${ADD_FILES} ${TERMCAP} M_CLIBS
  
  ADD_FILES = ${OBSTACK} ${REGEX} ${ALLOCA} ${GNU_MALLOC}
  ADD_DEPS = ${OBSTACK1} ${REGEX1} ${ALLOCA1} ${GNU_MALLOC}
***************
*** 213,220 ****
  gdb : $(OBS) $(TSOBS) ${ADD_DEPS} ${RL_LIB}
  	rm -f init.c
  	./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
! 	${CC-LD} $(LDFLAGS) -o gdb init.c $(OBS) $(TSOBS) $(ADD_FILES) \
! 	${RL_LIB} $(CLIBS)
  
  /* This is useful when debugging GDB, because Unix doesn't let you run GDB
     on itself without copying the executable.  So "make gdb1" will make
--- 213,219 ----
  gdb : $(OBS) $(TSOBS) ${ADD_DEPS} ${RL_LIB}
  	rm -f init.c
  	./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
! 	${CC-LD} $(LDFLAGS) -o gdb init.c $(OBS) $(TSOBS) ${RL_LIB} $(CLIBS)
  
  /* This is useful when debugging GDB, because Unix doesn't let you run GDB
     on itself without copying the executable.  So "make gdb1" will make
***************
*** 233,239 ****
  xgdb : $(OBS) $(TSOBS) xgdb.o ${ADD_DEPS} ${RL_LIB}
  	rm -f init.c
  	./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) xgdb.o > init.c
! 	$(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o $(ADD_FILES)\
  	-lXaw -lXmu -lXt -lX11 ${RL_LIB} $(CLIBS)
  
  /* Old (pre R3) xgdb comp.
--- 232,238 ----
  xgdb : $(OBS) $(TSOBS) xgdb.o ${ADD_DEPS} ${RL_LIB}
  	rm -f init.c
  	./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) xgdb.o > init.c
! 	$(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o \
  	-lXaw -lXmu -lXt -lX11 ${RL_LIB} $(CLIBS)
  
  /* Old (pre R3) xgdb comp.
***************
*** 243,251 ****
  kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${RL_LIB}
  	rm -f init.c
  	./munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
! 	$(CC) $(LDFLAGS) -c init.c $(ADD_FILES) $(CLIBS) 
! 	ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \
! 	${RL_LIB} -lc $(CLIBS)
  
  /* If it can figure out the appropriate order, createtags will make sure
   that the proper m-*, *-dep, *-pinsn, and *-opcode files come first
--- 242,249 ----
  kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${RL_LIB}
  	rm -f init.c
  	./munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
! 	$(CC) $(LDFLAGS) -c init.c $(CLIBS) 
! 	ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o ${RL_LIB} -lc $(CLIBS)
  
  /* If it can figure out the appropriate order, createtags will make sure
   that the proper m-*, *-dep, *-pinsn, and *-opcode files come first