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