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