z8kgen: temp file to generate z8k-opc.h from
[external/binutils.git] / bfd / makefile.dos
1 #    Makefile template for Configure for the BFD library.
2 #    Copyright (C) 1990, 1991 Free Software Foundation, Inc.
3 #    Written by Cygnus Support.
4
5 # This file is part of BFD, the Binary File Descriptor library.
6
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 # $Id$
22
23 HDEPFILES=
24 TDEPFILES=
25 HDEFINES=-D__MSDOS__
26 TDEFINES=
27 CSWITCHES=
28
29 srcdir = .
30 ddestdir = /usr/local
31 libdir = $(ddestdir)/lib
32 docdir = $(srcdir)$(subdir)/doc
33 includedir= $(ddestdir)/include
34 RANLIB = ar rvs
35 AR = ar
36 AR_FLAGS = clq
37 INCDIR = $(srcdir)/../include
38 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
39 DEP = mkdep
40 MINUS_G=-O
41
42 SUBDIRS = doc
43
44 #### host and target dependent Makefile fragments come in here.
45 # Target: Hitachi H8/300 using IEEE-695 object file format
46 # Avoid dragging in a lot of other architectures and formats.
47 TDEFAULTS=-DSELECT_ARCHITECTURES=bfd_h8300_arch -DSELECT_VECS=&ieee_vec\,&srec_vec\,&h8300coff_vec
48
49
50 # Change this (to MINIMIZE=1) to save space in executables.
51 # Currently, all this does is control the target_vector in targets.c.
52 MINIMIZE=0
53
54 TARGETLIB = libbfd.a
55 CFLAGS = $(MINUS_G) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) # -DINTEL960VERSION
56
57
58 BFD_LIBS = libbfd.o opncls.o bfd.o archive.o targets.o cache.o \
59         archures.o core.o section.o format.o syms.o reloc.o init.o ctor.o
60
61 BFD_MACHINES = cpu-h8300.o cpu-i960.o cpu-sparc.o cpu-m68k.o cpu-m88k.o \
62         cpu-vax.o cpu-mips.o cpu-a29k.o cpu-i386.o cpu-rs6000.o
63
64 BFD_BACKENDS = oasys.o ieee.o srec.o elf.o stab-syms.o\
65         aout64.o aout32.o demo64.o sunos.o newsos3.o i386aout.o bout.o \
66         coff-i960.o coff-a29k.o coff-m68k.o coff-i386.o coff-m88k.o \
67         coff-mips.o coff-rs6000.o coff-h8300.o
68
69 OPTIONAL_BACKENDS = trad-core.o
70
71 BFD_H=$(INCDIR)/bfd.h
72
73 # C source files that correspond to .o's.
74 CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c archures.c \
75          coff-i386.c aout64.c aout32.c sunos.c demo64.c coff-i960.c srec.c \
76          oasys.c ieee.c coff-m68k.c coff-a29k.c coff-rs6000.c \
77          format.c section.c core.c syms.c stabs-syms.c reloc.c init.c ctor.c \
78          coff-m88k.c coff-mips.c trad-core.c newsos3.c i386aout.c bout.c elf.c \
79         cpu-h8300.c cpu-i960.c cpu-sparc.c cpu-m68k.c cpu-m88k.c \
80         cpu-vax.c cpu-mips.c cpu-a29k.c cpu-i386.c cpu-rs6000.c coff-h8300.c
81
82 STAGESTUFF = $(TARGETLIB) $(OFILES)
83
84 all: $(TARGETLIB) 
85 #       $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)"
86
87 all-info: force
88         $(MAKE) subdir_do DO=all-info "DODIRS=$(SUBDIRS)"
89
90 install-info: force
91         $(MAKE) subdir_do DO=install-info "DODIRS=$(SUBDIRS)"
92
93 # HDEPFILES comes from the host config; TDEPFILES from the target config.
94 OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(BFD_MACHINES) $(HDEPFILES) $(TDEPFILES)
95
96 $(TARGETLIB): $(OFILES)
97         -rm -f $(TARGETLIB)
98         >target.rf $(AR_FLAGS) $(TARGETLIB) $(OFILES)
99         $(AR) @target.rf
100         $(RANLIB) $(TARGETLIB)
101
102 # When compiling targets.c, supply the default target info from configure.
103 targets.o: targets.c
104         >targets.rf $(CFLAGS) -c -DMINIMIZE=$(MINIMIZE) $(TDEFAULTS) targets.c
105         $(CC) @targets.rf
106
107 subdir_do: force
108         for i in $(DODIRS); do \
109                 if [ -d $(unsubdir)/$$i ] ; then \
110                         if (cd $(unsubdir)/$$i$(subdir); \
111                                 $(MAKE) \
112                                         "against=$(against)" \
113                                         "AR=$(AR)" \
114                                         "CC=$(CC)" \
115                                         "AR_FLAGS=$(AR_FLAGS)" \
116                                         "RANLIB=$(RANLIB)" \
117                                         "BISON=$(BISON)" $(DO)) ; then true ; \
118                         else exit 1 ; fi ; \
119                 else true ; fi ; \
120         done
121
122 stage1: force
123         - mkdir stage1
124         - mv -f $(STAGESTUFF) stage1
125         $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)"
126
127 stage2: force
128         - mkdir stage2
129         - mv -f $(STAGESTUFF) stage2
130         $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)"
131
132 stage3: force
133         - mkdir stage3
134         - mv -f $(STAGESTUFF) stage3
135         $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)"
136
137 against=stage2
138
139 comparison: force
140         for i in *.o ; do cmp $$i $(against)/$$i || exit 1 ; done
141         $(MAKE) subdir_do DO=comparison "DODIRS=$(SUBDIRS)"
142
143 de-stage1: force
144         - (cd stage1 ; mv -f $(STAGESTUFF) ..)
145         - rmdir stage1
146         $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)"
147
148 de-stage2: force
149         - (cd stage2 ; mv -f $(STAGESTUFF) ..)
150         - rmdir stage2
151         $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)"
152
153 de-stage3: force
154         - (cd stage3 ; mv -f $(STAGESTUFF) ..)
155         - rmdir stage3
156         $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)"
157
158 tags etags: TAGS
159
160 TAGS: force
161         etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c
162
163 clean:
164         rm -f *.[oa] *~ core *.E *.p *.ip
165         $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)"
166
167 clobber realclean: clean
168         rm -f libbfd.a TAGS
169         $(MAKE) subdir_do DO=clobber "DODIRS=$(SUBDIRS)"
170
171 # Mark everything as depending on config.status, since the timestamp on
172 # sysdep.h might actually move backwards if we reconfig and relink it
173 # to a different hosts/h-xxx.h file.  This will force a recompile anyway.
174 RECONFIG = # config.status
175 $(BFD_LIBS):  libbfd.h $(BFD_H) $(RECONFIG)
176 $(BFD_MACHINES):  libbfd.h $(BFD_H) $(RECONFIG)
177 $(BFD_BACKENDS):  libbfd.h $(BFD_H) $(RECONFIG)
178 $(OPTIONAL_BACKENDS):  libbfd.h $(BFD_H) $(RECONFIG)
179
180 # Get around a Sun Make bug in SunOS 4.1.1 with VPATH
181 cpu-i386.o: cpu-i386.c
182
183 saber:
184         #suppress 65 on bfd_map_over_sections 
185         #suppress 66 on bfd_map_over_sections 
186         #suppress 67 on bfd_map_over_sections 
187         #suppress 68 on bfd_map_over_sections 
188         #suppress 69 on bfd_map_over_sections 
189         #suppress 70 on bfd_map_over_sections 
190         #suppress 110 in bfd_map_over_sections 
191         #suppress 112 in bfd_map_over_sections 
192         #suppress 530 
193         #suppress 590 in swap_exec_header 
194         #suppress 590 in _bfd_dummy_core_file_matches_executable_p 
195         #suppress 590 in bfd_dont_truncate_arname
196         #suppress 590 on ignore 
197         #suppress 590 on abfd 
198         #setopt load_flags $(CFLAGS)
199         #load $(CFILES)
200
201
202 #-----------------------------------------------------------------------------
203 #               'STANDARD' GNU/960 TARGETS BELOW THIS POINT
204 #
205 # 'VERSION' file must be present and contain a string of the form "x.y"
206 #-----------------------------------------------------------------------------
207
208 ver960.c: FORCE
209         rm -f ver960.c
210         echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
211
212
213 # This target should be invoked before building a new release.
214 # 'VERSION' file must be present and contain a string of the form "x.y"
215 #
216 roll:
217         @V=`cat VERSION`                ; \
218         MAJ=`sed 's/\..*//' VERSION`    ; \
219         MIN=`sed 's/.*\.//' VERSION`    ; \
220         V=$$MAJ.`expr $$MIN 1`  ; \
221         rm -f VERSION                   ; \
222         echo $$V >VERSION               ; \
223         echo Version $$V
224
225 # Dummy target to force execution of dependent targets.
226 #
227 force:
228
229 install:
230         cp libbfd.a $(libdir)/libbfd.a.new
231         $(RANLIB) $(libdir)/libbfd.a.new
232         mv -f $(libdir)/libbfd.a.new $(libdir)/libbfd.a
233         cp $(INCDIR)/bfd.h $(includedir)/bfd.h
234         $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)"
235
236 # Target to uncomment host-specific lines in this makefile.  Such lines must
237 # have the following string beginning in column 1: #__<hostname>__#
238 # Original Makefile is backed up as 'Makefile.old'.
239 #
240 # Invoke with:  make make HOST=xxx
241 #
242 make:
243         -@if test $(HOST)x = x ; then \
244                 echo '\aSpecify "make make HOST=???"'; \
245                 exit 1; \
246         fi ; \
247         grep -s "^#The next line was generated by 'make make'" Makefile; \
248         if test $$? = 0 ; then  \
249                 echo "\aMakefile has already been processed with 'make make'";\
250                 exit 1; \
251         fi ; \
252         mv -f Makefile Makefile.old; \
253         echo "#The next line was generated by 'make make'"       >Makefile ; \
254         echo "HOST=$(HOST)"                                     >>Makefile ; \
255         echo                                                    >>Makefile ; \
256         sed "s/^#__$(HOST)__#//" < Makefile.old                 >>Makefile
257
258 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
259         $(SHELL) ./config.status
260
261 dep: $(CFILES)
262         mkdep $(CFLAGS) $?
263
264
265
266 headers:
267         (cd $(docdir); $(MAKE) protos)
268         # Rebuild prototypes in bfd.h
269         cp $(docdir)/bfd.h $(BFD_H)
270         cp $(docdir)/libbfd.h $(srcdir)/libbfd.h
271         cp $(docdir)/libcoff.h $(srcdir)/libcoff.h
272
273 bfd.info:
274         ( cd $(docdir); $(MAKE) bfd.info)
275
276 bfd.dvi:
277         (cd $(docdir); $(MAKE) bfd.dvi)
278
279 bfd.ps: 
280         (cd $(docdir); $(MAKE) bfd.ps)
281
282 # What appears below is generated by a hacked mkdep using gcc -MM.
283
284 # DO NOT DELETE THIS LINE -- mkdep uses it.
285 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
286
287 libbfd.o : libbfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h 
288 opncls.o : opncls.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h 
289 bfd.o : bfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h 
290 archive.o : archive.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
291   $(INCDIR)/ar.h $(INCDIR)/ranlib.h 
292 targets.o : targets.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h 
293 cache.o : cache.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h 
294 archures.o : archures.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h 
295 aout64.o : aout64.c 
296 aout32.o : aout32.c aoutx.h $(INCDIR)/bfd.h $(INCDIR)/ansidecl.h \
297   $(INCDIR)/obstack.h libaout.h libbfd.h $(INCDIR)/aout64.h \
298   $(INCDIR)/stabgnu.h $(INCDIR)/stab.def $(INCDIR)/ar.h 
299 sunos.o : sunos.c aoutf1.h $(INCDIR)/bfd.h $(INCDIR)/obstack.h \
300   libaout.h libbfd.h $(INCDIR)/aout64.h $(INCDIR)/stabgnu.h \
301   $(INCDIR)/stab.def $(INCDIR)/ar.h 
302 demo64.o : demo64.c 
303
304 srec.o : srec.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h 
305 oasys.o : oasys.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
306   $(INCDIR)/oasys.h liboasys.h 
307 ieee.o : ieee.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
308   $(INCDIR)/ieee.h libieee.h 
309 coff-h8300.o: coff-h8300.c  $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
310   $(INCDIR)/coff-h8300.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h 
311 format.o : format.c $(INCDIR)/bfd.h \
312   $(INCDIR)/obstack.h libbfd.h 
313 section.o : section.c $(INCDIR)/bfd.h \
314   $(INCDIR)/obstack.h libbfd.h 
315 core.o : core.c $(INCDIR)/bfd.h \
316   $(INCDIR)/obstack.h libbfd.h 
317 syms.o : syms.c $(INCDIR)/bfd.h \
318   $(INCDIR)/obstack.h libbfd.h 
319 syms.o : stab-syms.c
320 reloc.o : reloc.c $(INCDIR)/bfd.h \
321   $(INCDIR)/obstack.h libbfd.h 
322
323 trad-core.o : trad-core.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h \
324   libbfd.h libaout.h 
325 newsos3.o : newsos3.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
326   $(INCDIR)/aout64.h $(INCDIR)/stabgnu.h $(INCDIR)/stab.def \
327   $(INCDIR)/ar.h libaout.h 
328 i386aout.o : i386aout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
329   $(INCDIR)/aout64.h $(INCDIR)/stabgnu.h $(INCDIR)/stab.def \
330   $(INCDIR)/ar.h libaout.h 
331 bout.o : bout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \
332   $(INCDIR)/bout.h $(INCDIR)/stabgnu.h $(INCDIR)/stab.def libaout.h 
333
334 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY