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