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