Commit | Line | Data |
---|---|---|
321a78a5 | 1 | # Makefile for GNU binary-file utilities |
7c9e1739 | 2 | # Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. |
321a78a5 SC |
3 | |
4 | # This file is part of GNU binutils. | |
5 | ||
6 | # This program is free software; you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation; either version 2 of the License, or | |
9 | # (at your option) any later version. | |
10 | # | |
11 | # This program is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with this program; if not, write to the Free Software | |
6c9638b4 | 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
321a78a5 | 19 | |
b6de8f6a ILT |
20 | VPATH = @srcdir@ |
21 | srcdir = @srcdir@ | |
321a78a5 | 22 | |
b6de8f6a ILT |
23 | prefix = @prefix@ |
24 | exec_prefix = @exec_prefix@ | |
321a78a5 | 25 | |
b6de8f6a ILT |
26 | host_alias = @host_alias@ |
27 | target_alias = @target_alias@ | |
28 | program_transform_name = @program_transform_name@ | |
78c09e4a JM |
29 | bindir = @bindir@ |
30 | libdir = @libdir@ | |
321a78a5 SC |
31 | tooldir = $(exec_prefix)/$(target_alias) |
32 | ||
78c09e4a JM |
33 | datadir = @datadir@ |
34 | mandir = @mandir@ | |
321a78a5 SC |
35 | man1dir = $(mandir)/man1 |
36 | man2dir = $(mandir)/man2 | |
37 | man3dir = $(mandir)/man3 | |
38 | man4dir = $(mandir)/man4 | |
39 | man5dir = $(mandir)/man5 | |
40 | man6dir = $(mandir)/man6 | |
41 | man7dir = $(mandir)/man7 | |
42 | man8dir = $(mandir)/man8 | |
43 | man9dir = $(mandir)/man9 | |
78c09e4a JM |
44 | infodir = @infodir@ |
45 | includedir = @includedir@ | |
321a78a5 | 46 | |
7c9e1739 TT |
47 | # This can be referenced by the gettext configuration code. |
48 | top_builddir = .. | |
49 | ||
321a78a5 SC |
50 | SHELL = /bin/sh |
51 | ||
d60002f6 | 52 | INSTALL = @INSTALL@ |
78c09e4a JM |
53 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
54 | INSTALL_DATA = @INSTALL_DATA@ | |
321a78a5 | 55 | |
b6de8f6a | 56 | AR = @AR@ |
321a78a5 | 57 | AR_FLAGS = qv |
b6de8f6a ILT |
58 | CC = @CC@ |
59 | CFLAGS = @CFLAGS@ | |
321a78a5 SC |
60 | MAKEINFO = makeinfo |
61 | TEXI2DVI = texi2dvi | |
b6de8f6a | 62 | RANLIB = @RANLIB@ |
321a78a5 SC |
63 | TEXI2ROFF=texi2roff |
64 | MAKEOVERRIDES= | |
b6de8f6a ILT |
65 | CC_FOR_BUILD = @CC_FOR_BUILD@ |
66 | ||
67 | HDEFINES = @HDEFINES@ | |
68 | TDEFINES = | |
321a78a5 SC |
69 | |
70 | # Comment these out if using lex. | |
71 | # Distribution version | |
72 | ||
73 | # Distribution name | |
74 | ||
75 | # Where to find texinfo.tex to format docn with TeX | |
76 | TEXIDIR = $(srcdir)/../texinfo | |
77 | ||
321a78a5 SC |
78 | # These should all be the same program too. |
79 | RUN_PROG=run | |
80 | SIM_LIB=libsim.a | |
81 | ADDL_LIBS= | |
82 | ||
83 | PROGS = $(RUN_PROG) | |
84 | LIBS= $(SIM_LIB) | |
85 | ||
86 | DISTSTUFF = $(PROGS) $(LIBS) | |
87 | ||
88 | BASEDIR = $(srcdir)/../.. | |
89 | BFDDIR = $(BASEDIR)/bfd | |
90 | INCDIR = $(BASEDIR)/include | |
91 | GDBDIR = $(BASEDIR)/gdb | |
92 | INCLUDES = -I. -I$(srcdir) -I../../bfd -I$(BFDDIR) -I$(INCDIR) -I$(GDBDIR) | |
93 | ||
94 | #### host and target dependant Makefile fragments come in here. | |
95 | ### | |
96 | ||
97 | ALL_CFLAGS = $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) | |
98 | ||
99 | .c.o: | |
100 | $(CC) -c $(ALL_CFLAGS) $< | |
101 | ||
321a78a5 SC |
102 | LIBIBERTY = ../../libiberty/libiberty.a |
103 | ||
104 | BFD = ../../bfd/libbfd.a | |
321a78a5 | 105 | |
7c9e1739 TT |
106 | INTLLIBS = @INTLLIBS@ |
107 | INTLDEPS = @INTLDEPS@ | |
108 | ||
321a78a5 SC |
109 | RUNTEST = runtest |
110 | RUNTESTFLAGS = | |
111 | FLAGS_TO_PASS = \ | |
112 | "CC=$(CC)" \ | |
113 | "CFLAGS=$(CFLAGS)" \ | |
114 | "RUNTEST=$(RUNTEST)" \ | |
115 | "RUNTESTFLAGS=$(RUNTESTFLAGS)" | |
116 | ||
117 | #\f | |
118 | ## The rules | |
119 | ||
120 | all: $(LIBS) $(PROGS) | |
121 | ||
122 | ||
7c9e1739 TT |
123 | $(RUN_PROG): $(LIBS) run.o $(BFD) $(INTLDEPS) |
124 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(RUN_PROG) run.o $(SIM_LIB) $(BFD) $(INTLLIBS) $(LIBIBERTY) | |
321a78a5 SC |
125 | |
126 | $(SIM_LIB): case.o interp.o | |
127 | rm -f $(SIM_LIB) | |
128 | $(AR) $(AR_FLAGS) $(SIM_LIB) case.o interp.o | |
129 | $(RANLIB) $(SIM_LIB) | |
130 | ||
131 | case.c: gencode | |
132 | ./gencode -c >case.c ; \ | |
133 | if [ -x /usr/latest/bin/indent ] ; then \ | |
134 | /usr/latest/bin/indent case.c ; \ | |
135 | fi | |
136 | ||
137 | optable:gencode | |
138 | ./gencode >optable | |
139 | ./gencode -a >$(srcdir)/../../opcodes/w65-opc.h | |
64415b76 | 140 | |
321a78a5 | 141 | gencode:gencode.c |
b6de8f6a | 142 | $(CC_FOR_BUILD) -o gencode $< |
321a78a5 | 143 | |
b6de8f6a ILT |
144 | run.o:run.c config.h |
145 | interp.o:interp.c config.h | |
321a78a5 SC |
146 | |
147 | ||
148 | ###################################################################### | |
149 | ||
150 | mostlyclean: | |
feede9b6 | 151 | -rm -f *.o *~ \#* core binutils.?? binutils.??? case.c |
321a78a5 SC |
152 | |
153 | clean: mostlyclean | |
154 | -rm -f $(PROGS) *.o *.a | |
155 | ||
156 | distclean: | |
157 | -rm -f Makefile config.status sysdep.h *.o *~ \#* core y.* \ | |
feede9b6 JM |
158 | binutils.?? binutils.??s binutils.aux binutils.log \ |
159 | binutils.toc gencode run config.log | |
b6de8f6a | 160 | -rm -f $(PROGS) config.h stamp-h |
321a78a5 | 161 | |
602677ad | 162 | maintainer-clean realclean: clean distclean |
321a78a5 SC |
163 | -rm -f $(DISTSTUFF) TAGS |
164 | ||
165 | etags tags: TAGS | |
166 | ||
167 | TAGS: force | |
168 | etags $(INCDIR)/*.h $(srcdir)/*.[hc] | |
169 | ||
d60002f6 | 170 | install: all installdirs |
321a78a5 | 171 | for i in $(PROGS) ; do \ |
d60002f6 ILT |
172 | n=`echo $$i | sed -e 's/.new//' | sed '$(program_transform_name)'`; \ |
173 | $(INSTALL_PROGRAM) $$i $(bindir)/$$n; \ | |
321a78a5 SC |
174 | done |
175 | ||
d60002f6 ILT |
176 | installdirs: |
177 | $(SHELL) $(srcdir)/../../mkinstalldirs $(bindir) | |
178 | ||
321a78a5 SC |
179 | install-info: |
180 | ||
181 | clean-info: | |
182 | -rm -rf *.info* | |
183 | ||
184 | # Making a dist: | |
185 | # cvs rtag binutils-x-yy ld+utils | |
186 | # cvs co -r binutils-x-yy ld+utils | |
321a78a5 SC |
187 | # cd {HERE}; make dist [-f Makefile.in] |
188 | ||
189 | dist: $(DIST_NAME).tar.z | |
190 | ||
191 | diststuff: $(DISTSTUFF) | |
192 | ||
193 | $(DIST_NAME).tar.z: | |
194 | cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME) | |
195 | make diststuff -f Makefile.in | |
196 | cd ../ld; make diststuff -f Makefile.in | |
197 | cd ../gprof; make diststuff -f Makefile.in | |
198 | cd ../texinfo; mv texinfo.tex ..; rm -rf *; mv ../texinfo.tex . | |
199 | # Take out texinfo from configurable dirs | |
200 | mv ../configure.in tmp; \ | |
201 | sed -e '/^host_tools=/s/texinfo //' <tmp >../configure.in; rm tmp | |
202 | cd ..; chmod og=u `find . -print` | |
203 | cd ../..; tar chf - $(DIST_NAME) | gzip >$(DIST_NAME).tar.z | |
204 | rm -rf ../../$(DIST_NAME) | |
205 | ||
206 | ||
207 | # Dummy target to force execution of dependent targets. | |
208 | # | |
209 | force: | |
210 | ||
211 | # Target to uncomment host-specific lines in this makefile. Such lines must | |
212 | # have the following string beginning in column 1: #__<hostname>__# | |
213 | # Original Makefile is backed up as 'Makefile.old'. | |
214 | # | |
215 | # Invoke with: make make HOST=xxx | |
216 | # | |
217 | make: | |
218 | -@if test $(HOST)x = x ; then \ | |
219 | echo '\aSpecify "make make HOST=???"'; \ | |
220 | exit 1; \ | |
221 | fi ; \ | |
222 | grep -s "^#The next line was generated by 'make make'" Makefile; \ | |
223 | if test $$? = 0 ; then \ | |
224 | echo "\aMakefile has already been processed with 'make make'";\ | |
225 | exit 1; \ | |
226 | fi ; \ | |
227 | mv -f Makefile Makefile.old; \ | |
228 | echo "#The next line was generated by 'make make'" >Makefile ; \ | |
229 | echo "HOST=$(HOST)" >>Makefile ; \ | |
230 | echo >>Makefile ; \ | |
231 | sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile | |
232 | ||
b6de8f6a ILT |
233 | Makefile: Makefile.in config.status |
234 | CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status | |
235 | ||
236 | config.h: stamp-h ; @true | |
237 | stamp-h: config.in config.status | |
238 | CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status | |
239 | ||
240 | config.status: configure | |
241 | $(SHELL) ./config.status --recheck | |
321a78a5 SC |
242 | |
243 | ### Local Variables: *** | |
244 | ### mode:fundamental *** | |
245 | ### page-delimiter: "^#\f" *** | |
246 | ### End: *** | |
247 | ### end of file |