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