]> Git Repo - binutils.git/blobdiff - ld/Makefile.in
tooldir copy of ld belongs directly in tooldir
[binutils.git] / ld / Makefile.in
index 730af8c0bab469ca8de0225488a319498373ed2e..1a3317cc697c856ca17c189f828009d199a89663 100644 (file)
@@ -1,17 +1,65 @@
-#
-# Makefile for ld version 2
-#
-# $Id$
-#
+# Makefile for the GNU linker ld (version 2)
+# Copyright (C) 1989-1992 Free Software Foundation, Inc.
+
+# This file is part of GNU ld..
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
 
 srcdir = .
 
-destdir = /usr/local
+prefix = /usr/local
+
+program_prefix =
+exec_prefix = $(prefix)
+bindir = $(exec_prefix)/bin
+libdir = $(exec_prefix)/lib
+tooldir = $(libdir)
+
+datadir = $(prefix)/lib
+mandir = $(prefix)/man
+man1dir = $(mandir)/man1
+man2dir = $(mandir)/man2
+man3dir = $(mandir)/man3
+man4dir = $(mandir)/man4
+man5dir = $(mandir)/man5
+man6dir = $(mandir)/man6
+man7dir = $(mandir)/man7
+man8dir = $(mandir)/man8
+man9dir = $(mandir)/man9
+infodir = $(prefix)/info
+includedir = $(prefix)/include
+docdir = $(datadir)/doc
+
+gcclibdir = $(libdir)/gcc/$(target_alias)
+
+SHELL = /bin/sh
 
-version=`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion`
-bindir = $(destdir)/H-$(host_alias)/T-$(target_alias)/bin
-libdir = $(destdir)/H-$(host_alias)/T-$(target_alias)/lib
-libsubdir = $(libdir)/gcc/$(target)/$(version)
+INSTALL = install -c
+INSTALL_PROGRAM = $(INSTALL)
+INSTALL_DATA = $(INSTALL)
+
+AR = ar
+AR_FLAGS = qv
+BISON = bison -y
+MAKEINFO = makeinfo
+RANLIB = ranlib
+LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
+
+#version=/`./../gcc/gcc -dumpversion`
+version=
 
 # Seach path to override the default search path for -lfoo libraries.
 # If LIB_PATH is empty, the ones in the script (if any) are left alone.
@@ -19,124 +67,65 @@ libsubdir = $(libdir)/gcc/$(target)/$(version)
 # which may have the form: LIB_PATH=/lib:/usr/local/lib
 LIB_PATH =
 
-INSTALL = install -c
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_FILE = $(INSTALL)
-
 BASEDIR        = ../..
 INCLUDE        = $(srcdir)/../include
 INCLUDES = -I. -I$(srcdir)  -I$(INCLUDE) 
-DEBUG  = -g
+MINUS_G        = -g
 
 # Where to find texinfo.tex to format docn with TeX
 TEXIDIR = $(srcdir)/../texinfo/fsf
 
 # Whether to get roff to put indexing entries on stderr
-#TEXI2OPT =
-# You neeed this to generate ld-index.ms
-TEXI2OPT = -i
+TEXI2OPT =
+# You neeed this to generate ld-index.ms (or .mm or .me)
+# TEXI2OPT = -i
+
+TEXI2ROFF=texi2roff
 
 # Which roff program to use to generate index for texi2roff'd doc
 ROFF = groff
 
-BISON = bison
-BISONFLAGS = -v
-
-SCRIPTS = ldgld68k.sc ldgld.sc \
-       ldlnk960.sc ldlnk960r.sc ldgld960.sc \
-       ldm88k.sc ldglda29k.sc news.sc h8300hds.sc ebmon29k.sc
-
-#### target and host dependent Makefile fragments come in here.
+### Host, target, and site specific Makefile fragments come in here.
 ###
 
-CFLAGS = $(INCLUDES) $(DEBUG) $(HDEFINES) $(TDEFINES) $(CDEFINES)
+CFLAGS = $(INCLUDES) $(MINUS_G) $(HDEFINES) $(TDEFINES) $(CDEFINES)
 LINTFLAGS =  $(INCLUDES) $(EXTRA_DEF) 
 
-.SUFFIXES: .y .x .xr .xu .xn .xN .sc .scu .scr .scn $(SUFFIXES)
+.SUFFIXES: .y .x .xr .xu .xn .xbn .sc .scu .scr .scn $(SUFFIXES)
 
 # go directly to ld.new in case this ld isn't capable of
 # linking native object on this host.  It can be renamed on
 # install.
 LD_PROG        = ld.new
 
-# A .sc script file is needed for each emulation mode.
-# sed is used to transform this script into two variant forms:
-# A .scr script is for linking without relocation (-r flag).
-# A .scu script is like .scr, but *do* create constructors.
-# A .scn script is for linking with -N flag (mix text and data on same page).
-# A .scN script is for linking with -N flag (mix text and data on same page).
-# The diference is that segments should (need) not be page aligned.
-
-# A sed pattern to translate .sc to .scu:
-SED_MAKE_RELOC_WITH_CONSTRUCTORS=\
-  -e "/If relocating/,/End if relocating/d" \
-  -e "/=/s/[_a-zA-Z.]* *= .*//g" \
-  -e '/>/s/} *> *[a-zA-Z]*/}/' \
-  -e "/text/s/[.]text .*:/.text :/" \
-  -e "/data/s/[.]data .*:/.data :/"
-# A sed pattern to translate .scu to .scr:
-SED_REMOVE_CONSTRUCTORS= -e /CONSTRUCTORS/d
-
-.sc.scu:
-       sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) $< >$*.scu
-.scu.scr:
-       sed $(SED_REMOVE_CONSTRUCTORS) < $< >$*.scr
-
-# Each builtin script file is included as a C string literal.
-# These are generated by the mkscript filter.
-.sc.x:
-       if [ "x"$(LIB_PATH) = "x" ]; then ./mkscript < $< >$*.x ; \
-       else \
-         (sed <$< -e '/SEARCH_DIR(.*)/d' ; \
-         echo $(LIB_PATH) | tr ':' ' ' | sed -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\1);/g';) | ./mkscript >$*.x;\
-       fi
-
-# The .xn script is used if the -n flag is given (write-protect text)..
-# Sunos starts the text segment for demand-paged binaries at 0x2020
-# and other binaries at 0x2000, since the exec header is paged in
-# with the text.  Some other Unix variants do the same.
-# For -n and -N flags the offset of the exec header must be removed.
-# This sed script does this if the master script contains
-# a line of the form ".text 0xAAAA BLOCK(0xBBBB):" - the
-# output will contain ".text 0xBBBB:".  (For Sunos AAAA=2020 and BBBB=2000.)
-.x.xn:
-       sed -e '/text/s/\.text .* BLOCK(\([^)]*\)):/.text \1:/' < $< >$*.xn
-
-# The .xN script is used if the -N flag is given (don't write-protect text).
-# This is like -n, except that the data segment need not be page-aligned.
-# So get rid of commands for page-alignment:  We assume these use ALIGN
-# with a hex constant that end with 00, since any normal page size is be
-# at least divisible by 256.  We use the 00 to avoid matching
-# anything that tries to align of (say) 8-byte boundaries.
-.xn.xN:
-       sed -e '/ALIGN/s/ALIGN( *0x[0-9a-fA-F]*00 *)/./' < $< >$*.xN
-
-# The xu and xr scripts don't search libraries, so LIB_PATH doesn't matter.
-.sc.xu:
-       sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) < $< | ./mkscript >$*.xu
-.sc.xr:
-       sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) $(SED_REMOVE_CONSTRUCTORS) \
-       < $< | ./mkscript >$*.xr
-
 # for self hosting
-BFDLIB=$(unsubdir)/../bfd$(subdir)/libbfd.a
-LIBIBERTY=$(unsubdir)/../libiberty$(subdir)/libiberty.a
+BFDLIB=./../bfd/libbfd.a
+LIBIBERTY=./../libiberty/libiberty.a
+
+ALL_EMULATIONS=ld__lnk960.o ld__sun3.o ld__i386aout.o \
+       ld__go32.o ld__m88kbcs.o ld__a29k.o ld__news.o ld__hp300bsd.o ld__h8300hms.o ld__ebmon29k.o \
+       ld__sun4.o ld__gld960.o ld__vanilla.o ld__h8300xray.o ld__st2000.o
+
+EMULATION_OFILES=${ALL_EMULATIONS}
+#EMULATION_OFILES=ld__${EMUL}.o ${OTHER_EMULATIONS}
 
