Moved in from p3:
[deliverable/binutils-gdb.git] / binutils / Makefile.in
1 # Makefile for GNU binary-file utilities
2 # Copyright (C) 1989-1992 Free Software Foundation, Inc.
3
4 # This file is part of GNU binutils.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 srcdir = .
21
22 prefix = /usr/local
23
24 program_prefix =
25 program_suffix =
26 exec_prefix = $(prefix)
27 bindir = $(exec_prefix)/bin
28 libdir = $(exec_prefix)/lib
29 tooldir = $(libdir)
30
31 datadir = $(prefix)/lib
32 mandir = $(prefix)/man
33 man1dir = $(mandir)/man1
34 man2dir = $(mandir)/man2
35 man3dir = $(mandir)/man3
36 man4dir = $(mandir)/man4
37 man5dir = $(mandir)/man5
38 man6dir = $(mandir)/man6
39 man7dir = $(mandir)/man7
40 man8dir = $(mandir)/man8
41 man9dir = $(mandir)/man9
42 infodir = $(prefix)/info
43 includedir = $(prefix)/include
44 docdir = $(datadir)/doc
45
46 SHELL = /bin/sh
47
48 INSTALL = install -c
49 INSTALL_PROGRAM = $(INSTALL)
50 INSTALL_DATA = $(INSTALL)
51
52 AR = ar
53 AR_FLAGS = qv
54 CFLAGS = -g
55 MAKEINFO = makeinfo
56 RANLIB = ranlib
57 BISONFLAGS = -d
58 TEXI2ROFF=texi2roff
59
60 BISON = `if [ -f ../byacc/byacc ] ; then echo ../byacc/byacc ; else echo byacc ; fi`
61 # Comment these out if using lex.
62 LEX_OPTIONS = -I -Cem
63 LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex -S../flex/flex.skel ; else echo flex ; fi`
64
65 # Distribution version
66 VERSION=1.97
67 # Distribution name
68 DIST_NAME=binutils-${VERSION}
69
70 version=`./../gcc/gcc -dumpversion`
71
72 # Where to find texinfo.tex to format docn with TeX
73 TEXIDIR = $(srcdir)/../texinfo/fsf
74
75 MANPAGES= ar.1 nm.1 objdump.1 ranlib.1 size.1 strip.1
76
77 #CC=gcc -Wall
78 # these two are almost the same program
79 AR_PROG=ar
80 RANLIB_PROG=ranlib
81
82 # copy and strip should be the same program
83 COPY_PROG=copy
84 STRIP_PROG=strip
85
86 # These should all be the same program too.
87 SIZE_PROG=size
88 NM_PROG=nm
89 OBJDUMP_PROG=objdump
90
91 PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRIP_PROG) $(RANLIB_PROG)
92 STAGESTUFF = $(PROGS) *.o
93
94 BASEDIR = $(srcdir)/..
95 LIBDIR = ./../bfd
96
97 #### host and target dependant Makefile fragments come in here.
98 ###
99
100 INCDIR = $(BASEDIR)/include
101
102 .c.o:
103 $(CC) -c $(CFLAGS) -I. -I$(srcdir) -I$(INCDIR) $(HDEFINES) $(TDEFINES) $<
104
105 # When adding .o files, to make VPATH work in Sun Make, you have to
106 # also add a foo.o: foo.c line at the bottom of the file.
107 DISASMS = m68k-pinsn.o i960-pinsn.o i386-pinsn.o sparc-pinsn.o am29k-pinsn.o
108
109 #\f
110 ## Random definitions
111 # Hopefully all these may be flushed once we get configuration down pat.
112
113 # alloca only needed for systems which don't have it and when cc != gcc.
114 # ALLOCA = alloca.o
115
116 # nm tries to malloc enough space for the string table. The old GNU malloc
117 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
118 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
119 # there is enough memory. So use the new GNU malloc.
120 # MALLOC = gmalloc.o
121
122 # Use the GNU getopt unless you have problems with it.
123 # The IRIS version could probably benefit from being assembled with
124 # libmalloc rather than the ordinary malloc.
125 LIBIBERTY = ./../libiberty/libiberty.a
126
127 # Code shared by all the binutils.
128 BULIBS = bucomm.o version.o filemode.o
129
130 ADDL_LIBS = $(MALLOC) $(BULIBS) $(BFD) $(LIBIBERTY)
131
132 BFD = $(LIBDIR)/libbfd.a
133 #\f
134 ## The rules
135
136 all: $(ADDL_LIBS) $(PROGS)
137
138 check:
139 /bin/sh $(srcdir)/sanity.sh .
140
141 test-install:
142 /bin/sh $(srcdir)/sanity.sh $(bindir)
143
144 info: binutils.info
145
146 #$(BFD):$(LIBDIR)/../common/*.c
147 # (cd $(LIBDIR); make)
148
149 $(SIZE_PROG): $(ADDL_LIBS) size.o $(BFD)
150 $(CC) $(LDFLAGS) $(CFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(LOADLIBES)
151
152 $(COPY_PROG): $(ADDL_LIBS) copy.o not-strip.o $(BFD)
153 $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o not-strip.o $(ADDL_LIBS) $(LOADLIBES)
154
155 $(STRIP_PROG): $(ADDL_LIBS) copy.o is-strip.o $(BFD)
156 $(CC) $(LDFLAGS) $(CFLAGS) -o $(STRIP_PROG) copy.o is-strip.o $(ADDL_LIBS) $(LOADLIBES)
157
158 $(NM_PROG): $(ADDL_LIBS) nm.o $(BFD)
159 $(CC) $(LDFLAGS) $(CFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(LOADLIBES)
160
161 $(OBJDUMP_PROG): $(ADDL_LIBS) size.o objdump.o $(DISASMS) $(BFD)
162 $(CC) $(LDFLAGS) $(CFLAGS) -o $(OBJDUMP_PROG) objdump.o $(DISASMS) $(ADDL_LIBS) $(LOADLIBES)
163
164 arparse.c:arparse.y
165 $(BISON) $(BISONFLAGS) $(srcdir)/arparse.y
166 -mv y.tab.c arparse.c
167 -mv y.tab.h arparse.h
168
169
170 arlex.c: arlex.l
171 $(LEX) $(LEX_OPTIONS) $(srcdir)/arlex.l
172 mv lex.yy.c arlex.c
173
174 $(AR_PROG): $(ADDL_LIBS) ar.o arparse.o arlex.o not-ranlib.o $(BFD) arsup.o
175 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o arparse.o arlex.o arsup.o not-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
176
177 $(RANLIB_PROG): $(ADDL_LIBS) ar.o is-ranlib.o arparse.o arlex.o arsup.o $(BFD)
178 $(CC) $(LDFLAGS) $(CFLAGS) -o $(RANLIB_PROG) ar.o arparse.o arlex.o arsup.o is-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
179
180 # This rule creates a single binary that switches between ar and ranlib
181 # by looking at argv[0]. Use this kludge to save some disk space.
182 # However, you have to install things by hand.
183 # (That is after 'make install', replace the installed ranlib by a link to ar.)
184
185 # Alternatively, you can install ranlib.sh as ranlib.
186
187 ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD)
188 $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(LOADLIBES)
189 -rm -f $(RANLIB_PROG)
190 -ln $(AR_PROG) $(RANLIB_PROG)
191
192 # copy and strip in one binary that uses argv[0] to decide its action.
193
194 copy_with_strip: $(ADDL_LIBS) copy.o maybe-strip.o $(BFD)
195 $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o maybe-strip.o $(ADDL_LIBS) $(LOADLIBES)
196 -rm -f $(STRIP_PROG)
197 -ln $(COPY_PROG) $(STRIP_PROG)
198
199 stage1: force
200 - mkdir stage1
201 - mv -f $(STAGESTUFF) stage1
202
203 stage2: force
204 - mkdir stage2
205 - mv -f $(STAGESTUFF) stage2
206
207 stage3: force
208 - mkdir stage3
209 - mv -f $(STAGESTUFF) stage3
210
211 against=stage2
212
213 comparison: force
214 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
215
216 de-stage1: force
217 - (cd stage1 ; mv -f * ..)
218 - rmdir stage1
219
220 de-stage2: force
221 - (cd stage2 ; mv -f * ..)
222 - rmdir stage2
223
224 de-stage3: force
225 - (cd stage3 ; mv -f * ..)
226 - rmdir stage3
227
228 ######################################################################
229 # DOCUMENTATION TARGETS
230 # TeX output
231 binutils.dvi: $(srcdir)/binutils.texi
232 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/binutils.texi
233 texindex binutils.??
234 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/binutils.texi
235
236 # info file for online browsing
237 binutils.info: $(srcdir)/binutils.texi
238 $(MAKEINFO) -o binutils.info $(srcdir)/binutils.texi
239
240 # different targets for -ms, -mm, -me
241 # Try to use a recent texi2roff. v2 was put on prep in jan91.
242 # If you want an index, see texi2roff doc for postprocessing
243 # and add -i to texi2roff invocations below.
244 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
245 # correspondint -e lines when later texi2roff's are current)
246 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
247 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
248 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
249 # + @alphaenumerate is ridiculously new, turned into @enumerate
250
251 # roff output (-ms)
252 binutils.ms: $(srcdir)/binutils.texi
253 sed -e '/\\input texinfo/d' \
254 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
255 -e '/^@ifinfo/,/^@end ifinfo/d' \
256 -e '/^@c/d' \
257 -e 's/{.*,,/{/' \
258 -e 's/@ / /g' \
259 -e 's/^@alphaenumerate/@enumerate/g' \
260 -e 's/^@end alphaenumerate/@end enumerate/g' \
261 $(srcdir)/binutils.texi | \
262 $(TEXI2ROFF) -ms | \
263 sed -e 's/---/\\(em/g' \
264 >binutils.ms
265
266 # roff output (-mm)
267 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
268 # try leaving them in
269 binutils.mm: $(srcdir)/binutils.texi
270 sed -e '/\\input texinfo/d' \
271 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
272 -e '/^@ifinfo/,/^@end ifinfo/d' \
273 -e '/^@c/d' \
274 -e 's/{.*,,/{/' \
275 -e '/@noindent/d' \
276 -e 's/@ / /g' \
277 -e 's/^@alphaenumerate/@enumerate/g' \
278 -e 's/^@end alphaenumerate/@end enumerate/g' \
279 $(srcdir)/binutils.texi | \
280 $(TEXI2ROFF) -mm | \
281 sed -e 's/---/\\(em/g' \
282 >binutils.mm
283
284 # roff output (-me)
285 binutils.me: $(srcdir)/binutils.texi
286 sed -e '/\\input texinfo/d' \
287 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
288 -e '/^@ifinfo/,/^@end ifinfo/d' \
289 -e '/^@c/d' \
290 -e 's/{.*,,/{/' \
291 -e 's/@ / /g' \
292 -e 's/^@alphaenumerate/@enumerate/g' \
293 -e 's/^@end alphaenumerate/@end enumerate/g' \
294 $(srcdir)/binutils.texi | \
295 $(TEXI2ROFF) -me | \
296 sed -e 's/---/\\(em/g' \
297 >binutils.me
298
299
300 ######################################################################
301
302 clean:
303 -rm -f *.o *~ \#* core $(STAGESTUFF) TAGS binutils.?? binutils.???
304
305 etags tags: TAGS
306
307 TAGS: force
308 etags $(INCDIR)/*.h $(BFDSRC)/*.[hc] *.[hc]
309
310 realclean: clean
311 -rm -f $(STAGESTUFF) TAGS
312
313 install: all
314 -parent=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
315 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
316 -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
317 for i in $(PROGS) ; do \
318 $(INSTALL_PROGRAM) $$i $(bindir)/$(program_prefix)$${i}$(program_suffix) ; \
319 done
320 -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
321 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
322 -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
323 for i in $(MANPAGES) ; do \
324 $(INSTALL_DATA) $(srcdir)/$$i $(man1dir)/$(program_prefix)$${i}$(program_suffix) ; \
325 done
326
327 install-info: info
328 -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
329 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
330 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
331 for i in *.info* ; do \
332 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
333 done
334
335 clean-info:
336 -rm -rf *.info*
337
338 dist: $(DIST_NAME).tar.Z
339
340 $(DIST_NAME).tar.Z:
341 cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME)
342 make arparse.c arlex.c binutils.mm -f Makefile.in
343 cd ../ld; make ldgram.c ldgram.h ldlex.c ld.mm -f Makefile.in
344 cd ../..; tar chf - $(DIST_NAME) | compress >$(DIST_NAME).tar.Z
345 rm -rf ../../$(DIST_NAME)
346
347 # These get around a bug in Sun Make in SunOS 4.1.1
348 alloca.o:alloca.c
349 am29k-pinsn.o: am29k-pinsn.c
350 ar.o: ar.c
351 arsup.o: arsup.c
352 bucomm.o: bucomm.c
353 copy.o: copy.c
354 cplus-dem.o:cplus-dem.c
355 filemode.o:filemode.c
356 getopt.o:getopt.c
357 getopt1.o:getopt1.c
358 gmalloc.o:gmalloc.c
359 i960-pinsn.o: i960-pinsn.c
360 is-ranlib.o:is-ranlib.c
361 is-strip.o:is-strip.c
362 m68k-pinsn.o: m68k-pinsn.c
363 maybe-ranlib.o:maybe-ranlib.c
364 maybe-strip.o:maybe-strip.c
365 nm.o: nm.c
366 not-ranlib.o:not-ranlib.c
367 not-strip.o:not-strip.c
368 objdump.o: objdump.c
369 size.o: size.c
370 sparc-pinsn.o: sparc-pinsn.c
371 i386-pinsn.o: i386-pinsn.c
372 strip.o:strip.c
373 version.o: $(srcdir)/version.c
374 $(CC) $(CFLAGS) -I. -I$(srcdir) -I$(INCDIR) $(HDEFINES) $(TDEFINES) -DVERSION='"$(VERSION)"' -c $(srcdir)/version.c
375
376 #-----------------------------------------------------------------------------
377 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
378 #
379 # 'VERSION' file must be present and contain a string of the form "x.y"
380 #-----------------------------------------------------------------------------
381
382 ver960.c: FORCE
383 rm -f ver960.c
384 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
385
386
387 # Dummy target to force execution of dependent targets.
388 #
389 force:
390
391 # Target to uncomment host-specific lines in this makefile. Such lines must
392 # have the following string beginning in column 1: #__<hostname>__#
393 # Original Makefile is backed up as 'Makefile.old'.
394 #
395 # Invoke with: make make HOST=xxx
396 #
397 make:
398 -@if test $(HOST)x = x ; then \
399 echo '\aSpecify "make make HOST=???"'; \
400 exit 1; \
401 fi ; \
402 grep -s "^#The next line was generated by 'make make'" Makefile; \
403 if test $$? = 0 ; then \
404 echo "\aMakefile has already been processed with 'make make'";\
405 exit 1; \
406 fi ; \
407 mv -f Makefile Makefile.old; \
408 echo "#The next line was generated by 'make make'" >Makefile ; \
409 echo "HOST=$(HOST)" >>Makefile ; \
410 echo >>Makefile ; \
411 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
412
413 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
414 $(SHELL) ./config.status
415
416 ### Local Variables: ***
417 ### mode:fundamental ***
418 ### page-delimiter: "^#\f" ***
419 ### End: ***
420 ### end of file
This page took 0.037843 seconds and 4 git commands to generate.