1991-04-04 19:01:18 +00:00
|
|
|
|
#
|
|
|
|
|
# Makefile for ld version 2
|
|
|
|
|
#
|
|
|
|
|
# $Id$
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
srcdir = .
|
|
|
|
|
|
1991-04-15 23:41:05 +00:00
|
|
|
|
destdir = /usr/local
|
|
|
|
|
|
|
|
|
|
version=`$(srcdir)/../gcc$(subdir)/gcc -dumpversion`
|
|
|
|
|
prefix = $(destdir)
|
|
|
|
|
bindir = $(prefix)/bin
|
|
|
|
|
libdir = $(prefix)/lib
|
|
|
|
|
libsubdir = $(libdir)/gcc/$(target)/$(version)
|
|
|
|
|
|
|
|
|
|
INSTALL = install -c
|
|
|
|
|
INSTALL_PROGRAM = $(INSTALL)
|
|
|
|
|
INSTALL_FILE = $(INSTALL)
|
|
|
|
|
|
1991-04-09 23:21:17 +00:00
|
|
|
|
BASEDIR = ../..
|
|
|
|
|
INCLUDE = $(srcdir)/../include-cygnus
|
|
|
|
|
INCLUDES = -I. -I$(srcdir) -I$(INCLUDE)
|
1991-04-04 19:01:18 +00:00
|
|
|
|
DEBUG = -g
|
1991-04-09 23:21:17 +00:00
|
|
|
|
|
1991-04-18 02:01:12 +00:00
|
|
|
|
SCRIPTS = ld-gld68k.script ld-gld68k-Ur.script ld-gld68k-r.script \
|
|
|
|
|
ld-gld.script ld-gld-Ur.script ld-gld-r.script ld-lnk960.script \
|
1991-04-23 15:59:24 +00:00
|
|
|
|
ld-lnk960-r.script ld-gld960.script \
|
|
|
|
|
ld-gldm88kbcs.script ld-gldm88kbcs-Ur.script ld-gldm88kbcs-r.script
|
1991-04-09 23:21:17 +00:00
|
|
|
|
|
1991-04-18 02:01:12 +00:00
|
|
|
|
PROCESSED_SCRIPTS = ld-gld68k.x ld-gld68k-Ur.x ld-gld68k-r.x ld-gld.x \
|
1991-04-23 15:59:24 +00:00
|
|
|
|
ld-gld-Ur.x ld-gld-r.x ld-lnk960.x ld-lnk960-r.x ld-gld960.x \
|
|
|
|
|
ld-gldm88kbcs.x ld-gldm88kbcs-Ur.x ld-gldm88kbcs-r.x
|
1991-04-09 23:21:17 +00:00
|
|
|
|
|
|
|
|
|
#### target and host dependent Makefile fragments come in here.
|
|
|
|
|
###
|
|
|
|
|
|
1991-04-23 15:59:24 +00:00
|
|
|
|
CFLAGS = $(INCLUDES) $(DEBUG) $(HDEFINES) $(TDEFINES) $(CDEFINES)
|
1991-04-09 23:21:17 +00:00
|
|
|
|
LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
|
|
|
|
|
|
1991-04-14 03:23:25 +00:00
|
|
|
|
.SUFFIXES: .y .x .script $(SUFFIXES)
|
1991-04-09 23:21:17 +00:00
|
|
|
|
|
|
|
|
|
.y.o:
|
1991-04-14 03:23:25 +00:00
|
|
|
|
$(YACC) $<
|
1991-04-09 23:21:17 +00:00
|
|
|
|
mv y.tab.c ldgram.tab.c
|
|
|
|
|
$(CC) -c $(CFLAGS) ldgram.tab.c
|
|
|
|
|
mv ldgram.tab.o ldgram.o
|
|
|
|
|
|
1991-04-04 19:01:18 +00: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 02:01:12 +00:00
|
|
|
|
LD_PROG = ld.new
|
1991-04-14 03:23:25 +00:00
|
|
|
|
|
|
|
|
|
.script.x:
|
|
|
|
|
mkscript < $< >$*.x
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
|
|
|
|
# for self hosting
|
|
|
|
|
GNUTARGET=a.out-generic-big
|
|
|
|
|
LDEMULATION=gld
|
1991-04-10 22:56:51 +00:00
|
|
|
|
BFDLIB=$(srcdir)/../bfd$(subdir)/libbfd.a
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
1991-04-18 02:01:12 +00:00
|
|
|
|
OFILES= ldgram.o ldlex.o ldlang.o ldmain.o ldwrite.o ldexp.o ld-lnk960.o ld-gld68k.o \
|
1991-04-23 15:59:24 +00:00
|
|
|
|
ld-gldm88kbcs.o \
|
1991-04-14 03:23:25 +00:00
|
|
|
|
ld-gld.o ld-gld960.o ld-emul.o ldversion.o ldmisc.o ldsym.o ld-vanilla.o ldfile.o
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
|
|
|
|
HEADERS=config.h ldmain.h ldmain.h ldmisc.h ldsym.h ldlang.h ldexp.h \
|
|
|
|
|
ldlex.h ldwrite.h ldversion.h ld-emul.h ldfile.h ldgram.h ld.h
|
|
|
|
|
|
|
|
|
|
MANSOURCES=ld.tex
|
|
|
|
|
|
1991-04-09 23:21:17 +00:00
|
|
|
|
LDCSOURCES=ldlang.c ldmain.c ldwrite.c ld-lnk960.c ld-gld.c ld-gld68k.c \
|
1991-04-23 15:59:24 +00:00
|
|
|
|
ld-gldm88kbcs.c \
|
1991-04-14 03:23:25 +00:00
|
|
|
|
ld-gld960.c ld-emul.c ldversion.c ldmisc.c ldexp.c ldsym.c ldfile.c ld-vanilla.c
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
|
|
|
|
GENERATED_SOURCES=ldgram.tab.c ldlex.c ldgram.tab.h y.tab.h
|
|
|
|
|
GENERATED_HEADERS=ldgram.tab.h
|
|
|
|
|
|
|
|
|
|
LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l
|
|
|
|
|
|
1991-04-09 23:21:17 +00:00
|
|
|
|
BFDSOURCES=../../bfd/common/*.c
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
|
|
|
|
SOURCES= $(LDSOURCES) $(BFDSOURCES)
|
|
|
|
|
LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
|
|
|
|
|
|
1991-04-18 02:01:12 +00:00
|
|
|
|
STAGESTUFF = $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(PROCESSED_SCRIPTS) $(OFILES) $(LD_PROG) mkscript
|
1991-04-14 03:23:25 +00:00
|
|
|
|
|
1991-04-18 02:01:12 +00:00
|
|
|
|
all: Makefile $(PROCESSED_SCRIPTS) $(LD_PROG)
|
1991-04-09 23:21:17 +00:00
|
|
|
|
|
1991-04-18 02:01:12 +00:00
|
|
|
|
$(PROCESSED_SCRIPTS): mkscript $(SCRIPTS)
|
1991-04-09 23:21:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#$(BFDLIB): $(BFDSOURCES)
|
|
|
|
|
# (cd ../bfd; make)
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
1991-04-18 02:01:12 +00:00
|
|
|
|
$(LD_PROG): $(OFILES) $(BFDLIB)
|
|
|
|
|
$(CC) $(CFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB)
|
|
|
|
|
|
1991-04-04 19:01:18 +00:00
|
|
|
|
# (cd ../bfd; make)
|
1991-04-18 02:01:12 +00:00
|
|
|
|
# LDEMULATION=gld; export LDEMULATION; GNUTARGET=a.out-generic-big;./ldok -format a.out-generic-big -o ld /lib/crt0.o $(OFILES) $(BFDLIB) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
|
|
|
|
|
# gld -o ld /lib/crt0.o $(OFILES) $(BFDLIB) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
|
|
|
|
|
# $(CC) -Bstatic -o ld.new $(OFILES) $(BFDLIB)
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
|
|
|
|
|
1991-04-14 03:23:25 +00:00
|
|
|
|
ld1: ld.new
|
1991-04-18 02:01:12 +00:00
|
|
|
|
$(HOSTING_EMU); ./ld.new -o ld1 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(HOSTING_LIBS)
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
|
|
|
|
ld2: ld1
|
1991-04-18 02:01:12 +00:00
|
|
|
|
$(HOSTING_EMU); ./ld1 -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(HOSTING_LIBS)
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
|
|
|
|
ld3: ld2
|
1991-04-18 02:01:12 +00:00
|
|
|
|
$(HOSTING_EMU); ./ld2 -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(HOSTING_LIBS)
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
|
|
|
|
ld.dvi:ld.tex
|
|
|
|
|
tex ld.tex
|
|
|
|
|
|
1991-04-18 02:01:12 +00:00
|
|
|
|
mkscript: mkscript.c
|
1991-04-14 03:23:25 +00:00
|
|
|
|
|
1991-04-09 23:21:17 +00:00
|
|
|
|
ldgram.o: ldgram.y
|
|
|
|
|
ldgram.tab.h:ldgram.y
|
1991-04-04 19:01:18 +00:00
|
|
|
|
cp y.tab.h ldgram.tab.h
|
1991-04-14 03:23:25 +00:00
|
|
|
|
|
|
|
|
|
ld-gld.o: $(PROCESSED_SCRIPTS) ld-gld.c
|
1991-04-18 02:01:12 +00:00
|
|
|
|
|
1991-04-04 19:01:18 +00:00
|
|
|
|
ldlex.c: ldlex.l ldgram.tab.h
|
|
|
|
|
ldlex.o: ldlex.c ldgram.tab.h
|
|
|
|
|
|
|
|
|
|
ldmain.o: ldmain.c
|
|
|
|
|
ldversion.o: ldversion.c
|
|
|
|
|
ldfile.o: ldfile.c
|
|
|
|
|
ldwrite.o: ldwrite.c
|
|
|
|
|
ldlang.o: ldlang.c ldgram.tab.h
|
1991-04-14 03:23:25 +00:00
|
|
|
|
|
|
|
|
|
ld-gld68k.o: $(PROCESSED_SCRIPTS) ld-gld68k.c
|
|
|
|
|
ld-gld960.o: $(PROCESSED_SCRIPTS) ld-gld960.c
|
1991-04-23 15:59:24 +00:00
|
|
|
|
ld-gldm88kbcs.o: $(PROCESSED_SCRIPTS) ld-gldm88kbcs.c
|
1991-04-09 23:21:17 +00:00
|
|
|
|
ld-emul.o: ld-emul.c
|
1991-04-14 03:23:25 +00:00
|
|
|
|
ld-vanilla.o: ld-vanilla.c
|
|
|
|
|
ld-lnk960.o: $(PROCESSED_SCRIPTS) ld-lnk960.c
|
1991-04-09 23:21:17 +00:00
|
|
|
|
ldexp.o: ldexp.c ldgram.tab.h
|
|
|
|
|
ldmisc.o: ldmisc.c
|
|
|
|
|
ldsym.o: ldsym.c
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
1991-04-18 02:01:12 +00:00
|
|
|
|
stage1: force
|
|
|
|
|
- mkdir stage1
|
|
|
|
|
- mv -f $(STAGESTUFF) stage1
|
|
|
|
|
- (cd stage1 ; ln -s $(LD_PROG) ld)
|
1991-04-14 03:23:25 +00:00
|
|
|
|
|
1991-04-18 02:01:12 +00:00
|
|
|
|
stage2: force
|
|
|
|
|
- mkdir stage2
|
|
|
|
|
- mv -f $(STAGESTUFF) stage2
|
|
|
|
|
- (cd stage2 ; ln -s $(LD_PROG) ld)
|
1991-04-14 03:23:25 +00:00
|
|
|
|
|
1991-04-18 02:01:12 +00:00
|
|
|
|
stage3: force
|
|
|
|
|
- mkdir stage3
|
|
|
|
|
- mv -f $(STAGESTUFF) stage3
|
|
|
|
|
- (cd stage3 ; ln -s $(LD_PROG) ld)
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
1991-04-18 02:01:12 +00: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)
|
|
|
|
|
- rm -f ld ld1 ld2 ld3 ld.new mkscript *.o y.output
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
|
|
|
|
lintlog:$(SOURCES) Makefile
|
1991-04-09 23:21:17 +00:00
|
|
|
|
$(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
|
1991-04-04 19:01:18 +00: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)
|
|
|
|
|
etags -t $(SOURCES) $(HEADERS)
|
|
|
|
|
|
|
|
|
|
release:
|
|
|
|
|
(cd /4/steve/ld; tar cf - $(LDSOURCES) $(HEADERS) $(MANSOURCES)) | tar xf -
|
|
|
|
|
|
|
|
|
|
objdump:objdump.c
|
|
|
|
|
|
1991-04-18 02:01:12 +00:00
|
|
|
|
install: $(LD_PROG)
|
1991-04-15 23:41:05 +00:00
|
|
|
|
$(INSTALL_PROGRAM) ld.new $(libsubdir)/ld
|
1991-04-04 19:01:18 +00: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
|
|
|
|
|
|
|
|
|
|
# Dummy target to force execution of dependent targets.
|
|
|
|
|
#
|
1991-04-18 02:01:12 +00:00
|
|
|
|
force:
|
1991-04-04 19:01:18 +00: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
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
|
1991-04-10 22:56:51 +00:00
|
|
|
|
(cd $(srcdir) ; \
|
1991-04-15 23:41:05 +00:00
|
|
|
|
./configure +destdir=$(destdir) \
|
|
|
|
|
+norecurse \
|
|
|
|
|
`if [ "$(srcdir)" != "." ] ; then echo +f; fi` \
|
|
|
|
|
$(host) +target=$(target))
|
1991-04-04 19:01:18 +00:00
|
|
|
|
|
|
|
|
|
### Local Variables: ***
|
|
|
|
|
### mode:fundamental ***
|
|
|
|
|
### page-delimiter: "^#" ***
|
|
|
|
|
### End: ***
|
|
|
|
|
### end of file
|