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