New targets binutils.mm, binutils.me
[binutils-gdb.git] / binutils / Makefile.in
1 ### Makefile for GNU binary-file utilities
2
3 #$Id$
4
5 srcdir = .
6 destdir = /usr/local
7
8 # Distribution version
9 VERSION=1.90
10 # Distribution name
11 DIST_NAME=binutils-beta-${VERSION}
12
13 version=`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion`
14 prefix = $(destdir)
15 bindir = $(prefix)/H-$(host_alias)/T-independent/bin
16
17 # Where to find texinfo.tex to format docn with TeX
18 TEXIDIR = $(srcdir)/../texinfo/fsf
19
20 #INSTALL = install -c
21 #INSTALL_PROGRAM = $(INSTALL)
22 #INSTALL_FILE = $(INSTALL)
23
24 #CC=gcc -Wall
25 # these two are almost the same program
26 AR_PROG=ar
27 RANLIB_PROG=ranlib
28
29 # copy and strip should be the same program
30 COPY_PROG=copy
31 STRIP_PROG=strip
32
33 # These should all be the same program too.
34 SIZE_PROG=size
35 NM_PROG=nm
36 OBJDUMP_PROG=objdump
37
38 PROGS = $(SIZE_PROG) $(COPY_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRIP_PROG) $(RANLIB_PROG)
39 STAGESTUFF = $(PROGS) *.o
40
41 BASEDIR = $(unsubdir)/..
42 LIBDIR = $(unsubdir)/../bfd$(subdir)
43
44 #### host and target dependant Makefile fragments come in here.
45 ###
46
47 INCDIR = $(BASEDIR)/include
48
49 CFLAGS = -g -I. -I$(INCDIR) $(HDEFINES) $(TDEFINES)
50
51 # When adding .o files, to make VPATH work in Sun Make, you have to
52 # also add a foo.o: foo.c line at the bottom of the file.
53 DISASMS = m68k-pinsn.o i960-pinsn.o sparc-pinsn.o am29k-pinsn.o
54
55 #\f
56 ## Random definitions
57 # Hopefully all these may be flushed once we get configuration down pat.
58
59 # alloca only needed for systems which don't have it and when cc != gcc.
60 # ALLOCA = alloca.o
61
62 # nm tries to malloc enough space for the string table. The old GNU malloc
63 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
64 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
65 # there is enough memory. So use the new GNU malloc.
66 # MALLOC = gmalloc.o
67
68 # Use the GNU getopt unless you have problems with it.
69 # The IRIS version could probably benefit from being assembled with
70 # libmalloc rather than the ordinary malloc.
71 LIBIBERTY = $(unsubdir)/../libiberty$(subdir)/libiberty.a
72
73 # Code shared by all the binutils.
74 BULIBS = bucomm.o version.o filemode.o
75
76 ADDL_LIBS = $(MALLOC) $(BULIBS) $(BFD) $(LIBIBERTY)
77
78 BFD = $(LIBDIR)/libbfd.a
79 #\f
80 ## The rules
81
82 all: $(ADDL_LIBS) $(PROGS)
83
84
85 #$(BFD):$(LIBDIR)/../common/*.c
86 # (cd $(LIBDIR); make)
87
88 $(SIZE_PROG): $(ADDL_LIBS) size.o $(BFD)
89 $(CC) $(LDFLAGS) $(CFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(LOADLIBES)
90
91 $(COPY_PROG): $(ADDL_LIBS) copy.o $(BFD)
92 $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o $(ADDL_LIBS) $(LOADLIBES)
93
94 $(NM_PROG): $(ADDL_LIBS) nm.o $(BFD)
95 $(CC) $(LDFLAGS) $(CFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(LOADLIBES)
96
97 $(OBJDUMP_PROG): $(ADDL_LIBS) size.o objdump.o $(DISASMS) $(BFD)
98 $(CC) $(LDFLAGS) $(CFLAGS) -o $(OBJDUMP_PROG) objdump.o $(DISASMS) $(ADDL_LIBS) $(LOADLIBES)
99
100 $(AR_PROG): $(ADDL_LIBS) ar.o not-ranlib.o $(BFD)
101 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o not-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
102
103 $(RANLIB_PROG): $(ADDL_LIBS) ar.o is-ranlib.o $(BFD)
104 $(CC) $(LDFLAGS) $(CFLAGS) -o $(RANLIB_PROG) ar.o is-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
105
106 # This rule creates a single binary that switches between ar and ranlib
107 # by looking at argv[0]. Use this kludge to save some disk space.
108 # However, you have to install things by hand.
109 # (That is after 'make install', replace the installed ranlib by a link to ar.)
110
111 # Alternatively, you can install ranlib.sh as ranlib.
112
113 ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD)
114 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
115 -rm -f $(RANLIB_PROG)
116 -ln $(AR_PROG) $(RANLIB_PROG)
117
118 $(STRIP_PROG): $(COPY_PROG)
119 -rm -f $(STRIP_PROG)
120 -ln $(COPY_PROG) $(STRIP_PROG)
121
122 stage1: force
123 - mkdir stage1
124 - mv -f $(STAGESTUFF) stage1
125
126 stage2: force
127 - mkdir stage2
128 - mv -f $(STAGESTUFF) stage2
129
130 stage3: force
131 - mkdir stage3
132 - mv -f $(STAGESTUFF) stage3
133
134 against=stage2
135
136 comparison: force
137 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
138
139 de-stage1: force
140 - (cd stage1 ; mv -f * ..)
141 - rmdir stage1
142
143 de-stage2: force
144 - (cd stage2 ; mv -f * ..)
145 - rmdir stage2
146
147 de-stage3: force
148 - (cd stage3 ; mv -f * ..)
149 - rmdir stage3
150
151 ######################################################################
152 # DOCUMENTATION TARGETS
153 # TeX output
154 binutils.dvi: binutils.texinfo
155 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex binutils.texinfo
156 texindex binutils.??
157 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex binutils.texinfo
158
159 # info file for online browsing
160 binutils.info: binutils.texinfo
161 makeinfo binutils.texinfo
162
163 # different targets for -ms, -mm, -me
164 # (we don't use a variable because we don't trust all makes to handle
165 # a var in the target name right).
166 # roff output (-ms)
167 binutils.ms: binutils.texinfo
168 sed -e '/\\input texinfo/d' \
169 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
170 binutils.texinfo | \
171 texi2roff -ms >binutils.ms
172
173 # roff output (-mm)
174 binutils.mm: binutils.texinfo
175 sed -e '/\\input texinfo/d' \
176 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
177 binutils.texinfo | \
178 texi2roff -mm >binutils.mm
179
180 # roff output (-me)
181 binutils.me: binutils.texinfo
182 sed -e '/\\input texinfo/d' \
183 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
184 binutils.texinfo | \
185 texi2roff -me >binutils.me
186
187
188 ######################################################################
189
190 clean:
191 -rm -f *.o *~ \#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
192
193 etags tags: TAGS
194
195 TAGS: force
196 etags $(INCDIR)/*.h $(BFDSRC)/*.[hc] *.[hc]
197
198 realclean: clean
199 -rm -f $(STAGESTUFF) TAGS
200
201 install: $(PROGS)
202 for i in $(PROGS) ; do \
203 cp $$i $(bindir)/$$i.new ; \
204 mv -f $(bindir)/$$i.new $(bindir)/$$i ; \
205 done
206
207 dist: $(DIST_NAME).tar.Z
208
209 $(DIST_NAME).tar.Z: proto-dir
210 ln -s proto-dir $(DIST_NAME)
211 tar chf - $(DIST_NAME) | compress >$(DIST_NAME).tar.Z
212 rm -rf $(DIST_NAME)
213
214 # These get around a bug in Sun Make in SunOS 4.1.1
215 alloca.o:alloca.c
216 am29k-pinsn.o: am29k-pinsn.c
217 ar.o: ar.c
218 bucomm.o: bucomm.c
219 copy.o: copy.c
220 cplus-dem.o:cplus-dem.c
221 filemode.o:filemode.c
222 getopt.o:getopt.c
223 getopt1.o:getopt1.c
224 gmalloc.o:gmalloc.c
225 i960-pinsn.o: i960-pinsn.c
226 is-ranlib.o:is-ranlib.c
227 m68k-pinsn.o: m68k-pinsn.c
228 maybe-ranlib.o:maybe-ranlib.c
229 nm.o: nm.c
230 not-ranlib.o:not-ranlib.c
231 objdump.o: objdump.c
232 size.o: size.c
233 sparc-pinsn.o: sparc-pinsn.c
234 strip.o:strip.c
235 version.o: version.c
236
237 #-----------------------------------------------------------------------------
238 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
239 #
240 # 'VERSION' file must be present and contain a string of the form "x.y"
241 #-----------------------------------------------------------------------------
242
243 ver960.c: FORCE
244 rm -f ver960.c
245 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
246
247
248 # Dummy target to force execution of dependent targets.
249 #
250 force:
251
252 # Target to uncomment host-specific lines in this makefile. Such lines must
253 # have the following string beginning in column 1: #__<hostname>__#
254 # Original Makefile is backed up as 'Makefile.old'.
255 #
256 # Invoke with: make make HOST=xxx
257 #
258 make:
259 -@if test $(HOST)x = x ; then \
260 echo '\aSpecify "make make HOST=???"'; \
261 exit 1; \
262 fi ; \
263 grep -s "^#The next line was generated by 'make make'" Makefile; \
264 if test $$? = 0 ; then \
265 echo "\aMakefile has already been processed with 'make make'";\
266 exit 1; \
267 fi ; \
268 mv -f Makefile Makefile.old; \
269 echo "#The next line was generated by 'make make'" >Makefile ; \
270 echo "HOST=$(HOST)" >>Makefile ; \
271 echo >>Makefile ; \
272 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
273
274 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
275 $(SHELL) ./config.status
276
277 ### Local Variables: ***
278 ### mode:fundamental ***
279 ### page-delimiter: "^#\f" ***
280 ### End: ***
281 ### end of file