2 # Makefile for ld version 2
11 version
=`$(srcdir)/../gcc$(subdir)/gcc -dumpversion`
13 bindir = $(prefix)/bin
14 libdir = $(prefix)/lib
15 libsubdir
= $(libdir)/gcc
/$(target
)/$(version
)
18 INSTALL_PROGRAM
= $(INSTALL
)
19 INSTALL_FILE
= $(INSTALL
)
22 INCLUDE
= $(srcdir)/..
/include
23 INCLUDES
= -I.
-I
$(srcdir) -I
$(INCLUDE
)
26 SCRIPTS
= ldgld68k.script ldgld68kUr.script ldgld68kr.script \
27 ldgld.script ldgldUr.script ldgldr.script ldlnk960.script \
28 ldlnk960r.script ldgld960.script \
29 ldgldm88kbcs.script ldgldm88kbcsUr.script ldgldm88kbcsr.script
31 PROCESSED_SCRIPTS
= ldgld68k.x ldgld68kUr.x ldgld68kr.x ldgld.x \
32 ldgldUr.x ldgldr.x ldlnk960.x ldlnk960r.x ldgld960.x \
33 ldgldm88kbcs.x ldgldm88kbcsUr.x ldgldm88kbcsr.x
35 #### target and host dependent Makefile fragments come in here.
38 CFLAGS
= $(INCLUDES
) $(DEBUG
) $(HDEFINES
) $(TDEFINES
) $(CDEFINES
)
39 LINTFLAGS
= $(INCLUDES
) $(EXTRA_DEF
)
41 .SUFFIXES
: .y .x .script
$(SUFFIXES
)
44 # go directly to ld.new in case this ld isn't capable of
45 # linking native object on this host. It can be renamed on
53 GNUTARGET
=a.out-sunos-big
55 BFDLIB
=$(srcdir)/..
/bfd
$(subdir
)/libbfd.a
56 LIBIBERTY
=$(srcdir)/..
/libiberty
$(subdir
)/libiberty.a
58 OFILES
= ldgram.o ldlex.o ldlang.o ldmain.o ldwrite.o ldexp.o ldlnk960.o ldgld68k.o \
60 ldgld.o ldgld960.o ldemul.o ldver.o ldmisc.o ldsym.o ldvanilla.o ldfile.o
62 HEADERS
=config.h ldmain.h ldmain.h ldmisc.h ldsym.h ldlang.h ldexp.h \
63 ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h
ld.h
67 LDCSOURCES
=ldlang.c ldmain.c ldwrite.c ldlnk960.c ldgld.c ldgld68k.c \
69 ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c ldvanilla.c
71 GENERATED_SOURCES
=ldgramtb.c ldlex.c ldgramtb.h
72 GENERATED_HEADERS
=ldgramtb.h
74 LDSOURCES
=$(LDCSOURCES
) ldgram.y ldlex.l ldgramtb.h
76 BFDSOURCES
=..
/..
/bfd
/common
/*.c
78 SOURCES
= $(LDSOURCES
) $(BFDSOURCES
)
79 LINTSOURCES
= $(LDCSOURCES
) $(BFDSOURCES
) $(GENERATED_SOURCES
)
81 STAGESTUFF
= $(GENERATED_SOURCES
) $(GENERATED_HEADERS
) $(PROCESSED_SCRIPTS
) $(OFILES
) $(LD_PROG
) mkscript
83 all: Makefile
$(PROCESSED_SCRIPTS
) $(LD_PROG
)
85 $(PROCESSED_SCRIPTS
): mkscript
$(SCRIPTS
)
87 ldgramtb.o ldgramtb.h
:ldgram.y
91 $(CC
) -c
$(CFLAGS
) ldgramtb.c
92 mv ldgramtb.o ldgram.o
95 #$(BFDLIB): $(BFDSOURCES)
98 $(LD_PROG
): $(OFILES
) $(BFDLIB
) $(LIBIBERTY
)
99 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$(LD_PROG
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(LOADLIBES
)
102 # 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
103 # gld -o ld /lib/crt0.o $(OFILES) $(BFDLIB) $(LIBIBERTY) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
104 # $(CC) -Bstatic -o ld.new $(OFILES) $(BFDLIB) $(LIBIBERTY)
108 $(HOSTING_EMU
); .
/ld.new
-o ld1
$(HOSTING_CRT0
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
111 $(HOSTING_EMU
); .
/ld1
-o ld2
$(HOSTING_CRT0
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
114 $(HOSTING_EMU
); .
/ld2
-o ld3
$(HOSTING_CRT0
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
122 ldgld.o
: $(PROCESSED_SCRIPTS
) ldgld.c
124 ldlex.c
: ldlex.l ldgramtb.h
125 ldlex.o
: ldlex.c ldgramtb.h
127 ldgld68k.x
:ldgld68k.script
128 ldgld68kUr.x
:ldgld68kUr.script
129 ldgld68kr.x
:ldgld68kr.script
130 ldgld.x
:ldgld.script
131 ldgldUr.x
:ldgldUr.script
132 ldgldr.x
:ldgldr.script
133 ldlnk960.x
:ldlnk960.script
134 ldlnk960r.x
:ldlnk960r.script
135 ldgld960.x
:ldgld960.script
136 ldgldm88kbcs.x
:ldgldm88kbcs.script
137 ldgldm88kbcsUr.x
:ldgldm88kbcsUr.script
138 ldgldm88kbcsr.x
:ldgldm88kbcsr.script
139 ldgld68k.x
:ldgld68k.script
143 - mv
-f
$(STAGESTUFF
) stage1
144 - (cd stage1
; ln
-s
$(LD_PROG
) ld)
148 - mv
-f
$(STAGESTUFF
) stage2
149 - (cd stage2
; ln
-s
$(LD_PROG
) ld)
153 - mv
-f
$(STAGESTUFF
) stage3
154 - (cd stage3
; ln
-s
$(LD_PROG
) ld)
157 - (cd stage1
; mv
-f
* ..
)
162 - (cd stage2
; mv
-f
* ..
)
167 - (cd stage3
; mv
-f
* ..
)
172 - rm -f TAGS
$(OFILES
) $(GENERATED_SOURCES
) $(GENERATED_HEADERS
)
173 - rm -f
ld ld1 ld2 ld3
ld.new mkscript
*.o y.output
175 lintlog
:$(SOURCES
) Makefile
176 $(LINT
) -abhxzn
$(LINTFLAGS
) $(LINTSOURCES
) \
177 | grep
-v
"pointer casts may be troublesome" \
178 | grep
-v
"possible pointer alignment problem" \
180 | grep
-v
"conversion from long may lose accuracy" \
181 | grep
-v
"warning: constant argument to NOT" \
182 | grep
-v
"enumeration type clash, operator CAST" \
183 | grep
-v
"warning: constant in conditional context"\
184 | grep
-v
"archive\.c"
187 tags TAGS
:$(SOURCES
) $(HEADERS
)
191 (cd
/4/steve
/ld; tar cf
- $(LDSOURCES
) $(HEADERS
) $(MANSOURCES
)) |
tar xf
-
196 $(INSTALL_PROGRAM
) ld.new
$(libsubdir
)/ld
198 #-----------------------------------------------------------------------------
199 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
201 # 'VERSION' file must be present and contain a string of the form "x.y"
202 #-----------------------------------------------------------------------------
206 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
209 # This target should be invoked before building a new release.
210 # 'VERSION' file must be present and contain a string of the form "x.y"
214 MAJ
=`sed 's/\..*//' VERSION` ; \
215 MIN
=`sed 's/.*\.//' VERSION` ; \
216 V
=$$MAJ.
`expr $$MIN + 1` ; \
218 echo
$$V >VERSION
; \
222 dep
: $(LDSOURCES
) $(PROCESSED_SCRIPTS
)
225 # Dummy target to force execution of dependent targets.
229 # Target to uncomment host-specific lines in this makefile. Such lines must
230 # have the following string beginning in column 1: #__<hostname>__#
231 # Original Makefile is backed up as 'Makefile.old'.
233 # Invoke with: make make HOST=xxx
236 -@if
test $(HOST
)x
= x
; then \
237 echo
'\aSpecify "make make HOST=???"'; \
240 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
241 if
test $$?
= 0 ; then \
242 echo
"\aMakefile has already been processed with 'make make'";\
245 mv
-f Makefile Makefile.old
; \
246 echo
"#The next line was generated by 'make make'" >Makefile
; \
247 echo
"HOST=$(HOST)" >>Makefile
; \
249 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
253 Makefile
: $(srcdir)/Makefile.in
$(srcdir)/configure
255 .
/configure
+destdir
=$(destdir
) \
257 `if [ "$(srcdir)" != "." ] ; then echo +f; fi` \
258 $(host
) +target
=$(target
))
260 ### Local Variables: ***
261 ### mode:fundamental ***
262 ### page-delimiter: "^#\f" ***
267 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY