]>
Commit | Line | Data |
---|---|---|
2fa0b342 DHW |
1 | # |
2 | # Makefile for ld version 2 | |
3 | # | |
4 | # $Id$ | |
5 | # | |
de7c1ff6 SC |
6 | srcdir=../common |
7 | VPATH=../common | |
2fa0b342 | 8 | BASEDIR = ../.. |
9d5ee7e2 | 9 | HOSTDIR = ../$(HOST)/ |
2fa0b342 | 10 | INCLUDE = $(srcdir)/$(BASEDIR)/include-cygnus |
9d5ee7e2 | 11 | INCLUDES = -I. -I$(srcdir) -I$(INCLUDE) |
2fa0b342 | 12 | DEBUG = -g |
2fa0b342 | 13 | |
9d5ee7e2 SC |
14 | |
15 | #__sun3__#EXTRA_DEF=-DHOST_SYS=SUN3_SYS | |
16 | #__sun4__#EXTRA_DEF=-DHOST_SYS=SUN4_SYS | |
de7c1ff6 | 17 | #__dgux__#EXTRA_DEF=-DHOST_SYS=DGUX_SYS |
9d5ee7e2 SC |
18 | |
19 | CFLAGS = $(INCLUDES) $(EXTRA_DEF) $(DEBUG) | |
20 | LINTFLAGS = $(INCLUDES) $(EXTRA_DEF) | |
de7c1ff6 SC |
21 | |
22 | .SUFFIXES: .y | |
23 | ||
24 | .y.o: | |
25 | yacc -tvd $< | |
26 | mv y.tab.c ldgram.tab.c | |
27 | $(CC) -c $(CFLAGS) ldgram.tab.c | |
28 | mv ldgram.tab.o ldgram.o | |
29 | ||
30 | ||
2fa0b342 DHW |
31 | # go directly to ld.new in case this ld isn't capable of |
32 | # linking native object on this host. It can be renamed on | |
33 | # install. | |
9d5ee7e2 | 34 | PROGS = $(HOSTDIR)/ld.new |
2fa0b342 DHW |
35 | |
36 | # for self hosting | |
37 | GNUTARGET=a.out-generic-big | |
38 | LDEMULATION=gld | |
de7c1ff6 | 39 | BFDLIB=$(srcdir)/$(BASEDIR)/bfd/$(HOST)/libbfd.a |
2fa0b342 | 40 | |
9d5ee7e2 | 41 | OBJS= ldgram.o ldlex.o ldlang.o ldmain.o ldwrite.o ldexp.o ld-lnk960.o ld-gld68k.o \ |
2fa0b342 DHW |
42 | ld-gld.o ld-gld960.o ld-emul.o ldversion.o ldmisc.o ldsym.o ldfile.o |
43 | ||
44 | HEADERS=config.h ldmain.h ldmain.h ldmisc.h ldsym.h ldlang.h ldexp.h \ | |
45 | ldlex.h ldwrite.h ldversion.h ld-emul.h ldfile.h ldgram.h ld.h | |
46 | ||
47 | MANSOURCES=ld.tex | |
48 | ||
9d5ee7e2 | 49 | LDCSOURCES=ldlang.c ldmain.c ldwrite.c ld-lnk960.c ld-gld.c ld-gld68k.c \ |
2fa0b342 DHW |
50 | ld-gld960.c ld-emul.c ldversion.c ldmisc.c ldexp.c ldsym.c ldfile.c |
51 | ||
9f32f7c2 | 52 | GENERATED_SOURCES=ldgram.tab.c ldlex.c ldgram.tab.h y.tab.h |
2fa0b342 DHW |
53 | GENERATED_HEADERS=ldgram.tab.h |
54 | ||
55 | LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l | |
56 | ||
9d5ee7e2 | 57 | BFDSOURCES=../../bfd/common/*.c |
2fa0b342 DHW |
58 | |
59 | SOURCES= $(LDSOURCES) $(BFDSOURCES) | |
60 | LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES) | |
61 | ||
9d5ee7e2 SC |
62 | all: Makefile $(PROGS) |
63 | ||
64 | ||
65 | ||
66 | $(BFDLIB): $(BFDSOURCES) | |
67 | (cd ../bfd; make) | |
2fa0b342 | 68 | |
9d5ee7e2 | 69 | $(PROGS): $(OBJS) $(BFDLIB) |
2fa0b342 | 70 | # (cd ../bfd; make) |
de7c1ff6 SC |
71 | # 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 |
72 | # gld -o ld /lib/crt0.o $(OBJS) $(BFDLIB) -lc /usr/local/lib/gcc/sparc/1.91/gnulib | |
73 | $(CC) -Bstatic -o ld.new $(OBJS) $(BFDLIB) | |
2fa0b342 DHW |
74 | |
75 | ||
76 | ld1: ld | |
de7c1ff6 | 77 | gcc -v -B./ -o ld1 $(OBJS) $(BFDLIB) |
2fa0b342 DHW |
78 | |
79 | ld2: ld1 | |
80 | mv ld1 ld | |
de7c1ff6 | 81 | gcc -v -B./ -o ld2 $(OBJS) $(BFDLIB) |
2fa0b342 DHW |
82 | |
83 | ld3: ld2 | |
84 | mv ld2 ld | |
de7c1ff6 | 85 | gcc -v -B./ -o ld3 $(OBJS) $(BFDLIB) |
2fa0b342 DHW |
86 | |
87 | ld.dvi:ld.tex | |
88 | tex ld.tex | |
89 | ||
de7c1ff6 SC |
90 | ldgram.o: ldgram.y |
91 | ldgram.tab.h:ldgram.y | |
2fa0b342 DHW |
92 | cp y.tab.h ldgram.tab.h |
93 | ||
94 | ldlex.c: ldlex.l ldgram.tab.h | |
95 | ldlex.o: ldlex.c ldgram.tab.h | |
96 | ||
97 | ldmain.o: ldmain.c | |
98 | ldversion.o: ldversion.c | |
99 | ldfile.o: ldfile.c | |
100 | ldwrite.o: ldwrite.c | |
101 | ldlang.o: ldlang.c ldgram.tab.h | |
102 | ld-gld.o: ld-gld.c | |
9d5ee7e2 | 103 | ld-gld68k.o: ld-gld68k.c |
2fa0b342 | 104 | ld-gld960.o: ld-gld960.c |
de7c1ff6 SC |
105 | ld-emul.o: ld-emul.c |
106 | ld-lnk960.o: ld-lnk960.c | |
107 | ldexp.o: ldexp.c ldgram.tab.h | |
108 | ldmisc.o: ldmisc.c | |
109 | ldsym.o: ldsym.c | |
2fa0b342 DHW |
110 | |
111 | clean: | |
112 | - rm -f $(OBJS) $(GENERATED_SOURCES) $(GENERATED_HEADERS) | |
9d5ee7e2 | 113 | - rm -f ld ld1 ld2 ld3 ld.new |
2fa0b342 | 114 | |
9f32f7c2 | 115 | |
2fa0b342 | 116 | lintlog:$(SOURCES) Makefile |
9d5ee7e2 | 117 | $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \ |
2fa0b342 DHW |
118 | | grep -v "pointer casts may be troublesome" \ |
119 | | grep -v "possible pointer alignment problem" \ | |
120 | | grep -v "ignore" \ | |
121 | | grep -v "conversion from long may lose accuracy" \ | |
122 | | grep -v "warning: constant argument to NOT" \ | |
123 | | grep -v "enumeration type clash, operator CAST" \ | |
124 | | grep -v "warning: constant in conditional context"\ | |
125 | | grep -v "archive\.c" | |
126 | ||
127 | ||
128 | tags TAGS:$(SOURCES) $(HEADERS) | |
129 | etags -t $(SOURCES) $(HEADERS) | |
130 | ||
131 | release: | |
132 | (cd /4/steve/ld; tar cf - $(LDSOURCES) $(HEADERS) $(MANSOURCES)) | tar xf - | |
133 | ||
134 | objdump:objdump.c | |
135 | ||
136 | install: $(PROGS) | |
137 | rm -f $G960BASE/bin/$(PROGS) | |
138 | cp $(PROGS) $$G960BASE/bin/gld960c | |
139 | ||
140 | #----------------------------------------------------------------------------- | |
141 | # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT | |
142 | # | |
143 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
144 | #----------------------------------------------------------------------------- | |
145 | ||
146 | ver960.c: FORCE | |
147 | rm -f ver960.c | |
148 | echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c | |
149 | ||
150 | ||
151 | # This target should be invoked before building a new release. | |
152 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
153 | # | |
154 | roll: | |
155 | @V=`cat VERSION` ; \ | |
156 | MAJ=`sed 's/\..*//' VERSION` ; \ | |
157 | MIN=`sed 's/.*\.//' VERSION` ; \ | |
158 | V=$$MAJ.`expr $$MIN + 1` ; \ | |
159 | rm -f VERSION ; \ | |
160 | echo $$V >VERSION ; \ | |
161 | echo Version $$V | |
162 | ||
163 | # Dummy target to force execution of dependent targets. | |
164 | # | |
165 | .force: | |
166 | FORCE: | |
167 | ||
168 | # Target to uncomment host-specific lines in this makefile. Such lines must | |
169 | # have the following string beginning in column 1: #__<hostname>__# | |
170 | # Original Makefile is backed up as 'Makefile.old'. | |
171 | # | |
172 | # Invoke with: make make HOST=xxx | |
173 | # | |
174 | make: | |
175 | -@if test $(HOST)x = x ; then \ | |
176 | echo '\aSpecify "make make HOST=???"'; \ | |
177 | exit 1; \ | |
178 | fi ; \ | |
179 | grep -s "^#The next line was generated by 'make make'" Makefile; \ | |
180 | if test $$? = 0 ; then \ | |
181 | echo "\aMakefile has already been processed with 'make make'";\ | |
182 | exit 1; \ | |
183 | fi ; \ | |
184 | mv -f Makefile Makefile.old; \ | |
185 | echo "#The next line was generated by 'make make'" >Makefile ; \ | |
186 | echo "HOST=$(HOST)" >>Makefile ; \ | |
187 | echo >>Makefile ; \ | |
188 | sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile | |
189 | ||
190 | #\f | |
191 | ||
192 | Makefile: ../common/Makefile | |
193 | mv Makefile Makefile.backup | |
194 | cp ../common/Makefile . | |
195 | $(MAKE) "HOST=$(HOST)" make | |
196 | ||
197 | ### Local Variables: *** | |
198 | ### mode:fundamental *** | |
199 | ### page-delimiter: "^#\f" *** | |
200 | ### End: *** | |
201 | ### end of file |