-OFILES= ldgram.o ldlex.o ldlang.o ldmain.o ldwarn.o ldwrite.o ldexp.o ldlnk960.o ldgld68k.o ldindr.o \
-       ldm88k.o ldglda29k.o news.o h8300hds.o ebmon29k.o \
-       ldgld.o ldgld960.o ldemul.o ldver.o ldmisc.o ldsym.o ldvanilla.o ldfile.o
+OFILES= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldindr.o \
+       ldwarn.o ldwrite.o ldexp.o  ldemul.o ldver.o ldmisc.o ldsym.o \
+       ldfile.o relax.o  lderror.o cplus-dem.o ${EMULATION_OFILES}
 
-HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h ldsym.h ldlang.h ldexp.h \
+HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \
+       ldsym.h ldctor.h ldlang.h ldexp.h \
        ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h
 
 MANSOURCES=ld.tex
 
-LDCSOURCES=ldlang.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c ldgld.c ldgld68k.c \
-       ldm88k.c ldgld29k.c \
-       ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c ldvanilla.c
+LDCSOURCES=ldlang.c lexsup.c ldctor.c mri.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
+       ld__gld.c ld__sun3.c ld__go32.c ld__m88k.c ld__ebmon29k.c \
+       ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \
+       relax.c  lderror.c cplus-dem.c
 
-GENERATED_SOURCES=ldgram.c ldlex.c ldgram.h 
-GENERATED_HEADERS=ldgram.h
+GENERATED_SOURCES=ldgram.c ldlex.c ld__*.c ldemul-list.h
+GENERATED_HEADERS=ldgram.h ldemul-list.h
 
 LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h
 
