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