binutils-gdb/ld/Makefile

202 lines
5.0 KiB
Makefile
Raw Normal View History

1991-03-21 22:29:06 +01:00
#
# Makefile for ld version 2
#
# $Id$
#
1991-04-09 01:26:05 +02:00
srcdir=../common
VPATH=../common
1991-03-21 22:29:06 +01:00
BASEDIR = ../..
1991-04-04 00:04:26 +02:00
HOSTDIR = ../$(HOST)/
1991-03-21 22:29:06 +01:00
INCLUDE = $(srcdir)/$(BASEDIR)/include-cygnus
1991-04-04 00:04:26 +02:00
INCLUDES = -I. -I$(srcdir) -I$(INCLUDE)
1991-03-21 22:29:06 +01:00
DEBUG = -g
1991-04-04 00:04:26 +02:00
#__sun3__#EXTRA_DEF=-DHOST_SYS=SUN3_SYS
#__sun4__#EXTRA_DEF=-DHOST_SYS=SUN4_SYS
1991-04-09 01:26:05 +02:00
#__dgux__#EXTRA_DEF=-DHOST_SYS=DGUX_SYS
1991-04-04 00:04:26 +02:00
CFLAGS = $(INCLUDES) $(EXTRA_DEF) $(DEBUG)
LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
1991-04-09 01:26:05 +02:00
.SUFFIXES: .y
.y.o:
yacc -tvd $<
mv y.tab.c ldgram.tab.c
$(CC) -c $(CFLAGS) ldgram.tab.c
mv ldgram.tab.o ldgram.o
1991-03-21 22:29:06 +01: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-04 00:04:26 +02:00
PROGS = $(HOSTDIR)/ld.new
1991-03-21 22:29:06 +01:00
# for self hosting
GNUTARGET=a.out-generic-big
LDEMULATION=gld
1991-04-09 01:26:05 +02:00
BFDLIB=$(srcdir)/$(BASEDIR)/bfd/$(HOST)/libbfd.a
1991-03-21 22:29:06 +01:00
1991-04-04 00:04:26 +02:00
OBJS= ldgram.o ldlex.o ldlang.o ldmain.o ldwrite.o ldexp.o ld-lnk960.o ld-gld68k.o \
1991-03-21 22:29:06 +01:00
ld-gld.o ld-gld960.o ld-emul.o ldversion.o ldmisc.o ldsym.o ldfile.o
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-04 00:04:26 +02:00
LDCSOURCES=ldlang.c ldmain.c ldwrite.c ld-lnk960.c ld-gld.c ld-gld68k.c \
1991-03-21 22:29:06 +01:00
ld-gld960.c ld-emul.c ldversion.c ldmisc.c ldexp.c ldsym.c ldfile.c
1991-03-27 01:53:16 +01:00
GENERATED_SOURCES=ldgram.tab.c ldlex.c ldgram.tab.h y.tab.h
1991-03-21 22:29:06 +01:00
GENERATED_HEADERS=ldgram.tab.h
LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l
1991-04-04 00:04:26 +02:00
BFDSOURCES=../../bfd/common/*.c
1991-03-21 22:29:06 +01:00
SOURCES= $(LDSOURCES) $(BFDSOURCES)
LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
1991-04-04 00:04:26 +02:00
all: Makefile $(PROGS)
$(BFDLIB): $(BFDSOURCES)
(cd ../bfd; make)
1991-03-21 22:29:06 +01:00
1991-04-04 00:04:26 +02:00
$(PROGS): $(OBJS) $(BFDLIB)
1991-03-21 22:29:06 +01:00
# (cd ../bfd; make)
1991-04-09 01:26:05 +02:00
# LDEMULATION=gld; export LDEMULATION; GNUTARGET=a.out-generic-big;./ldok -format a.out-generic-big -o ld /lib/crt0.o $(OBJS) $(BFDLIB) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
# gld -o ld /lib/crt0.o $(OBJS) $(BFDLIB) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
$(CC) -Bstatic -o ld.new $(OBJS) $(BFDLIB)
1991-03-21 22:29:06 +01:00
ld1: ld
1991-04-09 01:26:05 +02:00
gcc -v -B./ -o ld1 $(OBJS) $(BFDLIB)
1991-03-21 22:29:06 +01:00
ld2: ld1
mv ld1 ld
1991-04-09 01:26:05 +02:00
gcc -v -B./ -o ld2 $(OBJS) $(BFDLIB)
1991-03-21 22:29:06 +01:00
ld3: ld2
mv ld2 ld
1991-04-09 01:26:05 +02:00
gcc -v -B./ -o ld3 $(OBJS) $(BFDLIB)
1991-03-21 22:29:06 +01:00
ld.dvi:ld.tex
tex ld.tex
1991-04-09 01:26:05 +02:00
ldgram.o: ldgram.y
ldgram.tab.h:ldgram.y
1991-03-21 22:29:06 +01:00
cp y.tab.h ldgram.tab.h
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
ld-gld.o: ld-gld.c
1991-04-04 00:04:26 +02:00
ld-gld68k.o: ld-gld68k.c
1991-03-21 22:29:06 +01:00
ld-gld960.o: ld-gld960.c
1991-04-09 01:26:05 +02:00
ld-emul.o: ld-emul.c
ld-lnk960.o: ld-lnk960.c
ldexp.o: ldexp.c ldgram.tab.h
ldmisc.o: ldmisc.c
ldsym.o: ldsym.c
1991-03-21 22:29:06 +01:00
clean:
- rm -f $(OBJS) $(GENERATED_SOURCES) $(GENERATED_HEADERS)
1991-04-04 00:04:26 +02:00
- rm -f ld ld1 ld2 ld3 ld.new
1991-03-21 22:29:06 +01:00
1991-03-27 01:53:16 +01:00
1991-03-21 22:29:06 +01:00
lintlog:$(SOURCES) Makefile
1991-04-04 00:04:26 +02:00
$(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
1991-03-21 22:29:06 +01: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
install: $(PROGS)
rm -f $G960BASE/bin/$(PROGS)
cp $(PROGS) $$G960BASE/bin/gld960c
#-----------------------------------------------------------------------------
# '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.
#
.force:
FORCE:
# 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: ../common/Makefile
mv Makefile Makefile.backup
cp ../common/Makefile .
$(MAKE) "HOST=$(HOST)" make
### Local Variables: ***
### mode:fundamental ***
### page-delimiter: "^# " ***
### End: ***
### end of file