2 # Makefile for ld version 2
10 BFDDIR
= $(BASEDIR
)/bfd
11 INCLUDE
= $(BASEDIR
)/include-cygnus
12 INCLUDES
= -I.
-I
$(srcdir) -I
$(INCLUDE
) -I
$(BFDDIR
)
14 CFLAGS
= $(INCLUDES
) $(DEBUG
)
16 # go directly to ld.new in case this ld isn't capable of
17 # linking native object on this host. It can be renamed on
22 GNUTARGET
=a.out-generic-big
24 bfdlib
=$(BASEDIR
)/bfd
/Host-
$(host
)/libbfd.a
26 OBJS
= ldgram.o ldlex.o ldlang.o ldmain.o ldwrite.o ldexp.o ld-lnk960.o \
27 ld-gld.o ld-gld960.o ld-emul.o ldversion.o ldmisc.o ldsym.o ldfile.o
29 HEADERS
=config.h ldmain.h ldmain.h ldmisc.h ldsym.h ldlang.h ldexp.h \
30 ldlex.h ldwrite.h ldversion.h ld-emul.h ldfile.h ldgram.h
ld.h
34 LDCSOURCES
=ldlang.c ldmain.c ldwrite.c ld-lnk960.c ld-gld.c \
35 ld-gld960.c ld-emul.c ldversion.c ldmisc.c ldexp.c ldsym.c ldfile.c
37 GENERATED_SOURCES
=ldgram.tab.c ldlex.c ldgram.tab.h y.tab.h
38 GENERATED_HEADERS
=ldgram.tab.h
40 LDSOURCES
=$(LDCSOURCES
) ldgram.y ldlex.l
42 #BFDSOURCES=../bfd/libbfd.c ../bfd/bfd.c ../bfd/sunos.c ../bfd/icoff.c ../bfd/b.out.c ../bfd/archive.c ../bfd/srec.c
44 SOURCES
= $(LDSOURCES
) $(BFDSOURCES
)
45 LINTSOURCES
= $(LDCSOURCES
) $(BFDSOURCES
) $(GENERATED_SOURCES
)
51 # 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
52 # gld -o ld /lib/crt0.o $(OBJS) $(bfdlib) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
53 $(CC
) -Bstatic
-o
ld.new
$(OBJS
) $(bfdlib
)
57 gcc
-v
-B.
/ -o ld1
$(OBJS
) $(bfdlib
)
61 gcc
-v
-B.
/ -o ld2
$(OBJS
) $(bfdlib
)
65 gcc
-v
-B.
/ -o ld3
$(OBJS
) $(bfdlib
)
71 yacc -d
$(srcdir)/ldgram.y
72 mv y.tab.c ldgram.tab.c
73 $(CC
) -c
$(CFLAGS
) ldgram.tab.c
74 mv ldgram.tab.o ldgram.o
77 cp y.tab.h ldgram.tab.h
79 ldlex.c
: ldlex.l ldgram.tab.h
80 ldlex.o
: ldlex.c ldgram.tab.h
83 ldversion.o
: ldversion.c
86 ldlang.o
: ldlang.c ldgram.tab.h
88 ld-gld960.o
: ld-gld960.c
90 ld-lnk960.o
:ld-lnk960.c
91 ldexp.o
:ldexp.c ldgram.tab.h
96 - rm -f
$(OBJS
) $(GENERATED_SOURCES
) $(GENERATED_HEADERS
)
100 lintlog
:$(SOURCES
) Makefile
101 $(LINT
) -abhxzn
$(CFLAGS
) $(LINTSOURCES
) \
102 | grep
-v
"pointer casts may be troublesome" \
103 | grep
-v
"possible pointer alignment problem" \
105 | grep
-v
"conversion from long may lose accuracy" \
106 | grep
-v
"warning: constant argument to NOT" \
107 | grep
-v
"enumeration type clash, operator CAST" \
108 | grep
-v
"warning: constant in conditional context"\
109 | grep
-v
"archive\.c"
112 tags TAGS
:$(SOURCES
) $(HEADERS
)
113 etags
-t
$(SOURCES
) $(HEADERS
)
116 (cd
/4/steve
/ld; tar cf
- $(LDSOURCES
) $(HEADERS
) $(MANSOURCES
)) |
tar xf
-
121 rm -f
$G960BASE/bin
/$(PROGS
)
122 cp
$(PROGS
) $$G960BASE/bin
/gld960c
124 #-----------------------------------------------------------------------------
125 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
127 # 'VERSION' file must be present and contain a string of the form "x.y"
128 #-----------------------------------------------------------------------------
132 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
135 # This target should be invoked before building a new release.
136 # 'VERSION' file must be present and contain a string of the form "x.y"
140 MAJ
=`sed 's/\..*//' VERSION` ; \
141 MIN
=`sed 's/.*\.//' VERSION` ; \
142 V
=$$MAJ.
`expr $$MIN + 1` ; \
144 echo
$$V >VERSION
; \
147 # Dummy target to force execution of dependent targets.
152 # Target to uncomment host-specific lines in this makefile. Such lines must
153 # have the following string beginning in column 1: #__<hostname>__#
154 # Original Makefile is backed up as 'Makefile.old'.
156 # Invoke with: make make HOST=xxx
159 -@if
test $(HOST
)x
= x
; then \
160 echo
'\aSpecify "make make HOST=???"'; \
163 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
164 if
test $$?
= 0 ; then \
165 echo
"\aMakefile has already been processed with 'make make'";\
168 mv
-f Makefile Makefile.old
; \
169 echo
"#The next line was generated by 'make make'" >Makefile
; \
170 echo
"HOST=$(HOST)" >>Makefile
; \
172 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
176 Makefile
: $(srcdir)/Makefile.in
$(srcdir)/configure
177 (cd
$(srcdir) ; configure
-host
=$(host
) $(target
))
179 ### Local Variables: ***
180 ### mode:fundamental ***
181 ### page-delimiter: "^#\f" ***