1991-11-04 08:45:25 +08:00
|
|
|
|
# Makefile for the GNU linker ld (version 2)
|
|
|
|
|
# Copyright (C) 1989-1991 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.
|
|
|
|
|
|
1991-04-05 03:01:18 +08:00
|
|
|
|
#
|
|
|
|
|
# $Id$
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
srcdir = .
|
|
|
|
|
|
1991-11-06 04:36:54 +08:00
|
|
|
|
ddestdir = /usr/local
|
1991-04-16 08:41:05 +09:00
|
|
|
|
|
1991-10-02 18:05:30 +08:00
|
|
|
|
version=`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion`
|
1991-11-06 04:36:54 +08:00
|
|
|
|
bindir = $(ddestdir)/bin
|
|
|
|
|
gcclibdir = $(ddestdir)/lib/gcc/$(target_alias)/$(version)
|
1991-04-16 08:41:05 +09:00
|
|
|
|
|
1991-10-09 07:18:03 +08:00
|
|
|
|
# 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.
|
|
|
|
|
# Otherwise, they are replaced with the ones given in LIB_PATH,
|
|
|
|
|
# which may have the form: LIB_PATH=/lib:/usr/local/lib
|
|
|
|
|
LIB_PATH =
|
|
|
|
|
|
1991-04-16 08:41:05 +09:00
|
|
|
|
INSTALL = install -c
|
|
|
|
|
INSTALL_PROGRAM = $(INSTALL)
|
|
|
|
|
INSTALL_FILE = $(INSTALL)
|
|
|
|
|
|
1991-04-10 07:21:17 +08:00
|
|
|
|
BASEDIR = ../..
|
1991-04-25 13:25:00 +09:00
|
|
|
|
INCLUDE = $(srcdir)/../include
|
1991-04-10 07:21:17 +08:00
|
|
|
|
INCLUDES = -I. -I$(srcdir) -I$(INCLUDE)
|
1991-04-05 03:01:18 +08:00
|
|
|
|
DEBUG = -g
|
1991-04-10 07:21:17 +08:00
|
|
|
|
|
1991-10-12 06:42:57 +08:00
|
|
|
|
# Where to find texinfo.tex to format docn with TeX
|
1991-10-09 05:52:43 +08:00
|
|
|
|
TEXIDIR = $(srcdir)/../texinfo/fsf
|
|
|
|
|
|
1991-10-12 06:51:31 +08:00
|
|
|
|
# Whether to get roff to put indexing entries on stderr
|
1991-10-15 08:31:56 +08:00
|
|
|
|
TEXI2OPT =
|
|
|
|
|
# You neeed this to generate ld-index.ms (or .mm or .me)
|
|
|
|
|
# TEXI2OPT = -i
|
1991-10-12 06:42:57 +08:00
|
|
|
|
|
|
|
|
|
# Which roff program to use to generate index for texi2roff'd doc
|
|
|
|
|
ROFF = groff
|
|
|
|
|
|
1991-06-21 07:04:41 +09:00
|
|
|
|
BISON = bison
|
|
|
|
|
BISONFLAGS = -v
|
|
|
|
|
|
1991-09-28 04:09:23 +08:00
|
|
|
|
SCRIPTS = ldgld68k.sc ldgld.sc \
|
|
|
|
|
ldlnk960.sc ldlnk960r.sc ldgld960.sc \
|
1991-11-04 08:45:25 +08:00
|
|
|
|
i386aout.sc ldm88k.sc ldglda29k.sc news.sc h8300hds.sc ebmon29k.sc
|
1991-04-10 07:21:17 +08:00
|
|
|
|
|
|
|
|
|
#### target and host dependent Makefile fragments come in here.
|
|
|
|
|
###
|
|
|
|
|
|
1991-04-24 00:59:24 +09:00
|
|
|
|
CFLAGS = $(INCLUDES) $(DEBUG) $(HDEFINES) $(TDEFINES) $(CDEFINES)
|
1991-04-10 07:21:17 +08:00
|
|
|
|
LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
|
|
|
|
|
|
1991-10-15 08:28:43 +08:00
|
|
|
|
.SUFFIXES: .y .x .xr .xu .xn .xN .sc .scu .scr .scn $(SUFFIXES)
|
1991-04-10 07:21:17 +08:00
|
|
|
|
|
1991-04-05 03:01:18 +08:00
|
|
|
|
# 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.
|
1991-04-18 11:01:12 +09:00
|
|
|
|
LD_PROG = ld.new
|
1991-04-14 12:23:25 +09:00
|
|
|
|
|
1991-09-28 04:09:23 +08:00
|
|
|
|
# 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.
|
1991-10-15 08:28:43 +08:00
|
|
|
|
# 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).
|
1991-10-12 07:47:05 +08:00
|
|
|
|
# The diference is that segments should (need) not be page aligned.
|
1991-09-28 04:09:23 +08:00
|
|
|
|
|
|
|
|
|
# A sed pattern to translate .sc to .scu:
|
|
|
|
|
SED_MAKE_RELOC_WITH_CONSTRUCTORS=\
|
|
|
|
|
-e "/If relocating/,/End if relocating/d" \
|
1991-10-12 05:02:22 +08:00
|
|
|
|
-e "/=/s/[_a-zA-Z.]* *= .*//g" \
|
|
|
|
|
-e '/>/s/} *> *[a-zA-Z]*/}/' \
|
1991-09-28 04:09:23 +08:00
|
|
|
|
-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
|
|
|
|
|
|
1991-10-15 08:28:43 +08:00
|
|
|
|
# Each builtin script file is included as a C string literal.
|
|
|
|
|
# These are generated by the mkscript filter.
|
1991-09-04 06:04:24 +09:00
|
|
|
|
.sc.x:
|
1991-10-09 07:18:03 +08:00
|
|
|
|
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
|
1991-10-15 08:28:43 +08:00
|
|
|
|
|
|
|
|
|
# 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.
|
1991-09-28 04:09:23 +08:00
|
|
|
|
.sc.xu:
|
|
|
|
|
sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) < $< | ./mkscript >$*.xu
|
|
|
|
|
.sc.xr:
|
|
|
|
|
sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) $(SED_REMOVE_CONSTRUCTORS) \
|
|
|
|
|
< $< | ./mkscript >$*.xr
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
|
|
|
|
# for self hosting
|
1991-10-02 18:05:30 +08:00
|
|
|
|
BFDLIB=$(unsubdir)/../bfd$(subdir)/libbfd.a
|
|
|
|
|
LIBIBERTY=$(unsubdir)/../libiberty$(subdir)/libiberty.a
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
1991-11-04 08:45:25 +08:00
|
|
|
|
OFILES= ldgram.o ldlex.o ldlang.o ldctor.o ldmain.o \
|
|
|
|
|
ldwarn.o ldwrite.o ldexp.o ldlnk960.o ldgld68k.o ldindr.o i386aout.o \
|
1991-10-12 03:31:15 +08:00
|
|
|
|
ldm88k.o ldglda29k.o news.o h8300hds.o ebmon29k.o \
|
1991-05-15 03:53:33 +09:00
|
|
|
|
ldgld.o ldgld960.o ldemul.o ldver.o ldmisc.o ldsym.o ldvanilla.o ldfile.o
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
1991-11-04 08:45:25 +08:00
|
|
|
|
HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \
|
|
|
|
|
ldsym.h ldctor.h ldlang.h ldexp.h \
|
1991-05-15 03:53:33 +09:00
|
|
|
|
ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
|
|
|
|
MANSOURCES=ld.tex
|
|
|
|
|
|
1991-11-04 08:45:25 +08:00
|
|
|
|
LDCSOURCES=ldlang.c ldctor.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
|
|
|
|
|
ldgld.c ldgld68k.c ldm88k.c ebmon29k.c \
|
1991-05-15 03:53:33 +09:00
|
|
|
|
ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c ldvanilla.c
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
1991-06-15 05:16:51 +09:00
|
|
|
|
GENERATED_SOURCES=ldgram.c ldlex.c ldgram.h
|
|
|
|
|
GENERATED_HEADERS=ldgram.h
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
1991-06-15 05:16:51 +09:00
|
|
|
|
LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
1991-04-10 07:21:17 +08:00
|
|
|
|
BFDSOURCES=../../bfd/common/*.c
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
|
|
|
|
SOURCES= $(LDSOURCES) $(BFDSOURCES)
|
|
|
|
|
LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
|
|
|
|
|
|
1991-09-28 04:09:23 +08:00
|
|
|
|
STAGESTUFF = *.x *.x[ru] *.sc[ru] $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(OFILES) $(LD_PROG) mkscript
|
1991-04-10 07:21:17 +08:00
|
|
|
|
|
1991-09-28 04:09:23 +08:00
|
|
|
|
all: Makefile $(LD_PROG)
|
1991-04-10 07:21:17 +08:00
|
|
|
|
|
1991-10-02 12:52:31 +08:00
|
|
|
|
ldgram.h ldgram.c: ldgram.y
|
1991-06-21 07:04:41 +09:00
|
|
|
|
$(BISON) $(BISONFLAGS) -d $(VPATH)/ldgram.y -o ldgram.c
|
1991-10-04 05:50:08 +08:00
|
|
|
|
# These are in case BISON is really yacc (which ignores -o).
|
1991-10-12 03:31:15 +08:00
|
|
|
|
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
|
1991-06-15 05:16:51 +09:00
|
|
|
|
|
1991-10-02 12:52:31 +08:00
|
|
|
|
ldlex.c: ldlex.l
|
1991-06-15 05:16:51 +09:00
|
|
|
|
lex -t $(VPATH)/ldlex.l >ldlex.c
|
|
|
|
|
|
1991-05-18 11:57:45 +09:00
|
|
|
|
|
1991-10-09 07:18:03 +08:00
|
|
|
|
ldgld.c: $(srcdir)/ldtemplate
|
1991-09-28 04:09:23 +08:00
|
|
|
|
sed -e s/"<ldtarget>"/ldgld/g -e s/"<arch>"/m68k/g \
|
1991-10-12 13:42:05 +08:00
|
|
|
|
-e s/"<target>"//g -e s/"<TARGET>"//g <$(srcdir)/ldtemplate >$@
|
1991-10-09 07:18:03 +08:00
|
|
|
|
news.c: $(srcdir)/ldtemplate
|
1991-09-28 04:09:23 +08:00
|
|
|
|
sed -e s/"<ldtarget>"/news/g -e s/"<arch>"/m68k/g \
|
1991-10-12 13:42:05 +08:00
|
|
|
|
-e s/"<target>"/news/g -e s/"<TARGET>"/NEWS/g <$(srcdir)/ldtemplate >$@
|
1991-10-12 03:31:15 +08:00
|
|
|
|
|
1991-11-04 08:45:25 +08:00
|
|
|
|
i386aout.c: $(srcdir)/ldtemplate
|
|
|
|
|
sed -e s/"<ldtarget>"/i386aout/g -e s/"<arch>"/i386/g \
|
|
|
|
|
-e s/"<target>"/i386aout/g -e s/"<TARGET>"/I386AOUT/g <$(srcdir)/ldtemplate >$@
|
|
|
|
|
|
|
|
|
|
|
1991-10-12 03:31:15 +08:00
|
|
|
|
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 \
|
1991-10-12 13:42:05 +08:00
|
|
|
|
-e s/"<ldtarget>.x"/ebmon.x/ <$(srcdir)/ldtemplate >$@
|
1991-10-12 03:31:15 +08:00
|
|
|
|
|
1991-10-09 07:18:03 +08:00
|
|
|
|
ldgld68k.c: $(srcdir)/ldtemplate
|
1991-09-28 04:09:23 +08:00
|
|
|
|
sed -e s/"<ldtarget>"/ldgld68k/g -e s/"<arch>"/m68k/g \
|
1991-10-12 13:42:05 +08:00
|
|
|
|
-e s/"<target>"/68k/g -e s/"<TARGET>"/68K/g <$(srcdir)/ldtemplate >$@
|
1991-10-09 07:18:03 +08:00
|
|
|
|
ldglda29k.c: $(srcdir)/ldtemplate
|
1991-09-28 04:09:23 +08:00
|
|
|
|
sed -e s/"<ldtarget>"/ldglda29k/g -e s/"<arch>"/a29k/g \
|
1991-10-12 13:42:05 +08:00
|
|
|
|
-e s/"<target>"/29k/g -e s/"<TARGET>"/29K/g <$(srcdir)/ldtemplate >$@
|
1991-10-09 07:18:03 +08:00
|
|
|
|
ldm88k.c: $(srcdir)/ldtemplate
|
1991-09-28 04:09:23 +08:00
|
|
|
|
sed -e s/"<ldtarget>"/ldm88k/g -e s/"<arch>"/m88k/g \
|
1991-10-12 13:42:05 +08:00
|
|
|
|
-e s/"<target>"/m88kbcs/g -e s/"<TARGET>"/M88KBCS/g <$(srcdir)/ldtemplate >$@
|
1991-09-28 04:09:23 +08:00
|
|
|
|
|
|
|
|
|
# The .c files for these are generated from ldtemplete.
|
1991-10-15 08:28:43 +08:00
|
|
|
|
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
|
1991-11-04 08:45:25 +08:00
|
|
|
|
i386aout.o: ./mkscript i386aout.x i386aout.xr i386aout.xu i386aout.xn i386aout.xN
|
1991-10-15 08:28:43 +08:00
|
|
|
|
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
|
1991-09-28 04:09:23 +08:00
|
|
|
|
|
|
|
|
|
# The .c files for these are (for now) specially written (not ldtemplete).
|
|
|
|
|
ldgld960.o: ./mkscript ldgld960.x
|
|
|
|
|
ldlnk960.o: ./mkscript ldlnk960.x ldlnk960.xr
|
1991-10-07 23:07:29 +08:00
|
|
|
|
h8300hds.o: ./mkscript h8300hds.x
|
1991-09-28 04:09:23 +08:00
|
|
|
|
|
1991-04-10 07:21:17 +08:00
|
|
|
|
|
|
|
|
|
#$(BFDLIB): $(BFDSOURCES)
|
|
|
|
|
# (cd ../bfd; make)
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
1991-05-02 12:08:32 +09:00
|
|
|
|
$(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
|
1991-05-28 07:47:33 +09:00
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES)
|
1991-04-18 11:01:12 +09:00
|
|
|
|
|
1991-04-05 03:01:18 +08:00
|
|
|
|
# (cd ../bfd; make)
|
1991-05-15 03:53:33 +09:00
|
|
|
|
# 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
|
1991-05-02 12:08:32 +09:00
|
|
|
|
# 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)
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
|
|
|
|
|
1991-04-14 12:23:25 +09:00
|
|
|
|
ld1: ld.new
|
1991-05-02 12:08:32 +09:00
|
|
|
|
$(HOSTING_EMU); ./ld.new -o ld1 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
|
|
|
|
ld2: ld1
|
1991-05-02 12:08:32 +09:00
|
|
|
|
$(HOSTING_EMU); ./ld1 -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
|
|
|
|
ld3: ld2
|
1991-05-02 12:08:32 +09:00
|
|
|
|
$(HOSTING_EMU); ./ld2 -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
1991-10-12 06:42:57 +08:00
|
|
|
|
######################################################################
|
|
|
|
|
# DOCUMENTATION TARGETS
|
|
|
|
|
# TeX output
|
1991-10-09 05:52:43 +08:00
|
|
|
|
ld.dvi: ld.texinfo
|
|
|
|
|
TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex ld.texinfo
|
|
|
|
|
texindex ld.??
|
|
|
|
|
TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex ld.texinfo
|
|
|
|
|
|
1991-10-12 06:42:57 +08:00
|
|
|
|
# info file for online browsing
|
1991-10-09 05:52:43 +08:00
|
|
|
|
ld.info: ld.texinfo
|
|
|
|
|
makeinfo ld.texinfo
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
1991-10-15 08:31:56 +08:00
|
|
|
|
#separate targets for "ms", "me", and "mm" forms of roff doc
|
|
|
|
|
# (we don't use a variable because we don't trust all makes to handle
|
|
|
|
|
# a var in the target name right).
|
1991-10-12 06:42:57 +08:00
|
|
|
|
# roff output (-ms)
|
|
|
|
|
ld.ms: ld.texinfo
|
|
|
|
|
sed -e '/\\input texinfo/d' \
|
|
|
|
|
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
|
|
|
|
|
ld.texinfo | \
|
|
|
|
|
texi2roff $(TEXI2OPT) -ms >ld.ms
|
|
|
|
|
|
|
|
|
|
# index for roff output
|
|
|
|
|
ld-index.ms: ld.ms
|
|
|
|
|
$(ROFF) -ms ld.ms 2>&1 1>/dev/null | \
|
|
|
|
|
sed -e '/: warning:/d' | \
|
|
|
|
|
texi2index >ld-index.ms
|
|
|
|
|
|
1991-10-15 08:31:56 +08:00
|
|
|
|
# roff output (-mm)
|
|
|
|
|
ld.mm: ld.texinfo
|
|
|
|
|
sed -e '/\\input texinfo/d' \
|
|
|
|
|
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
|
|
|
|
|
ld.texinfo | \
|
|
|
|
|
texi2roff $(TEXI2OPT) -mm >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: ld.texinfo
|
|
|
|
|
sed -e '/\\input texinfo/d' \
|
|
|
|
|
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
|
|
|
|
|
ld.texinfo | \
|
|
|
|
|
texi2roff $(TEXI2OPT) -me >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
|
|
|
|
|
|
|
|
|
|
|
1991-10-12 06:42:57 +08:00
|
|
|
|
######################################################################
|
|
|
|
|
|
1991-08-14 00:14:25 +09:00
|
|
|
|
mkscript: $(srcdir)/mkscript.c
|
1991-09-04 06:04:24 +09:00
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o mkscript $(srcdir)/mkscript.c $(LOADLIBES)
|
1991-04-14 12:23:25 +09:00
|
|
|
|
|
1991-06-15 05:16:51 +09:00
|
|
|
|
ldlex.c: ldlex.l ldgram.h
|
|
|
|
|
ldlex.o: ldlex.c ldgram.h
|
|
|
|
|
ldgram.o: ldgram.c
|
|
|
|
|
ldgram.c:ldgram.y
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
1991-09-04 06:04:24 +09:00
|
|
|
|
ldgld68k.x :ldgld68k.sc
|
|
|
|
|
ldgld68kUr.x :ldgld68kUr.sc
|
|
|
|
|
ldgld68kr.x :ldgld68kr.sc
|
1991-10-07 23:07:29 +08:00
|
|
|
|
h8300hds.x:h8300hds.sc
|
1991-09-04 06:04:24 +09:00
|
|
|
|
ldgld.x :ldgld.sc
|
|
|
|
|
ldgldUr.x :ldgldUr.sc
|
|
|
|
|
ldgldr.x :ldgldr.sc
|
|
|
|
|
ldlnk960.x :ldlnk960.sc
|
|
|
|
|
ldlnk960r.x :ldlnk960r.sc
|
|
|
|
|
ldgld960.x :ldgld960.sc
|
1991-09-04 06:14:13 +09:00
|
|
|
|
ldgldm88k.x :ldgldm88k.sc
|
|
|
|
|
ldm88kUr.x :ldm88kUr.sc
|
|
|
|
|
ldm88kr.x:ldm88kr.sc
|
1991-10-12 13:42:05 +08:00
|
|
|
|
ldm88k.x:ldm88k.sc
|
|
|
|
|
news.x:news.sc
|
1991-11-04 08:45:25 +08:00
|
|
|
|
i386aout.x:i386aout.sc
|
1991-10-12 13:42:05 +08:00
|
|
|
|
h8300hds.x:h8300hds.sc
|
|
|
|
|
h8300hds.o:h8300hds.c
|
1991-09-04 06:04:24 +09:00
|
|
|
|
ldgld68k.x:ldgld68k.sc
|
|
|
|
|
ldglda29k.x :ldglda29k.sc
|
|
|
|
|
ldglda29kr.x :ldglda29kr.sc
|
|
|
|
|
ldglda29kUr.x :ldglda29kUr.sc
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
1991-10-12 03:31:15 +08:00
|
|
|
|
ebmon29k.x :ebmon29k.sc
|
|
|
|
|
ebmon29kr.x :ebmon29kr.sc
|
|
|
|
|
ebmon29kUr.x :ebmon29kUr.sc
|
|
|
|
|
|
1991-04-18 11:01:12 +09:00
|
|
|
|
stage1: force
|
|
|
|
|
- mkdir stage1
|
|
|
|
|
- mv -f $(STAGESTUFF) stage1
|
|
|
|
|
- (cd stage1 ; ln -s $(LD_PROG) ld)
|
1991-04-14 12:23:25 +09:00
|
|
|
|
|
1991-04-18 11:01:12 +09:00
|
|
|
|
stage2: force
|
|
|
|
|
- mkdir stage2
|
|
|
|
|
- mv -f $(STAGESTUFF) stage2
|
|
|
|
|
- (cd stage2 ; ln -s $(LD_PROG) ld)
|
1991-04-14 12:23:25 +09:00
|
|
|
|
|
1991-04-18 11:01:12 +09:00
|
|
|
|
stage3: force
|
|
|
|
|
- mkdir stage3
|
|
|
|
|
- mv -f $(STAGESTUFF) stage3
|
|
|
|
|
- (cd stage3 ; ln -s $(LD_PROG) ld)
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
1991-06-21 07:04:41 +09:00
|
|
|
|
against=stage2
|
|
|
|
|
|
|
|
|
|
comparison: force
|
|
|
|
|
for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
|
|
|
|
|
|
1991-04-18 11:01:12 +09:00
|
|
|
|
de-stage1: force
|
|
|
|
|
- (cd stage1 ; mv -f * ..)
|
|
|
|
|
- rm ld
|
|
|
|
|
- rmdir stage1
|
|
|
|
|
|
|
|
|
|
de-stage2: force
|
|
|
|
|
- (cd stage2 ; mv -f * ..)
|
|
|
|
|
- rm ld
|
|
|
|
|
- rmdir stage2
|
|
|
|
|
|
|
|
|
|
de-stage3: force
|
|
|
|
|
- (cd stage3 ; mv -f * ..)
|
|
|
|
|
- rm ld
|
|
|
|
|
- rmdir stage3
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
- rm -f TAGS $(OFILES) $(GENERATED_SOURCES) $(GENERATED_HEADERS)
|
1991-10-15 08:28:43 +08:00
|
|
|
|
- rm -f *.x *.x[runN] *.sc[runN]
|
1991-10-09 05:52:43 +08:00
|
|
|
|
- rm -f ld.?? ld.???
|
1991-04-18 11:01:12 +09:00
|
|
|
|
- rm -f ld ld1 ld2 ld3 ld.new mkscript *.o y.output
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
|
|
|
|
lintlog:$(SOURCES) Makefile
|
1991-04-10 07:21:17 +08:00
|
|
|
|
$(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
|
1991-04-05 03:01:18 +08:00
|
|
|
|
| grep -v "pointer casts may be troublesome" \
|
|
|
|
|
| grep -v "possible pointer alignment problem" \
|
|
|
|
|
| grep -v "ignore" \
|
|
|
|
|
| grep -v "conversion from long may lose accuracy" \
|
|
|
|
|
| grep -v "warning: constant argument to NOT" \
|
|
|
|
|
| grep -v "enumeration type clash, operator CAST" \
|
|
|
|
|
| grep -v "warning: constant in conditional context"\
|
|
|
|
|
| grep -v "archive\.c"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tags TAGS:$(SOURCES) $(HEADERS)
|
1991-05-18 11:57:45 +09:00
|
|
|
|
etags -t $?
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
objdump:objdump.c
|
|
|
|
|
|
1991-04-18 11:01:12 +09:00
|
|
|
|
install: $(LD_PROG)
|
1991-11-08 10:16:19 +08:00
|
|
|
|
$(INSTALL_PROGRAM) ld.new $(ddestdir)/bin/ld
|
1991-11-04 08:45:25 +08:00
|
|
|
|
# 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 $(unsubdir)/../gcc$(subdir)/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
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
|
|
|
|
|
#
|
|
|
|
|
# 'VERSION' file must be present and contain a string of the form "x.y"
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
ver960.c: FORCE
|
|
|
|
|
rm -f ver960.c
|
|
|
|
|
echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# This target should be invoked before building a new release.
|
|
|
|
|
# 'VERSION' file must be present and contain a string of the form "x.y"
|
|
|
|
|
#
|
|
|
|
|
roll:
|
|
|
|
|
@V=`cat VERSION` ; \
|
|
|
|
|
MAJ=`sed 's/\..*//' VERSION` ; \
|
|
|
|
|
MIN=`sed 's/.*\.//' VERSION` ; \
|
|
|
|
|
V=$$MAJ.`expr $$MIN + 1` ; \
|
|
|
|
|
rm -f VERSION ; \
|
|
|
|
|
echo $$V >VERSION ; \
|
|
|
|
|
echo Version $$V
|
|
|
|
|
|
1991-05-15 03:53:33 +09:00
|
|
|
|
|
1991-09-28 04:09:23 +08:00
|
|
|
|
dep: $(LDSOURCES)
|
1991-05-15 03:53:33 +09:00
|
|
|
|
mkdep $(CFLAGS) $?
|
|
|
|
|
|
1991-04-05 03:01:18 +08:00
|
|
|
|
# Dummy target to force execution of dependent targets.
|
|
|
|
|
#
|
1991-04-18 11:01:12 +09:00
|
|
|
|
force:
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
|
|
|
|
# Target to uncomment host-specific lines in this makefile. Such lines must
|
|
|
|
|
# have the following string beginning in column 1: #__<hostname>__#
|
|
|
|
|
# Original Makefile is backed up as 'Makefile.old'.
|
|
|
|
|
#
|
|
|
|
|
# Invoke with: make make HOST=xxx
|
|
|
|
|
#
|
|
|
|
|
make:
|
|
|
|
|
-@if test $(HOST)x = x ; then \
|
|
|
|
|
echo 'Specify "make make HOST=???"'; \
|
|
|
|
|
exit 1; \
|
|
|
|
|
fi ; \
|
|
|
|
|
grep -s "^#The next line was generated by 'make make'" Makefile; \
|
|
|
|
|
if test $$? = 0 ; then \
|
|
|
|
|
echo "Makefile has already been processed with 'make make'";\
|
|
|
|
|
exit 1; \
|
|
|
|
|
fi ; \
|
|
|
|
|
mv -f Makefile Makefile.old; \
|
|
|
|
|
echo "#The next line was generated by 'make make'" >Makefile ; \
|
|
|
|
|
echo "HOST=$(HOST)" >>Makefile ; \
|
|
|
|
|
echo >>Makefile ; \
|
|
|
|
|
sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
1991-10-02 15:24:45 +08:00
|
|
|
|
Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
|
1991-10-01 11:46:00 +08:00
|
|
|
|
$(SHELL) ./config.status
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
|
|
|
|
### Local Variables: ***
|
|
|
|
|
### mode:fundamental ***
|
|
|
|
|
### page-delimiter: "^#" ***
|
|
|
|
|
### End: ***
|
|
|
|
|
### end of file
|
1991-05-15 03:53:33 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
|