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