1991-04-05 03:01:18 +08:00
|
|
|
|
#
|
|
|
|
|
# Makefile for ld version 2
|
|
|
|
|
#
|
|
|
|
|
# $Id$
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
srcdir = .
|
|
|
|
|
|
1991-04-16 08:41:05 +09:00
|
|
|
|
destdir = /usr/local
|
|
|
|
|
|
1991-06-15 05:16:51 +09:00
|
|
|
|
version=`$(srcdir)/../gcc$(subdir)/gcc -dumpversion`
|
1991-04-16 08:41:05 +09:00
|
|
|
|
prefix = $(destdir)
|
|
|
|
|
bindir = $(prefix)/bin
|
|
|
|
|
libdir = $(prefix)/lib
|
|
|
|
|
libsubdir = $(libdir)/gcc/$(target)/$(version)
|
|
|
|
|
|
|
|
|
|
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-06-21 07:04:41 +09:00
|
|
|
|
BISON = bison
|
|
|
|
|
BISONFLAGS = -v
|
|
|
|
|
|
1991-09-04 06:04:24 +09:00
|
|
|
|
SCRIPTS = ldgld68k.sc ldgld68kUr.sc ldgld68kr.sc \
|
|
|
|
|
ldgld.sc ldgldUr.sc ldgldr.sc ldlnk960.sc \
|
|
|
|
|
ldlnk960r.sc ldgld960.sc \
|
1991-09-04 06:14:14 +09:00
|
|
|
|
ldm88k.sc ldm88kUr.sc ldm88kr.sc \
|
1991-09-04 06:04:24 +09:00
|
|
|
|
ldglda29k.sc ldglda29kUr.sc ldglda29kr.sc
|
1991-04-10 07:21:17 +08:00
|
|
|
|
|
1991-05-15 03:53:33 +09:00
|
|
|
|
PROCESSED_SCRIPTS = ldgld68k.x ldgld68kUr.x ldgld68kr.x ldgld.x \
|
|
|
|
|
ldgldUr.x ldgldr.x ldlnk960.x ldlnk960r.x ldgld960.x \
|
1991-09-04 06:14:14 +09:00
|
|
|
|
ldm88k.x ldm88kUr.x ldm88kr.x \
|
1991-07-16 09:07:19 +09:00
|
|
|
|
ldglda29k.x ldglda29kUr.x ldglda29kr.x
|
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-09-04 06:04:24 +09:00
|
|
|
|
.SUFFIXES: .y .x .sc $(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-04 06:04:24 +09:00
|
|
|
|
.sc.x:
|
1991-08-13 04:56:45 +09:00
|
|
|
|
./mkscript < $< >$*.x
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
|
|
|
|
# for self hosting
|
1991-05-14 23:40:39 +09:00
|
|
|
|
GNUTARGET=a.out-sunos-big
|
1991-04-05 03:01:18 +08:00
|
|
|
|
LDEMULATION=gld
|
1991-04-11 06:56:51 +08:00
|
|
|
|
BFDLIB=$(srcdir)/../bfd$(subdir)/libbfd.a
|
1991-05-02 12:08:32 +09:00
|
|
|
|
LIBIBERTY=$(srcdir)/../libiberty$(subdir)/libiberty.a
|
1991-04-05 03:01:18 +08:00
|
|
|
|
|
1991-08-13 04:56:45 +09:00
|
|
|
|
OFILES= ldgram.o ldlex.o ldlang.o ldmain.o ldwarn.o ldwrite.o ldexp.o ldlnk960.o ldgld68k.o ldindr.o \
|
1991-09-04 06:14:14 +09:00
|
|
|
|
ldm88k.o ldglda29k.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-08-13 04:56:45 +09:00
|
|
|
|
HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h ldsym.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-08-13 04:56:45 +09:00
|
|
|
|
LDCSOURCES=ldlang.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c ldgld.c ldgld68k.c \
|
1991-09-04 06:14:14 +09:00
|
|
|
|
ldm88k.c ldgld29k.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-04-18 11:01:12 +09:00
|
|
|
|
STAGESTUFF = $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(PROCESSED_SCRIPTS) $(OFILES) $(LD_PROG) mkscript
|
1991-04-14 12:23:25 +09:00
|
|
|
|
|
1991-04-18 11:01:12 +09:00
|
|
|
|
all: Makefile $(PROCESSED_SCRIPTS) $(LD_PROG)
|
1991-04-10 07:21:17 +08:00
|
|
|
|
|
1991-04-18 11:01:12 +09:00
|
|
|
|
$(PROCESSED_SCRIPTS): mkscript $(SCRIPTS)
|
1991-04-10 07:21:17 +08:00
|
|
|
|
|
1991-06-15 05:16:51 +09:00
|
|
|
|
ldgram.c:ldgram.y
|
1991-06-21 07:04:41 +09:00
|
|
|
|
$(BISON) $(BISONFLAGS) -d $(VPATH)/ldgram.y -o ldgram.c
|
1991-06-15 05:16:51 +09:00
|
|
|
|
|
|
|
|
|
ldlex.c:ldlex.l
|
|
|
|
|
lex -t $(VPATH)/ldlex.l >ldlex.c
|
|
|
|
|
|
1991-05-18 11:57:45 +09: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
|
|
|
|
|
|
|
|
|
ld.dvi:ld.tex
|
|
|
|
|
tex ld.tex
|
|
|
|
|
|
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-05-15 03:53:33 +09:00
|
|
|
|
ldgld.o: $(PROCESSED_SCRIPTS) ldgld.c
|
1991-04-18 11:01:12 +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
|
|
|
|
|
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-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-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-05-31 12:34:29 +09:00
|
|
|
|
- rm -f $(PROCESSED_SCRIPTS)
|
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
|
|
|
|
|
|
|
|
|
release:
|
|
|
|
|
(cd /4/steve/ld; tar cf - $(LDSOURCES) $(HEADERS) $(MANSOURCES)) | tar xf -
|
|
|
|
|
|
|
|
|
|
objdump:objdump.c
|
|
|
|
|
|
1991-04-18 11:01:12 +09:00
|
|
|
|
install: $(LD_PROG)
|
1991-04-16 08:41:05 +09:00
|
|
|
|
$(INSTALL_PROGRAM) ld.new $(libsubdir)/ld
|
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-05-18 11:57:45 +09:00
|
|
|
|
dep: $(LDSOURCES) $(PROCESSED_SCRIPTS)
|
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
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
|
1991-04-11 06:56:51 +08:00
|
|
|
|
(cd $(srcdir) ; \
|
1991-04-16 08:41:05 +09:00
|
|
|
|
./configure +destdir=$(destdir) \
|
|
|
|
|
+norecurse \
|
1991-08-13 04:56:45 +09:00
|
|
|
|
`if [ "$(srcdir)" != "." ] ; then echo +subdirs; fi` \
|
1991-05-18 10:01:09 +09:00
|
|
|
|
$(host) +target=$(target))
|
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
|