@@ -145,73 +134,106 @@ BFDSOURCES=../../bfd/common/*.c
 SOURCES= $(LDSOURCES) $(BFDSOURCES)
 LINTSOURCES=   $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
 
-STAGESTUFF = *.x *.x[ru] *.sc[ru] $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(OFILES) $(LD_PROG) mkscript
+STAGESTUFF = *.x *.x[runN] *.sc[runN] $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(OFILES) $(LD_PROG) mkscript
 
 all: Makefile $(LD_PROG)
 
+check:
+info: ld.info
+
 ldgram.h ldgram.c: ldgram.y
-       $(BISON) $(BISONFLAGS) -d $(VPATH)/ldgram.y -o ldgram.c
-#      These are in case BISON is really yacc (which ignores -o).
-       if [ -f y.tab.c -a ! -f ldgram.c ]; then mv y.tab.c ldgram.c; else true ; fi
-       if [ -f y.tab.h -a ! -f ldgram.h ]; then mv y.tab.h ldgram.h; else true ; fi
+       $(BISON) $(BISONFLAGS) -d $(VPATH)/ldgram.y
+       mv -f y.tab.c ldgram.c
+       mv -f y.tab.h ldgram.h
+
+ldmain.o: ldmain.c
+       $(CC) $(CFLAGS) -DDEFAULT_EMULATION='"$(EMUL)"' -c $<
+
+ldemul-list.h:  Makefile
+       (echo "/* This file is automatically generated.  DO NOT EDIT! */";\
+       for f in `echo " " ${EMULATION_OFILES} "" \
+        | sed -e 's/ld__/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
+           echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
+       done;\
+       echo "";\
+       echo "#define EMULATION_LIST \\";\
+       for f in `echo " " ${EMULATION_OFILES} "" \
+        | sed -e 's/ld__/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
+           echo "  &ld_$${f}_emulation, \\"; \
+       done;\
+       echo "  0") >ldemul-list.h
+
+ldemul.o: ldemul-list.h
 
 ldlex.c: ldlex.l
-       lex -t $(VPATH)/ldlex.l >ldlex.c
-
-
-ldgld.c: $(srcdir)/ldtemplate
-       sed -e s/"<ldtarget>"/ldgld/g -e s/"<arch>"/m68k/g \
-       -e s/"<target>"//g -e s/"<TARGET>"//g <$(srcdir)/ldtemplate >$@
-news.c: $(srcdir)/ldtemplate
-       sed -e s/"<ldtarget>"/news/g -e s/"<arch>"/m68k/g \
-       -e s/"<target>"/news/g -e s/"<TARGET>"/NEWS/g <$(srcdir)/ldtemplate >$@
-
-ebmon29k.c: $(srcdir)/ldtemplate
-       sed -e s/"<ldtarget>"/ebmon29k/g -e s/"<arch>"/a29k/g \
-       -e s/"gld<target>"/ebmon29k/g -e s/"GLD<TARGET>"/EBMON29K/g \
-       -e s/"<ldtarget>.x"/ebmon.x/ <$(srcdir)/ldtemplate >$@
-
-ldgld68k.c: $(srcdir)/ldtemplate
-       sed -e s/"<ldtarget>"/ldgld68k/g -e s/"<arch>"/m68k/g \
-       -e s/"<target>"/68k/g -e s/"<TARGET>"/68K/g <$(srcdir)/ldtemplate >$@
-ldglda29k.c: $(srcdir)/ldtemplate
-       sed -e s/"<ldtarget>"/ldglda29k/g -e s/"<arch>"/a29k/g \
-       -e s/"<target>"/29k/g -e s/"<TARGET>"/29K/g <$(srcdir)/ldtemplate >$@
-ldm88k.c: $(srcdir)/ldtemplate
-       sed -e s/"<ldtarget>"/ldm88k/g -e s/"<arch>"/m88k/g \
-       -e s/"<target>"/m88kbcs/g -e s/"<TARGET>"/M88KBCS/g <$(srcdir)/ldtemplate >$@
-
-# The .c files for these are generated from ldtemplete.
-ldgld.o: ./mkscript ldgld.x ldgld.xr ldgld.xu ldgld.xn ldgld.xN
-news.o: ./mkscript news.x news.xr news.xu news.xn news.xN
-ebmon29k.o: ./mkscript ebmon29k.x ebmon29k.xr ebmon29k.xu \
-       ebmon29k.xn ebmon29k.xN
-ldgld68k.o: ./mkscript ldgld68k.x ldgld68k.xr ldgld68k.xu \
-       ldgld68k.xn ldgld68k.xN
-ldglda29k.o: ./mkscript ldglda29k.x ldglda29k.xr ldglda29k.xu \
-       ldglda29k.xn ldglda29k.xN
-ldm88k.o: ./mkscript ldm88k.x ldm88k.xr ldm88k.xu ldm88k.xn ldm88k.xN
-
-# The .c files for these are (for now) specially written (not ldtemplete).
-ldgld960.o: ./mkscript ldgld960.x
-ldlnk960.o: ./mkscript ldlnk960.x ldlnk960.xr
-h8300hds.o: ./mkscript h8300hds.x
-
-
-#$(BFDLIB): $(BFDSOURCES)
-#      (cd ../bfd; make)
+#      /lib/cpp -E -P $(INCLUDES)  $(HDEFINES) $(TDEFINES) $(CDEFINES) $(VPATH)/ldlex.l >ldlex.p
+       $(LEX) -Cem -t $(VPATH)/ldlex.l >ldlex.c
+#      cp ldlex.q ldlex.c
+
+
+# These all start with ld__ so 'make clean' can find them.
+
+GENSCRIPTS=sh $(srcdir)/genscripts.sh ${srcdir} ${host_alias} ${target_alias}
+GEN_DEPENDS=./mkscript $(srcdir)/genscripts.sh
+
+ld__sun4.c: $(srcdir)/sun4.sh \
+  $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} sun4.sh
+ld__sun3.c: $(srcdir)/sun3.sh \
+  $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} sun3.sh
+ld__go32.c: $(srcdir)/go32.sh \
+  $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} go32.sh
+ld__news.c: $(srcdir)/news.sh \
+  $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} news.sh
+ld__hp300bsd.c: $(srcdir)/hp300bsd.sh \
+  $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} hp300bsd.sh
+ld__i386aout.c: $(srcdir)/i386aout.sh \
+  $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} i386aout.sh
+ld__ebmon29k.c: $(srcdir)/ebmon29k.sh \
+  $(srcdir)/generic.em $(srcdir)/ebmon29k.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} ebmon29k.sh
+ld__a29k.c: $(srcdir)/a29k.sh \
+  $(srcdir)/generic.em $(srcdir)/a29k.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} a29k.sh
+ld__m88kbcs.c: $(srcdir)/m88kbcs.sh \
+  $(srcdir)/generic.em $(srcdir)/h8300hms.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} m88kbcs.sh
+ld__h8300hms.c: $(srcdir)/h8300hms.sh \
+  $(srcdir)/h8300hms.em $(srcdir)/h8300hms.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} h8300hms.sh
+ld__h8300xray.c: $(srcdir)/h8300xray.sh \
+  $(srcdir)/h8300xray.em $(srcdir)/h8300xray.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} h8300xray.sh
+ld__st2000.c: $(srcdir)/st2000.sh \
+  $(srcdir)/st2000.em $(srcdir)/st2000.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} st2000.sh
+ld__vanilla.c: $(srcdir)/vanilla.sh \
+  $(srcdir)/vanilla.em $(srcdir)/vanilla.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} vanilla.sh
+ld__lnk960.c: $(srcdir)/lnk960.sh \
+  $(srcdir)/lnk960.em $(srcdir)/i960.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} lnk960.sh
+ld__gld960.c: $(srcdir)/gld960.sh \
+  $(srcdir)/gld960.em $(srcdir)/i960.sc-sh ${GEN_DEPENDS}
+       ${GENSCRIPTS} gld960.sh
 
 $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
        $(CC) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES)
 
-#      (cd ../bfd; make)
-#      LDEMULATION=gld; export LDEMULATION;  GNUTARGET=a.out-sunos-big;./ldok -format a.out-sunos-big  -o ld /lib/crt0.o   $(OFILES) $(BFDLIB) $(LIBIBERTY) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
-#      gld -o ld /lib/crt0.o   $(OFILES) $(BFDLIB) $(LIBIBERTY) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
-#      $(CC) -Bstatic -o ld.new $(OFILES) $(BFDLIB) $(LIBIBERTY)
+# Rules for testing by relinking ld itself.
 
+ld-partial.o: ld.new
+       $(HOSTING_EMU); ./ld.new -o ld-partial.o -r $(OFILES)
+ld1: ld-partial.o
+       $(HOSTING_EMU); ./ld.new -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
 
-ld1: ld.new
-       $(HOSTING_EMU); ./ld.new -o ld1 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
+ld1-full: ld.new
+       $(HOSTING_EMU); ./ld.new -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
 
 ld2: ld1
        $(HOSTING_EMU); ./ld1 -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
@@ -219,27 +241,45 @@ ld2: ld1
 ld3: ld2
        $(HOSTING_EMU); ./ld2 -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
 
+bootstrap: ld3
+       cmp ld2 ld3
+
 ######################################################################
 # DOCUMENTATION TARGETS
 # TeX output
-ld.dvi: ld.texinfo
-       TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex ld.texinfo
+ld.dvi: $(srcdir)/ld.texinfo
+       TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/ld.texinfo
        texindex ld.??
-       TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex ld.texinfo
+       TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/ld.texinfo
 
 # info file for online browsing
-ld.info: ld.texinfo
-       makeinfo ld.texinfo
-
-# roff output (-ms)
-#   edit instances of "ms" to "me" or "mm" to suit your preferences.
-#   (we don't use a variable because we don't trust all makes to handle
-#   a var in the target name right).
-ld.ms: ld.texinfo
+ld.info: $(srcdir)/ld.texinfo
+       $(MAKEINFO) -o ld.info $(srcdir)/ld.texinfo
+
+#separate targets for "ms", "me", and "mm" forms of roff doc
+# Try to use a recent texi2roff.  v2 was put on prep in jan91.
+# If you want an index, see texi2roff doc for postprocessing 
+# and add -i to texi2roff invocations below.
+# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
+#    correspondint -e lines when later texi2roff's are current)
+# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
+# + @c's deleted explicitly because texi2roff sees texinfo commands in them
+# + @   (that's at-BLANK) not recognized by texi2roff, turned into blank
+# + @alphaenumerate is ridiculously new, turned into @enumerate
+
+ld.ms: $(srcdir)/ld.texinfo
        sed -e '/\\input texinfo/d' \
                -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-               ld.texinfo | \
-       texi2roff $(TEXI2OPT) -ms >ld.ms 
+               -e '/^@ifinfo/,/^@end ifinfo/d' \
+               -e '/^@c/d' \
+               -e 's/{.*,,/{/' \
+               -e 's/@ / /g' \
+               -e 's/^@alphaenumerate/@enumerate/g' \
+               -e 's/^@end alphaenumerate/@end enumerate/g' \
+               $(srcdir)/ld.texinfo | \
+       $(TEXI2ROFF) $(TEXI2OPT) -ms | \
+       sed -e 's/---/\\(em/g' \
+               >>ld.ms 
 
 # index for roff output
 ld-index.ms: ld.ms
@@ -247,9 +287,53 @@ ld-index.ms: ld.ms
                sed -e '/: warning:/d' | \
                texi2index >ld-index.ms
 
+# roff output (-mm)
+ld.mm: $(srcdir)/ld.texinfo
+       sed -e '/\\input texinfo/d' \
+               -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
+               -e '/^@ifinfo/,/^@end ifinfo/d' \
+               -e '/^@c/d' \
+               -e 's/{.*,,/{/' \
+               -e '/@noindent/d' \
+               -e 's/@ / /g' \
+               -e 's/^@alphaenumerate/@enumerate/g' \
+               -e 's/^@end alphaenumerate/@end enumerate/g' \
+               $(srcdir)/ld.texinfo | \
+       $(TEXI2ROFF) $(TEXI2OPT) -mm | \
+       sed -e 's/---/\\(em/g' \
+       >ld.mm 
+
+# index for roff output
+ld-index.mm: ld.mm
+       $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \
+               sed -e '/: warning:/d' | \
+               texi2index >ld-index.mm
+
+# roff output (-me)
+ld.me: $(srcdir)/ld.texinfo
+       sed -e '/\\input texinfo/d' \
+               -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
+               -e '/^@ifinfo/,/^@end ifinfo/d' \
+               -e '/^@c/d' \
+               -e 's/{.*,,/{/' \
+               -e 's/@ / /g' \
+               -e 's/^@alphaenumerate/@enumerate/g' \
+               -e 's/^@end alphaenumerate/@end enumerate/g' \
+               $(srcdir)/ld.texinfo | \
+       $(TEXI2ROFF) $(TEXI2OPT) -me | \
+       sed -e 's/---/\\(em/g' \
+               >>ld.me 
+
+# index for roff output
+ld-index.me: ld.me
+       $(ROFF) -me ld.me 2>&1 1>/dev/null | \
+               sed -e '/: warning:/d' | \
+               texi2index >ld-index.me
+
+
 ######################################################################
 
-mkscript: $(srcdir)/mkscript.c
+./mkscript: $(srcdir)/mkscript.c
        $(CC) $(CFLAGS) $(LDFLAGS) -o mkscript $(srcdir)/mkscript.c $(LOADLIBES)
 
 ldlex.c: ldlex.l ldgram.h
@@ -257,46 +341,24 @@ ldlex.o: ldlex.c ldgram.h
 ldgram.o: ldgram.c
 ldgram.c:ldgram.y
 
-ldgld68k.x :ldgld68k.sc 
-ldgld68kUr.x :ldgld68kUr.sc 
-ldgld68kr.x :ldgld68kr.sc 
-h8300hds.x:h8300hds.sc
-ldgld.x :ldgld.sc 
-ldgldUr.x :ldgldUr.sc 
-ldgldr.x :ldgldr.sc 
-ldlnk960.x :ldlnk960.sc 
-ldlnk960r.x :ldlnk960r.sc 
-ldgld960.x :ldgld960.sc 
-ldgldm88k.x :ldgldm88k.sc 
-ldm88kUr.x :ldm88kUr.sc 
-ldm88kr.x:ldm88kr.sc
-ldm88k.x:ldm88k.sc
-news.x:news.sc
-h8300hds.x:h8300hds.sc
-h8300hds.o:h8300hds.c
-ldgld68k.x:ldgld68k.sc
-ldglda29k.x :ldglda29k.sc 
-ldglda29kr.x :ldglda29kr.sc 
-ldglda29kUr.x :ldglda29kUr.sc 
-
-ebmon29k.x :ebmon29k.sc 
-ebmon29kr.x :ebmon29kr.sc 
-ebmon29kUr.x :ebmon29kUr.sc 
+h8300hms.o:h8300hms.c
+h8300xray.o:h8300xray.c
+st2000.o:st2000.c
 
 stage1:        force
-       - mkdir stage1
-       - mv -f $(STAGESTUFF) stage1
-       - (cd stage1 ; ln -s $(LD_PROG) ld)
+       -mkdir stage1
+       -mv -f $(STAGESTUFF) stage1
+       -(cd stage1 ; ln -s $(LD_PROG) ld)
 
 stage2:        force
-       - mkdir stage2
-       - mv -f $(STAGESTUFF) stage2
-       - (cd stage2 ; ln -s $(LD_PROG) ld)
+       -mkdir stage2
+       -mv -f $(STAGESTUFF) stage2
+       -(cd stage2 ; ln -s $(LD_PROG) ld)
 
 stage3:        force
-       - mkdir stage3
-       - mv -f $(STAGESTUFF) stage3
-       - (cd stage3 ; ln -s $(LD_PROG) ld)
+       -mkdir stage3
+       -mv -f $(STAGESTUFF) stage3
+       -(cd stage3 ; ln -s $(LD_PROG) ld)
 
 against=stage2
 
@@ -304,25 +366,24 @@ comparison: force
        for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
 
 de-stage1: force
-       - (cd stage1 ; mv -f * ..)
-       - rm ld
-       - rmdir stage1
+       -(cd stage1 ; mv -f * ..)
+       -rm ld
+       -rmdir stage1
 
 de-stage2: force
-       - (cd stage2 ; mv -f * ..)
-       - rm ld
-       - rmdir stage2
+       -(cd stage2 ; mv -f * ..)
+       -rm ld
+       -rmdir stage2
 
 de-stage3: force
-       - (cd stage3 ; mv -f * ..)
-       - rm ld
-       - rmdir stage3
+       -(cd stage3 ; mv -f * ..)
+       -rm ld
+       -rmdir stage3
 
 clean:
-       - rm -f TAGS $(OFILES) $(GENERATED_SOURCES) $(GENERATED_HEADERS)
-       - rm -f *.x *.x[runN] *.sc[runN]
-       - rm -f ld.?? ld.??? 
-       - rm -f ld ld1 ld2 ld3 ld.new mkscript *.o y.output
+       -rm -f TAGS $(STAGESTUFF)
+       -rm -f ld.?? ld.??? ldlex.[qp]
+       -rm -f ld ld1 ld2 ld3 *.o y.output
 
 lintlog:$(SOURCES) Makefile
        $(LINT) -abhxzn  $(LINTFLAGS)  $(LINTSOURCES) \
@@ -339,15 +400,38 @@ lintlog:$(SOURCES) Makefile
 tags TAGS:$(SOURCES) $(HEADERS)
        etags -t $?
 
-release:
-       (cd /4/steve/ld; tar cf -  $(LDSOURCES) $(HEADERS) $(MANSOURCES)) | tar xf - 
 
 objdump:objdump.c 
 
+.PHONY: install
 install: $(LD_PROG)
-#      $(INSTALL_PROGRAM) ld.new $(libsubdir)/ld
-       cp $(LD_PROG) $(bindir)/ld.new
-       mv -f $(bindir)/ld.new $(bindir)/ld
+       mv ld.new ld
+       -rm -f $(bindir)/$(program_prefix)ld
+       $(INSTALL_PROGRAM) ld $(bindir)/$(program_prefix)ld
+       -rm -f $(tooldir)/ld
+       $(INSTALL_PROGRAM) ld $(tooldir)/ld
+       -rm -f $(man1dir)/$(program_prefix)ld.1
+       $(INSTALL_DATA) $(srcdir)/gld.1 $(man1dir)/$(program_prefix)ld.1
+
+install-info: info
+       for i in ld.info* ; do \
+               $(INSTALL_DATA) $$i $(infodir)/$$i ; \
+       done
+
+clean-info:
+       -rm -rf *.info*
+
+# Something like the following might make sense for install, but doesn't work
+# - it is too fragile, depending on a gcc binary int the right place.
+# Perhaps using gcc/version.c might work?
+#      # If $(gcclibdir) exists, install ld there, and put a link to it
+#      # from $(bindir);  otherwise put ld in $(bindir).
+#      if ([ -x ./../gcc/gcc -a -d $(gcclibdir) ]); then \
+#          $(INSTALL_PROGRAM) ld.new $(gcclibdir)/ld; \
+#          cd $(bindir); rm -f ld; ln -s $(gcclibdir)/ld ld; \
+#      else \
+#          $(INSTALL_PROGRAM) ld.new $(bindir)/ld;  \
+#      fi
 
 #-----------------------------------------------------------------------------
 #              'STANDARD' GNU/960 TARGETS BELOW THIS POINT
@@ -407,8 +491,8 @@ make:
 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
        $(SHELL) ./config.status
 
-### Local Variables: ***
 ### mode:fundamental ***
+### Local Variables: ***
 ### page-delimiter: "^#\f" ***
 ### End: ***
 ### end of file
This page took 0.040099 seconds and 4 git commands to generate.