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