home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / binutils-2.7-src.tgz / tar.out / fsf / binutils / ld / Makefile.in < prev    next >
Makefile  |  1996-09-28  |  39KB  |  1,058 lines

  1. # Makefile for the GNU linker ld (version 2)
  2. # Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
  3. # Free Software Foundation, Inc.
  4.  
  5. # This file is part of GNU ld.
  6.  
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18.  
  19.  
  20. VPATH = @srcdir@
  21. srcdir = @srcdir@
  22. objdir = .
  23.  
  24. target_alias = @target_alias@
  25. prefix = @prefix@
  26.  
  27. program_transform_name = @program_transform_name@
  28. exec_prefix = @exec_prefix@
  29. bindir = @bindir@
  30. libdir = @libdir@
  31. tooldir = $(exec_prefix)/$(target_alias)
  32. datadir = @datadir@
  33. mandir = @mandir@
  34. man1dir = $(mandir)/man1
  35. man2dir = $(mandir)/man2
  36. man3dir = $(mandir)/man3
  37. man4dir = $(mandir)/man4
  38. man5dir = $(mandir)/man5
  39. man6dir = $(mandir)/man6
  40. man7dir = $(mandir)/man7
  41. man8dir = $(mandir)/man8
  42. man9dir = $(mandir)/man9
  43. infodir = @infodir@
  44. includedir = @includedir@
  45.  
  46. # We put the scripts in the directory $(scriptdir)/ldscripts.
  47. # We can't put the scripts in $(datadir) because the SEARCH_DIR
  48. # directives need to be different for native and cross linkers.
  49. scriptdir = $(tooldir)/lib
  50.  
  51. SHELL = /bin/sh
  52.  
  53. INSTALL = `cd $(srcdir); pwd`/../install.sh -c
  54. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  55. INSTALL_DATA = @INSTALL_DATA@
  56. INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
  57. INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1
  58.  
  59. AR = ar
  60. AR_FLAGS = qv
  61. CC = @CC@
  62. CFLAGS = @CFLAGS@
  63. LDFLAGS = @LDFLAGS@
  64. HLDFLAGS = @HLDFLAGS@
  65. RPATH_ENVVAR = @RPATH_ENVVAR@
  66. MAKEINFO = makeinfo
  67. TEXI2DVI = texi2dvi
  68. RANLIB = ranlib
  69. BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
  70. LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ;  else echo flex ; fi`
  71.  
  72. EMUL = @EMUL@
  73. EMULATION_OFILES = @EMULATION_OFILES@
  74.  
  75. # Search path to override the default search path for -lfoo libraries.
  76. # If LIB_PATH is empty, the ones in the script (if any) are left alone.
  77. # (The default is usually /lib:/usr/lib:/usr/local/lib, unless building
  78. # a cross-linker, in which case the default is empty.  See genscripts.sh.)
  79. # Otherwise, they are replaced with the ones given in LIB_PATH,
  80. # which may have the form: LIB_PATH=/lib:/usr/local/lib
  81. LIB_PATH = $(exec_prefix)/os-lib:$(exec_prefix)/lib
  82.  
  83. BASEDIR = $(srcdir)/..
  84. BFDDIR = $(BASEDIR)/bfd
  85. INCDIR    = $(BASEDIR)/include
  86. INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR)
  87. DEP = mkdep
  88.  
  89. # What version of the manual to build
  90. DOCVER = gen
  91.  
  92. # Where to find texinfo.tex to format docn with TeX
  93. TEXIDIR = $(srcdir)/../texinfo
  94.  
  95. # Where to find other docs needed to format with TeX
  96. TEXINPUTS = $(TEXIDIR):$(BFDDIR)/doc:$(srcdir)
  97.  
  98. # Whether to get roff to put indexing entries on stderr
  99. TEXI2OPT =
  100. # You neeed this to generate ld-index.ms (or .mm or .me)
  101. # TEXI2OPT = -i
  102.  
  103. TEXI2ROFF=texi2roff
  104.  
  105. # Which roff program to use to generate index for texi2roff'd doc
  106. ROFF = groff
  107.  
  108. #stuff for self hosting (can be overridden in config file).
  109. HOSTING_CRT0 = @HOSTING_CRT0@
  110. HOSTING_LIBS = @HOSTING_LIBS@
  111. HOSTING_EMU = -m $(EMUL)
  112.  
  113. # These were used by `make check-cdtest'
  114. #
  115. #CXX = `if [ -f ../gcc/xgcc ] ; then \
  116. #            echo ../gcc/xgcc -B../gcc/; \
  117. #        else echo gcc; \
  118. #        fi`
  119. #CXXFLAGS = -fgnu-linker
  120. #
  121. # FIX_ME: using ../gcc/xgcc breaks the cdtest. 
  122. #CXX = g++
  123.  
  124. # Setup the testing framework, if you have one
  125. EXPECT = `if [ -f $$r/../expect/expect ] ; \
  126.     then echo $$r/../expect/expect ; \
  127.     else echo expect ; fi`
  128.  
  129. RUNTEST = `if [ -f $${srcroot}/../dejagnu/runtest ] ; \
  130.     then echo $${srcroot}/../dejagnu/runtest ; \
  131.     else echo runtest ; fi`
  132.  
  133. RUNTESTFLAGS =
  134.  
  135. CC_FOR_TARGET = ` \
  136.   if [ -f $$r/../gcc/xgcc ] ; then \
  137.     if [ -f $$r/../newlib/Makefile ] ; then \
  138.       echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
  139.     else \
  140.       echo $$r/../gcc/xgcc -B$$r/../gcc/; \
  141.     fi; \
  142.   else \
  143.     if [ "@host@" = "@target@" ] ; then \
  144.       echo $(CC); \
  145.     else \
  146.       echo gcc | sed '$(program_transform_name)'; \
  147.     fi; \
  148.   fi`
  149.  
  150. CXX = gcc
  151. CXX_FOR_TARGET = ` \
  152.   if [ -f $$r/../gcc/xgcc ] ; then \
  153.     if [ -f $$r/../newlib/Makefile ] ; then \
  154.       echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
  155.     else \
  156.       echo $$r/../gcc/xgcc -B$$r/../gcc/; \
  157.     fi; \
  158.   else \
  159.     if [ "@host@" = "@target@" ] ; then \
  160.       echo $(CXX); \
  161.     else \
  162.       echo gcc | sed '$(program_transform_name)'; \
  163.     fi; \
  164.   fi`
  165.  
  166. # go directly to ld.new in case this ld isn't capable of
  167. # linking native object on this host.  It can be renamed on
  168. # install.
  169. LD_PROG    = ld.new
  170.  
  171. all: $(LD_PROG)
  172. .PHONY: all
  173.  
  174. LINTFLAGS = $(INCLUDES) $(EXTRA_DEF) 
  175.  
  176. # The .cc suffix was used by `make check-cdtest'.
  177.  
  178. .SUFFIXES: .y $(SUFFIXES) .cc
  179.  
  180. # Suppress smart makes who think they know how to automake Yacc files
  181. .y.c:
  182.  
  183. # This rule was used for the check-cdtest target.
  184. #.cc.o:
  185. #    $(CXX) -c -I$(srcdir) $(CXXFLAGS) $(CFLAGS) $<
  186.  
  187. ALL_CFLAGS = $(INCLUDES) @HDEFINES@ $(CFLAGS)
  188. .c.o:
  189.     $(CC) -c $(ALL_CFLAGS) $<
  190.  
  191. BFDDEP = ../bfd/libbfd.a
  192. BFDLIB = @BFDLIB@
  193. LIBIBERTY = ../libiberty/libiberty.a
  194.  
  195. ALL_EMULATIONS = \
  196.     ea29k.o \
  197.     eaixppc.o \
  198.     eaixrs6.o \
  199.     eamiga.o \
  200.     eamiga_bss.o \
  201.     ealpha.o \
  202.     earmaoutb.o \
  203.     earmaoutl.o \
  204.     earmcoff.o \
  205.     earmpe.o \
  206.     ecoff_sparc.o \
  207.     edelta68.o \
  208.     eebmon29k.o \
  209.     eelf32_sparc.o \
  210.     eelf32b4300.o \
  211.     eelf32bmip.o \
  212.     eelf32ebmip.o \
  213.     eelf32elmip.o \
  214.     eelf32l4300.o \
  215.     eelf32lmip.o \
  216.     eelf32lppc.o \
  217.     eelf32ppc.o \
  218.     eelf64alpha.o \
  219.     eelf64_sparc.o \
  220.     eelf_i386.o \
  221.     egld960.o \
  222.     egld960coff.o \
  223.     ego32.o \
  224.     eh8300.o \
  225.     eh8300h.o \
  226.     eh8500.o \
  227.     eh8500b.o \
  228.     eh8500c.o \
  229.     eh8500m.o \
  230.     eh8500s.o \
  231.     ehp300bsd.o \
  232.     ehp3hpux.o \
  233.     ehppaelf.o \
  234.     ei386aout.o \
  235.     ei386bsd.o \
  236.     ei386coff.o \
  237.     ei386go32.o \
  238.     ei386linux.o \
  239.     ei386lynx.o \
  240.     ei386mach.o \
  241.     ei386moss.o \
  242.     ei386msdos.o \
  243.     ei386nbsd.o \
  244.     ei386nw.o \
  245.     ei386pe.o \
  246.     elnk960.o \
  247.     em68k4knbsd.o \
  248.     em68kaout.o \
  249.     em68kaux.o \
  250.     em68kcoff.o \
  251.     em68kelf.o \
  252.     em68klinux.o \
  253.     em68klynx.o \
  254.     em68knbsd.o \
  255.     em68kpsos.o \
  256.     em88kbcs.o \
  257.     emipsbig.o \
  258.     emipsbsd.o \
  259.     emipsidt.o \
  260.     emipsidtl.o \
  261.     emipslit.o \
  262.     enews.o \
  263.     ens32knbsd.o \
  264.     epc532macha.o \
  265.     eppcamiga.o \
  266.     eppcamiga_bss.o \
  267.     eppcmacos.o \
  268.     eppcnw.o \
  269.     eppcpe.o \
  270.     eriscix.o \
  271.     esa29200.o \
  272.     esh.o \
  273.     eshl.o \
  274.     esparcaout.o \
  275.     esparclynx.o \
  276.     esparcnbsd.o \
  277.     est2000.o \
  278.     esun3.o \
  279.     esun4.o \
  280.     evanilla.o \
  281.     evax.o \
  282.     evsta.o \
  283.     ew65.o \
  284.     ez8001.o \
  285.     ez8002.o
  286.  
  287. CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
  288.     ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
  289.     mri.c ldcref.c
  290.  
  291. HFILES = config.h ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
  292.     ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
  293.     ldwrite.h mri.h
  294.  
  295. GENERATED_CFILES = ldgram.c ldlex.c
  296. GENERATED_HFILES = ldgram.h ldemul-list.h
  297.  
  298. OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
  299.     ldwrite.o ldexp.o  ldemul.o ldver.o ldmisc.o \
  300.     ldfile.o ldcref.o ${EMULATION_OFILES}
  301.  
  302. LINTSOURCES = $(CFILES) $(GENERATED_CFILES) e*.c
  303.  
  304. STAGESTUFF = *.o ldscripts/* e*.c
  305.  
  306. info: ld.info
  307. .PHONY: info
  308.  
  309. ldgram.c: ldgram.y
  310.     $(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y
  311.     mv -f y.tab.c ldgram.c
  312.     mv -f y.tab.h ldgram.h
  313.  
  314. # Separate from ldgram.c so that a parallel make doesn't try to build
  315. # both ldgram.c and ldgram.h simultaneously.
  316. ldgram.h: ldgram.c
  317.  
  318. ldmain.o: ldmain.c config.status
  319.     $(CC) -c -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' $(ALL_CFLAGS) $<
  320.  
  321. ldemul-list.h: Makefile
  322.     (echo "/* This file is automatically generated.  DO NOT EDIT! */";\
  323.     for f in `echo " " ${EMULATION_OFILES} "" \
  324.      | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
  325.         echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
  326.     done;\
  327.     echo "";\
  328.     echo "#define EMULATION_LIST \\";\
  329.     for f in `echo " " ${EMULATION_OFILES} "" \
  330.      | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
  331.         echo "  &ld_$${f}_emulation, \\"; \
  332.     done;\
  333.     echo "  0") >ldemul-tmp.h
  334.     mv ldemul-tmp.h ldemul-list.h
  335.  
  336. ldlex.c: ldlex.l
  337.     $(LEX) -I -Cem $(srcdir)/ldlex.l
  338.     -sed -e '/^int.*free();/d' \
  339.          -e '/^char.*malloc();/d' \
  340.          -e 's/malloc/xmalloc/g' \
  341.       < lex.yy.c > ldlex.c.new
  342.     -rm lex.yy.c
  343.     mv ldlex.c.new ./ldlex.c
  344.  
  345. # These all start with e so 'make clean' can find them.
  346.  
  347. GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@" "$(LIB_PATH)"
  348. GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
  349. @TDIRS@
  350.  
  351. eamiga.c: $(srcdir)/emulparams/amiga.sh\
  352.    $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS} 
  353.     ${GENSCRIPTS} amiga "$(tdir_amiga)"
  354. eamiga_bss.c: $(srcdir)/emulparams/amiga_bss.sh\
  355.    $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
  356.     ${GENSCRIPTS} amiga_bss "$(tdir_amiga_bss)"
  357. eppcamiga.c: $(srcdir)/emulparams/ppcamiga.sh\
  358.    $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS} 
  359.     ${GENSCRIPTS} ppcamiga "$(tdir_ppcamiga)"
  360. eppcamiga_bss.c: $(srcdir)/emulparams/ppcamiga_bss.sh\
  361.    $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
  362.     ${GENSCRIPTS} ppcamiga_bss "$(tdir_ppcamiga_bss)"
  363. ea29k.c: $(srcdir)/emulparams/a29k.sh \
  364.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
  365.     ${GENSCRIPTS} a29k "$(tdir_a29k)"
  366. eaixppc.c: $(srcdir)/emulparams/aixppc.sh \
  367.   $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
  368.     ${GENSCRIPTS} aixppc "$(tdir_aixppc)"
  369. eaixrs6.c: $(srcdir)/emulparams/aixrs6.sh \
  370.   $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
  371.     ${GENSCRIPTS} aixrs6 "$(tdir_aixrs6)"
  372. ealpha.c: $(srcdir)/emulparams/alpha.sh \
  373.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS}
  374.     ${GENSCRIPTS} alpha "$(tdir_alpha)"
  375. earmaoutb.c:    $(srcdir)/emulparams/armaoutb.sh \
  376.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
  377.     ${GENSCRIPTS} armaoutb "$(tdir_armaoutb)"
  378. earmaoutl.c:    $(srcdir)/emulparams/armaoutl.sh \
  379.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
  380.     ${GENSCRIPTS} armaoutl "$(tdir_armaoutl)"
  381. earmcoff.c:    $(srcdir)/emulparams/armcoff.sh \
  382.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armcoff.sc ${GEN_DEPENDS}
  383.     ${GENSCRIPTS} armcoff "$(tdir_armcoff)"
  384. earmpe.c: $(srcdir)/emulparams/armpe.sh \
  385.   $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
  386.     ${GENSCRIPTS} armpe "$(tdir_armpe)"
  387. ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
  388.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
  389.     ${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)"
  390. edelta68.c: $(srcdir)/emulparams/delta68.sh \
  391.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS}
  392.     ${GENSCRIPTS} delta68 "$(tdir_delta68)"
  393. eebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
  394.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
  395.     ${GENSCRIPTS} ebmon29k "$(tdir_ebmon29k)"
  396. eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
  397.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  398.     ${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
  399. eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
  400.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  401.     ${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
  402. eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
  403.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfmips.sc ${GEN_DEPENDS}
  404.     ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
  405. eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
  406.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfmips.sc ${GEN_DEPENDS}
  407.     ${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
  408. eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
  409.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfmips.sc ${GEN_DEPENDS}
  410.     ${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
  411. eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
  412.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  413.     ${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
  414. eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
  415.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfmips.sc ${GEN_DEPENDS}
  416.     ${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
  417. eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
  418.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
  419.     ${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
  420. eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
  421.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
  422.     ${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
  423. eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
  424.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  425.     ${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
  426. eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
  427.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  428.     ${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)"
  429. eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
  430.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  431.     ${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
  432. egld960.c: $(srcdir)/emulparams/gld960.sh \
  433.   $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
  434.     ${GENSCRIPTS} gld960 "$(tdir_gld960)"
  435. egld960coff.c: $(srcdir)/emulparams/gld960coff.sh \
  436.   $(srcdir)/emultempl/gld960c.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
  437.     ${GENSCRIPTS} gld960coff "$(tdir_gld960coff)"
  438. ego32.c: $(srcdir)/emulparams/go32.sh \
  439.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  440.     ${GENSCRIPTS} go32 "$(tdir_go32)"
  441. eh8300.c: $(srcdir)/emulparams/h8300.sh \
  442.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
  443.     ${GENSCRIPTS} h8300 "$(tdir_h8300)"
  444. eh8300h.c: $(srcdir)/emulparams/h8300h.sh \
  445.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
  446.     ${GENSCRIPTS} h8300h "$(tdir_h8300h)"
  447. eh8500.c: $(srcdir)/emulparams/h8500.sh \
  448.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
  449.     ${GENSCRIPTS} h8500 "$(tdir_h8500)"
  450. eh8500b.c: $(srcdir)/emulparams/h8500b.sh \
  451.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500b.sc ${GEN_DEPENDS}
  452.     ${GENSCRIPTS} h8500b "$(tdir_h8500b)"
  453. eh8500c.c: $(srcdir)/emulparams/h8500c.sh \
  454.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500c.sc ${GEN_DEPENDS}
  455.     ${GENSCRIPTS} h8500c "$(tdir_h8500c)"
  456. eh8500m.c: $(srcdir)/emulparams/h8500m.sh \
  457.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500m.sc ${GEN_DEPENDS}
  458.     ${GENSCRIPTS} h8500m "$(tdir_h8500m)"
  459. eh8500s.c: $(srcdir)/emulparams/h8500s.sh \
  460.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500s.sc ${GEN_DEPENDS}
  461.     ${GENSCRIPTS} h8500s "$(tdir_h8500s)"
  462. ehp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
  463.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  464.     ${GENSCRIPTS} hp300bsd "$(tdir_hp300bsd)"
  465. ehp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
  466.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  467.     ${GENSCRIPTS} hp3hpux "$(tdir_hp3hpux)"
  468. ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
  469.   $(srcdir)/emultempl/hppaelf.em $(srcdir)/scripttempl/hppaelf.sc ${GEN_DEPENDS}
  470.     ${GENSCRIPTS} hppaelf "$(tdir_hppaelf)"
  471. ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
  472.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  473.     ${GENSCRIPTS} i386aout "$(tdir_i386aout)"
  474. ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
  475.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  476.     ${GENSCRIPTS} i386bsd "$(tdir_i386bsd)"
  477. ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
  478.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
  479.     ${GENSCRIPTS} i386coff "$(tdir_i386coff)"
  480. ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
  481.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
  482.     ${GENSCRIPTS} i386go32 "$(tdir_i386go32)"
  483. ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
  484.   $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  485.     ${GENSCRIPTS} i386linux "$(tdir_i386linux)"
  486. ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \
  487.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386lynx.sc ${GEN_DEPENDS}
  488.     ${GENSCRIPTS} i386lynx "$(tdir_i386lynx)"
  489. ei386mach.c: $(srcdir)/emulparams/i386mach.sh \
  490.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  491.     ${GENSCRIPTS} i386mach "$(tdir_i386mach)"
  492. ei386moss.c: $(srcdir)/emulparams/i386moss.sh \
  493.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  494.     ${GENSCRIPTS} i386moss "$(tdir_i386moss)"
  495. ei386msdos.c: $(srcdir)/emulparams/i386msdos.sh \
  496.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386msdos.sc ${GEN_DEPENDS}
  497.     ${GENSCRIPTS} i386msdos "$(tdir_i386msdos)"
  498. ei386nbsd.c:    $(srcdir)/emulparams/i386nbsd.sh \
  499.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  500.     ${GENSCRIPTS} i386nbsd "$(tdir_i386nbsd)"
  501. ei386nw.c:    $(srcdir)/emulparams/i386nw.sh \
  502.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
  503.     ${GENSCRIPTS} i386nw "$(tdir_i386nw)"
  504. ei386pe.c: $(srcdir)/emulparams/i386pe.sh \
  505.   $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
  506.     ${GENSCRIPTS} i386pe "$(tdir_i386pe)"
  507. elnk960.c: $(srcdir)/emulparams/lnk960.sh \
  508.   $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
  509.     ${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
  510. em68k4knbsd.c:    $(srcdir)/emulparams/m68k4knbsd.sh \
  511.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  512.     ${GENSCRIPTS} m68k4knbsd "$(tdir_m68k4knbsd)"
  513. em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \
  514.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  515.     ${GENSCRIPTS} m68kaout "$(tdir_m68kaout)"
  516. em68kaux.c: $(srcdir)/emulparams/m68kaux.sh \
  517.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kaux.sc ${GEN_DEPENDS}
  518.     ${GENSCRIPTS} m68kaux "$(tdir_m68kaux)"
  519. em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
  520.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
  521.     ${GENSCRIPTS} m68kcoff "$(tdir_m68kcoff)"
  522. em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
  523.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  524.     ${GENSCRIPTS} m68kelf "$(tdir_m68kelf)"
  525. em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
  526.   $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  527.     ${GENSCRIPTS} m68klinux "$(tdir_m68klinux)"
  528. em68klynx.c: $(srcdir)/emulparams/m68klynx.sh \
  529.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68klynx.sc ${GEN_DEPENDS}
  530.     ${GENSCRIPTS} m68klynx "$(tdir_m68klynx)"
  531. em68knbsd.c:    $(srcdir)/emulparams/m68knbsd.sh \
  532.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  533.     ${GENSCRIPTS} m68knbsd "$(tdir_m68knbsd)"
  534. em68kpsos.c:    $(srcdir)/emulparams/m68kpsos.sh \
  535.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/psos.sc ${GEN_DEPENDS}
  536.     ${GENSCRIPTS} m68kpsos "$(tdir_m68kpsos)"
  537. em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
  538.   $(srcdir)/emultempl/m88kbcs.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
  539.     ${GENSCRIPTS} m88kbcs "$(tdir_m88kbcs)"
  540. emipsbig.c:  $(srcdir)/emulparams/mipsbig.sh \
  541.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
  542.     ${GENSCRIPTS} mipsbig
  543. emipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
  544.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mipsbsd.sc ${GEN_DEPENDS}
  545.     ${GENSCRIPTS} mipsbsd
  546. emipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
  547.   $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
  548.     ${GENSCRIPTS} mipsidt "$(tdir_mipsidt)"
  549. emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
  550.   $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
  551.     ${GENSCRIPTS} mipsidtl "$(tdir_mipsidtl)"
  552. emipslit.c:  $(srcdir)/emulparams/mipslit.sh \
  553.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
  554.     ${GENSCRIPTS} mipslit "$(tdir_mipslit)"
  555. enews.c: $(srcdir)/emulparams/news.sh \
  556.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  557.     ${GENSCRIPTS} news "$(tdir_news)"
  558. ens32knbsd.c:    $(srcdir)/emulparams/ns32knbsd.sh \
  559.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  560.     ${GENSCRIPTS} ns32knbsd "$(tdir_ns32knbsd)"
  561. epc532macha.c: $(srcdir)/emulparams/pc532macha.sh \
  562.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  563.     ${GENSCRIPTS} pc532macha "$(tdir_pc532macha)"
  564. eppcmacos.c:    $(srcdir)/emulparams/ppcmacos.sh \
  565.   $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
  566.     ${GENSCRIPTS} ppcmacos "$(tdir_ppcmacos)"
  567. eppcnw.c:    $(srcdir)/emulparams/ppcnw.sh \
  568.   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
  569.     ${GENSCRIPTS} ppcnw "$(tdir_ppcnw)"
  570. eppcpe.c: $(srcdir)/emulparams/ppcpe.sh \
  571.   $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/ppcpe.sc ${GEN_DEPENDS}
  572.     ${GENSCRIPTS} ppcpe "$(tdir_ppcpe)"
  573. eriscix.c: $(srcdir)/emulparams/riscix.sh \
  574.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  575.     ${GENSCRIPTS} riscix "$(tdir_riscix)"
  576. esa29200.c: $(srcdir)/emulparams/sa29200.sh \
  577.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
  578.     ${GENSCRIPTS} sa29200 "$(tdir_sa29200)"
  579. esh.c: $(srcdir)/emulparams/sh.sh \
  580.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
  581.     ${GENSCRIPTS} sh "$(tdir_sh)"
  582. eshl.c: $(srcdir)/emulparams/shl.sh \
  583.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
  584.     ${GENSCRIPTS} shl "$(tdir_shl)"
  585. esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
  586.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  587.     ${GENSCRIPTS} sparcaout "$(tdir_sparcaout)"
  588. esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \
  589.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparclynx.sc ${GEN_DEPENDS}
  590.     ${GENSCRIPTS} sparclynx "$(tdir_sparclynx)"
  591. esparcnbsd.c:    $(srcdir)/emulparams/sparcnbsd.sh \
  592.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  593.     ${GENSCRIPTS} sparcnbsd "$(tdir_sparcnbsd)"
  594. est2000.c: $(srcdir)/emulparams/st2000.sh \
  595.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
  596.     ${GENSCRIPTS} st2000 "$(tdir_st2000)"
  597. esun3.c: $(srcdir)/emulparams/sun3.sh \
  598.   $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  599.     ${GENSCRIPTS} sun3 "$(tdir_sun3)"
  600. esun4.c: $(srcdir)/emulparams/sun4.sh \
  601.   $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  602.     ${GENSCRIPTS} sun4 "$(tdir_sun4)"
  603. evanilla.c: $(srcdir)/emulparams/vanilla.sh \
  604.   $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
  605.     ${GENSCRIPTS} vanilla "$(tdir_vanilla)"
  606. evax.c: $(srcdir)/emulparams/vax.sh \
  607.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  608.     ${GENSCRIPTS} vax "$(tdir_vax)"
  609. evsta.c: $(srcdir)/emulparams/vsta.sh \
  610.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  611.     ${GENSCRIPTS} vsta "$(tdir_vsta)"
  612. ew65.c: $(srcdir)/emulparams/w65.sh \
  613.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS}
  614.     ${GENSCRIPTS} w65 "$(tdir_w65)"
  615. ez8001.c: $(srcdir)/emulparams/z8001.sh \
  616.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
  617.     ${GENSCRIPTS} z8001 "$(tdir_z8001)"
  618. ez8002.c: $(srcdir)/emulparams/z8002.sh \
  619.   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
  620.     ${GENSCRIPTS} z8002 "$(tdir_z8002)"
  621.  
  622. $(LD_PROG): $(OFILES) $(BFDDEP) $(LIBIBERTY)
  623.     $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(EXTRALIBS)
  624.  
  625. # The generated emulation files mostly have the same dependencies.
  626. $(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
  627.   ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \
  628.   ldctor.h ldexp.h ldlang.h ldgram.h
  629.  
  630. # These targets are for the dejagnu testsuites. The file site.exp 
  631. # contains global variables that all the testsuites will use.
  632.  
  633. site.exp: ./config.status Makefile
  634.     @echo "Making a new config file..."
  635.     @rm -f ./tmp?
  636.     @touch site.exp
  637.     @mv site.exp site.bak
  638.     @echo "## variables are automatically generated by make ##" > ./tmp0
  639.     @echo "# Do not edit here. If you wish to override these" >> ./tmp0
  640.     @echo "# values, add them to the last section" >> ./tmp0
  641.     @echo "# HOST AND TARGET INFO" >> ./tmp0
  642.     @echo "set host_os @host_os@" >> ./tmp0
  643.     @echo "set host_alias @host_alias@" >> ./tmp0
  644.     @echo "set host_cpu @host_cpu@" >> ./tmp0
  645.     @echo "set host_vendor @host_vendor@" >> ./tmp0
  646.     @echo "set target_os @target_os@" >> ./tmp0
  647.     @echo "set target_alias @target_alias@" >> ./tmp0
  648.     @echo "set target_cpu @target_cpu@" >> ./tmp0
  649.     @echo "set target_vendor @target_vendor@" >> ./tmp0
  650.     @echo "set host_triplet @host@" >> ./tmp0
  651.     @echo "set target_triplet @target@" >> ./tmp0
  652.     @echo "# DIRECTORY INFO" >> ./tmp0
  653.     @echo "set objdir `pwd`" >> ./tmp0
  654.     @echo "" >> ./tmp0    
  655.     @echo "# LD DEPENDENCIES" >> ./tmp0    
  656.     @echo "set OFILES \"$(OFILES)\"" >> ./tmp0
  657.     @echo "set BFDLIB \"$(BFDLIB)\"" >> ./tmp0
  658.     @echo "set LIBIBERTY \"$(LIBIBERTY)\"" >> ./tmp0
  659.     @echo "set HOSTING_EMU \"$(HOSTING_EMU)\"" >> ./tmp0
  660.     @echo "set HOSTING_CRT0 \"$(HOSTING_CRT0)\"" >> ./tmp0
  661.     @echo "set HOSTING_LIBS \"$(HOSTING_LIBS)\"" >> ./tmp0
  662.     @echo "" >> ./tmp0    
  663.     @echo "## Variables generated by configure. Do Not Edit ##" >> ./tmp0
  664.     @cat ./tmp0 > site.exp
  665.     @cat site.bak | sed \
  666.             -e '1,/^## Variables generated by.*##/ d' >> site.exp
  667.     -@rm -f ./tmp?
  668.  
  669. check: site.exp
  670.     r=`pwd`; export r; \
  671.     srcroot=`cd ${srcdir}; pwd` ; export srcroot ; \
  672.     EXPECT=${EXPECT} ; export EXPECT ; \
  673.     $(RPATH_ENVVAR)=$$r/../bfd:$$r/../opcodes:$$$(RPATH_ENVVAR); \
  674.     export $(RPATH_ENVVAR); \
  675.     if [ -f $$r/../expect/expect ] ; then  \
  676.        TCL_LIBRARY=$${srcroot}/../tcl/library ; \
  677.        export TCL_LIBRARY ; \
  678.     else true ; fi ; \
  679.     $(RUNTEST) --tool ld --srcdir $(srcdir)/testsuite $(RUNTESTFLAGS) \
  680.       CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
  681.       CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
  682.       CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)"
  683.  
  684. installcheck:
  685. .PHONY: check installcheck
  686.  
  687. # Rules for testing by relinking ld itself.
  688. # A similar test is in the testsuite.  This target is for ease of use
  689. # when porting ld.
  690.  
  691. ld-partial.o: ld.new
  692.     ./ld.new $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
  693. ld1: ld-partial.o
  694.     ./ld.new $(HOSTING_EMU) -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
  695.  
  696. ld1-full: ld.new
  697.     ./ld.new $(HOSTING_EMU) -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
  698.  
  699. ld2: ld1
  700.     ./ld1 $(HOSTING_EMU) -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
  701.  
  702. ld3: ld2
  703.     ./ld2 $(HOSTING_EMU) -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
  704.  
  705. bootstrap: ld3
  706.     cmp ld2 ld3
  707.  
  708. .PHONY: bootstrap
  709.  
  710. # A test program for C++ constructors and destructors.
  711. # This test is now in the testsuite.
  712. #
  713. #cdtest: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
  714. #    ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
  715. #      cdtest-main.o cdtest-bar.o cdtest-foo.o $(HOSTING_LIBS)
  716. #
  717. #cdtest.out: cdtest
  718. #    ./cdtest > cdtest.tmp
  719. #    mv cdtest.tmp cdtest.out
  720. #
  721. #cdtest-ur.o: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
  722. #    ./ld.new $(HOSTING_EMU) -o cdtest-ur.o -Ur cdtest-main.o \
  723. #      cdtest-bar.o cdtest-foo.o
  724. #
  725. #cdtest-ur: cdtest-ur.o
  726. #    ./ld.new $(HOSTING_EMU) -o cdtest-ur $(HOSTING_CRT0) cdtest-ur.o \
  727. #      $(HOSTING_LIBS)
  728. #
  729. #cdtest-ur.out: cdtest-ur
  730. #    ./cdtest-ur > cdtest-ur.tmp
  731. #    mv cdtest-ur.tmp cdtest-ur.out
  732. #
  733. #check-cdtest: cdtest.out cdtest-ur.out $(srcdir)/cdtest.exp
  734. #    diff $(srcdir)/cdtest.exp cdtest.out
  735. #    diff $(srcdir)/cdtest.exp cdtest-ur.out
  736. #
  737. #.PHONY: check-cdtest
  738.  
  739. # END OF CHECK TARGETS
  740.  
  741. # DOCUMENTATION TARGETS
  742. # Manual configuration file; not usually attached to normal configuration,
  743. # because almost all configs use "gen" version of manual.
  744. #  Set DOCVER above to change.
  745. configdoc.texi:    ${DOCVER}-doc.texi
  746.     ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
  747.     ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
  748.     cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
  749.  
  750. # TeX output
  751. dvi: ld.dvi
  752. ld.dvi: $(srcdir)/ld.texinfo configdoc.texi $(BFDDIR)/doc/bfdsumm.texi
  753.     TEXINPUTS=$(BFDDIR)/doc:$$TEXINPUTS $(TEXI2DVI) $(srcdir)/ld.texinfo
  754.  
  755. ldint.dvi: $(srcdir)/ldint.texinfo
  756.     $(TEXI2DVI) $(srcdir)/ldint.texinfo
  757.  
  758. # info file for online browsing
  759. ld.info: $(srcdir)/ld.texinfo configdoc.texi $(BFDDIR)/doc/bfdsumm.texi
  760.     $(MAKEINFO) -I$(BFDDIR)/doc -o ld.info $(srcdir)/ld.texinfo
  761.  
  762. ldint.info: $(srcdir)/ldint.texinfo
  763.     $(MAKEINFO) -o ldint.info $(srcdir)/ldint.texinfo
  764.  
  765. .PHONY: dvi
  766.  
  767. #separate targets for "ms", "me", and "mm" forms of roff doc
  768. # Try to use a recent texi2roff.  v2 was put on prep in jan91.
  769. # If you want an index, see texi2roff doc for postprocessing 
  770. # and add -i to texi2roff invocations below.
  771. # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
  772. #    correspondint -e lines when later texi2roff's are current)
  773. # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
  774. # + @c's deleted explicitly because texi2roff sees texinfo commands in them
  775. # + @   (that's at-BLANK) not recognized by texi2roff, turned into blank
  776. # + @alphaenumerate is ridiculously new, turned into @enumerate
  777.  
  778. ld.ms: $(srcdir)/ld.texinfo
  779.     sed -e '/\\input texinfo/d' \
  780.         -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
  781.         -e '/^@ifinfo/,/^@end ifinfo/d' \
  782.         -e '/^@c/d' \
  783.         -e 's/{.*,,/{/' \
  784.         -e 's/@ / /g' \
  785.         -e 's/^@alphaenumerate/@enumerate/g' \
  786.         -e 's/^@end alphaenumerate/@end enumerate/g' \
  787.         $(srcdir)/ld.texinfo | \
  788.     $(TEXI2ROFF) $(TEXI2OPT) -ms | \
  789.     sed -e 's/---/\\(em/g' \
  790.         >>ld.ms 
  791.  
  792. # index for roff output
  793. ld-index.ms: ld.ms
  794.     $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \
  795.         sed -e '/: warning:/d' | \
  796.         texi2index >ld-index.ms
  797.  
  798. # roff output (-mm)
  799. ld.mm: $(srcdir)/ld.texinfo
  800.     sed -e '/\\input texinfo/d' \
  801.         -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
  802.         -e '/^@ifinfo/,/^@end ifinfo/d' \
  803.         -e '/^@c/d' \
  804.         -e 's/{.*,,/{/' \
  805.         -e '/@noindent/d' \
  806.         -e 's/@ / /g' \
  807.         -e 's/^@alphaenumerate/@enumerate/g' \
  808.         -e 's/^@end alphaenumerate/@end enumerate/g' \
  809.         $(srcdir)/ld.texinfo | \
  810.     $(TEXI2ROFF) $(TEXI2OPT) -mm | \
  811.     sed -e 's/---/\\(em/g' \
  812.     >ld.mm 
  813.  
  814. # index for roff output
  815. ld-index.mm: ld.mm
  816.     $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \
  817.         sed -e '/: warning:/d' | \
  818.         texi2index >ld-index.mm
  819.  
  820. # roff output (-me)
  821. ld.me: $(srcdir)/ld.texinfo
  822.     sed -e '/\\input texinfo/d' \
  823.         -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
  824.         -e '/^@ifinfo/,/^@end ifinfo/d' \
  825.         -e '/^@c/d' \
  826.         -e 's/{.*,,/{/' \
  827.         -e 's/@ / /g' \
  828.         -e 's/^@alphaenumerate/@enumerate/g' \
  829.         -e 's/^@end alphaenumerate/@end enumerate/g' \
  830.         $(srcdir)/ld.texinfo | \
  831.     $(TEXI2ROFF) $(TEXI2OPT) -me | \
  832.     sed -e 's/---/\\(em/g' \
  833.         >>ld.me 
  834.  
  835. # index for roff output
  836. ld-index.me: ld.me
  837.     $(ROFF) -me ld.me 2>&1 1>/dev/null | \
  838.         sed -e '/: warning:/d' | \
  839.         texi2index >ld-index.me
  840.  
  841. stage1:    force
  842.     -mkdir stage1
  843.     -mv -f $(STAGESTUFF) $(LD_PROG) stage1
  844.     -(cd stage1 ; ln -s $(LD_PROG) ld)
  845.  
  846. stage2:    force
  847.     -mkdir stage2
  848.     -mv -f $(STAGESTUFF) $(LD_PROG) stage2
  849.     -(cd stage2 ; ln -s $(LD_PROG) ld)
  850.  
  851. stage3:    force
  852.     -mkdir stage3
  853.     -mv -f $(STAGESTUFF) $(LD_PROG) stage3
  854.     -(cd stage3 ; ln -s $(LD_PROG) ld)
  855.  
  856. against = stage2
  857.  
  858. comparison: force
  859.     for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done
  860.  
  861. de-stage1: force
  862.     -(cd stage1 ; mv -f * ..)
  863.     -rm ld
  864.     -rmdir stage1
  865.  
  866. de-stage2: force
  867.     -(cd stage2 ; mv -f * ..)
  868.     -rm ld
  869.     -rmdir stage2
  870.  
  871. de-stage3: force
  872.     -(cd stage3 ; mv -f * ..)
  873.     -rm ld
  874.     -rmdir stage3
  875.  
  876. .PHONY: stage1 stage2 stage3 comparison de-stage1 de-stage2 de-stage3
  877.  
  878. # Stuff that should be included in a distribution:
  879. LDDISTSTUFF = ldgram.c ldgram.h ldlex.c
  880. diststuff: $(LDDISTSTUFF) info
  881.  
  882. mostlyclean:
  883.     -rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp] config.log
  884.     -rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out cdtest.tmp
  885.     -rm -f cdtest-ur cdtest-ur.out cdtest-ur.tmp crtbegin.o crtend.o
  886.     -rm -f ldemul-list.h
  887.     -rm -fr tmpdir
  888. clean: mostlyclean
  889.     -rm -f $(LD_PROG) configdoc.texi
  890. distclean: clean
  891.     -rm -f Makefile config.status TAGS site.exp site.bak config.cache
  892.     -rm -f config.h stamp-h
  893.     -rm -rf ldscripts
  894. maintainer-clean realclean: clean distclean
  895.     @echo "This command is intended for maintainers to use;"
  896.     @echo "it deletes files that may require special tools to rebuild."
  897.     -rm -f $(GENERATED_CFILES) $(GENERATED_HFILES)
  898.     -rm -f $(LDDISTSTUFF) *.info*
  899.  
  900. .PHONY: diststuff mostlyclean clean distclean realclean
  901.  
  902. lintlog:$(LINTSOURCES) Makefile
  903.     $(LINT) -abhxzn  $(LINTFLAGS)  $(LINTSOURCES) \
  904. | grep -v "pointer casts may be troublesome" \
  905. | grep -v "possible pointer alignment problem" \
  906. | grep -v "ignore" \
  907. | grep -v "conversion from long may lose accuracy" \
  908. | grep -v "warning: constant argument to NOT" \
  909. | grep -v "enumeration type clash, operator CAST" \
  910. | grep -v "warning: constant in conditional context"\
  911. | grep -v "archive\.c"
  912.  
  913.  
  914. TAGS:
  915.     etags -t $(srcdir)/*.[chly] *.[chly]
  916.  
  917.  
  918. install: 
  919.     $(INSTALL_XFORM) ld.new $(bindir)/ld
  920.     $(INSTALL_XFORM1) $(srcdir)/ld.1 $(man1dir)/ld.1
  921.     for f in ldscripts/*; do \
  922.       $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \
  923.     done
  924.     test -d $(tooldir) || mkdir $(tooldir)
  925.     test -d $(tooldir)/bin || mkdir $(tooldir)/bin
  926.     -n=`echo ld | sed '$(program_transform_name)'`; \
  927.       rm -f $(tooldir)/bin/ld; \
  928.       cp $(bindir)/$$n $(tooldir)/bin/ld >/dev/null 2>/dev/null \
  929.        || $(INSTALL_PROGRAM) ld.new $(tooldir)/bin/ld
  930.  
  931. install-info: ld.info
  932.     if [ -r ld.info ]; then \
  933.       dir=. ; \
  934.     else \
  935.       dir=$(srcdir) ; \
  936.     fi ; \
  937.     for i in `cd $$dir ; echo ld.info*` ; do \
  938.         $(INSTALL_DATA) $$dir/$$i $(infodir)/$$i ; \
  939.     done
  940.  
  941. clean-info:
  942.     -rm -rf *.info*
  943.  
  944. .PHONY: install install-info clean-info
  945.  
  946. # Targets to rebuild dependencies in this Makefile.
  947. # Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
  948. .dep: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h
  949.     rm -f .dep1
  950.     $(MAKE) DEP=$(DEP) .dep1
  951.     sed -f dep.sed <.dep1 >.dep
  952.  
  953. # This rule really wants a mkdep that runs "gcc -MM".
  954. .dep1: $(CFILES) $(GENERATED_CFILES)
  955.     rm -f .dep2
  956.     echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
  957.     $(DEP) -f .dep2 $(ALL_CFLAGS) $?
  958.     $(srcdir)/../move-if-change .dep2 .dep1
  959.  
  960. dep.sed: dep-in.sed config.status
  961.     sed <$(srcdir)/dep-in.sed >dep.sed    \
  962.         -e 's!@INCDIR@!$(INCDIR)!'    \
  963.         -e 's!@SRCDIR@!$(srcdir)!'
  964.  
  965. dep: .dep
  966.     sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
  967.     cat .dep >> tmp-Makefile
  968.     $(srcdir)/../move-if-change tmp-Makefile Makefile
  969.  
  970. dep-in: .dep
  971.     sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
  972.     cat .dep >> tmp-Makefile.in
  973.     $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
  974.  
  975. .PHONY: dep dep-in
  976.  
  977. # Dummy target to force execution of dependent targets.
  978. #
  979. force:
  980.  
  981. .PHONY: force
  982.  
  983. Makefile: Makefile.in config.status
  984.     CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
  985.  
  986. config.h: stamp-h ; @true
  987. stamp-h: config.in config.status
  988.     CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
  989.  
  990. config.status: configure configure.host configure.tgt
  991.     $(SHELL) ./config.status --recheck
  992.  
  993. # What appears below is generated by a hacked mkdep using gcc -MM.
  994.  
  995. # DO NOT DELETE THIS LINE -- mkdep uses it.
  996. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
  997.  
  998. ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
  999.   $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
  1000.   $(INCDIR)/bfdlink.h ld.h ldexp.h ldlang.h ldmisc.h \
  1001.   ldgram.h ldmain.h ldctor.h
  1002. ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
  1003.   $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
  1004.   ld.h ldemul.h ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h \
  1005.   ldemul-list.h
  1006. ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
  1007.   $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
  1008.   $(INCDIR)/bfdlink.h ld.h ldmain.h ldmisc.h ldexp.h \
  1009.   ldgram.h ldlang.h
  1010. ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
  1011.   $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
  1012.   $(INCDIR)/bfdlink.h ld.h ldmisc.h ldexp.h ldlang.h \
  1013.   ldfile.h ldmain.h ldgram.h ldlex.h ldemul.h
  1014. ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
  1015.   $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
  1016.   $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
  1017.   ldgram.h ldexp.h ldlang.h ldemul.h ldlex.h ldmisc.h \
  1018.   ldctor.h ldfile.h
  1019. ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
  1020.   $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
  1021.   $(INCDIR)/libiberty.h $(INCDIR)/progress.h $(INCDIR)/bfdlink.h \
  1022.   ld.h ldmain.h ldmisc.h ldwrite.h ldgram.h ldexp.h ldlang.h \
  1023.   ldemul.h ldlex.h ldfile.h ldctor.h
  1024. ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
  1025.   $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
  1026.   $(INCDIR)/libiberty.h $(INCDIR)/demangle.h ld.h ldmisc.h \
  1027.   ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h ldfile.h
  1028. ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
  1029.   $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
  1030.   ld.h ldver.h ldemul.h ldmain.h
  1031. ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
  1032.   $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
  1033.   $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h ldexp.h \
  1034.   ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h
  1035. lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
  1036.   $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
  1037.   $(INCDIR)/getopt.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
  1038.   ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldfile.h \
  1039.   ldver.h ldemul.h
  1040. mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \
  1041.   sysdep.h config.h $(INCDIR)/fopen-same.h ld.h ldexp.h \
  1042.   ldlang.h ldmisc.h mri.h ldgram.h
  1043. ldcref.o: ldcref.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
  1044.   $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
  1045.   $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h ldmain.h \
  1046.   ldmisc.h
  1047. ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
  1048.   $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
  1049.   $(INCDIR)/bfdlink.h ld.h ldexp.h ldver.h ldlang.h ldemul.h \
  1050.   ldfile.h ldmisc.h ldmain.h mri.h ldlex.h
  1051. ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/obstack.h sysdep.h \
  1052.   config.h $(INCDIR)/fopen-same.h ld.h ldgram.h ldmisc.h \
  1053.   ldexp.h ldlang.h ldfile.h ldlex.h ldmain.h
  1054.  
  1055. # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
  1056.