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