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