Brought forward from p3:
[deliverable/binutils-gdb.git] / gas / Makefile.in
CommitLineData
fecd2382 1# Makefile for GNU Assembler
79a54a5b 2# Copyright (C) 1987-1992 Free Software Foundation, Inc.
fecd2382
RP
3
4#This file is part of GNU GAS.
5
6#GNU GAS is free software; you can redistribute it and/or modify
7#it under the terms of the GNU General Public License as published by
1058238c 8#the Free Software Foundation; either version 2, or (at your option)
fecd2382
RP
9#any later version.
10
11#GNU GAS 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 GNU GAS; see the file COPYING. If not, write to
18#the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19
fecd2382
RP
20# The targets for external use include:
21# all, doc, proto, install, uninstall, includes, TAGS,
22# clean, cleanconfig, realclean, stage1, stage2, stage3, stage4.
23
24# Variables that exist for you to override.
25# See below for how to change them for certain systems.
26
1058238c
RP
27srcdir = .
28
29prefix = /usr/local
30
787c6bfe 31program_prefix =
4b857710 32program_suffix =
787c6bfe
RP
33exec_prefix = $(prefix)
34bindir = $(exec_prefix)/bin
35libdir = $(exec_prefix)/lib
36tooldir = $(libdir)
37
1058238c 38datadir = $(prefix)/lib
787c6bfe 39mandir = $(prefix)/man
1058238c
RP
40man1dir = $(mandir)/man1
41man2dir = $(mandir)/man2
42man3dir = $(mandir)/man3
43man4dir = $(mandir)/man4
44man5dir = $(mandir)/man5
45man6dir = $(mandir)/man6
46man7dir = $(mandir)/man7
47man8dir = $(mandir)/man8
48man9dir = $(mandir)/man9
787c6bfe 49infodir = $(prefix)/info
1058238c
RP
50includedir = $(prefix)/include
51docdir = $(datadir)/doc
52
fecd2382 53SHELL = /bin/sh
1058238c 54
fecd2382 55INSTALL = install -c
fecd2382 56INSTALL_PROGRAM = $(INSTALL)
1058238c 57INSTALL_DATA = $(INSTALL)
fecd2382 58
1058238c
RP
59AR = ar
60AR_FLAGS = qv
61BISON = bison
62MAKEINFO = makeinfo
fecd2382 63RANLIB = ranlib
4b857710
ILT
64CFLAGS = -g
65
66FLAGS_TO_PASS = \
67 "prefix=$(prefix)" \
68 "exec_prefix=$(exec_prefix)" \
69 "tooldir=$(tooldir)" \
70 "AR=$(AR)" \
71 "AR_FLAGS=$(AR_FLAGS)" \
72 "CC=$(CC)" \
73 "CFLAGS=$(CFLAGS)" \
74 "RANLIB=$(RANLIB)" \
75 "LOADLIBES=$(LOADLIBES)" \
76 "LDFLAGS=$(LDFLAGS)" \
77 "BISON=$(BISON)" \
78 "LEX=$(LEX)" \
79 "MAKEINFO=$(MAKEINFO)" \
80 "INSTALL=$(INSTALL)" \
81 "INSTALL_DATA=$(INSTALL_DATA)" \
82 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
fecd2382 83
fecd2382
RP
84# Lists of files for various purposes.
85
86REAL_SOURCES = \
87 $(srcdir)/app.c \
88 $(srcdir)/as.c \
89 $(srcdir)/atof-generic.c \
90 $(srcdir)/bignum-copy.c \
91 $(srcdir)/cond.c \
92 $(srcdir)/expr.c \
5d53038b 93 $(srcdir)/flonum-konst.c \
fecd2382
RP
94 $(srcdir)/flonum-copy.c \
95 $(srcdir)/flonum-mult.c \
96 $(srcdir)/frags.c \
97 $(srcdir)/hash.c \
98 $(srcdir)/hex-value.c \
99 $(srcdir)/input-file.c \
100 $(srcdir)/input-scrub.c \
101 $(srcdir)/messages.c \
542e1629 102 $(srcdir)/obstack.c \
fecd2382
RP
103 $(srcdir)/output-file.c \
104 $(srcdir)/read.c \
542e1629 105 $(srcdir)/strerror.c \
fecd2382
RP
106 $(srcdir)/strstr.c \
107 $(srcdir)/subsegs.c \
108 $(srcdir)/symbols.c \
109 $(srcdir)/version.c \
110 $(srcdir)/write.c \
3340f7e5 111 $(srcdir)/listing.c \
fecd2382
RP
112 $(srcdir)/xmalloc.c \
113 $(srcdir)/xrealloc.c
114
115# in an expedient order
116LINKED_SOURCES = \
117 targ-cpu.c \
118 obj-format.c \
119 atof-targ.c
120
121SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES)
122
123REAL_HEADERS = \
124 $(srcdir)/as.h \
125 $(srcdir)/bignum.h \
126 $(srcdir)/expr.h \
127 $(srcdir)/flonum.h \
128 $(srcdir)/frags.h \
129 $(srcdir)/hash.h \
130 $(srcdir)/input-file.h \
542e1629 131 $(srcdir)/listing.h \
fecd2382
RP
132 $(srcdir)/tc.h \
133 $(srcdir)/obj.h \
542e1629 134 $(srcdir)/obstack.h \
fecd2382 135 $(srcdir)/read.h \
fecd2382
RP
136 $(srcdir)/struc-symbol.h \
137 $(srcdir)/subsegs.h \
138 $(srcdir)/symbols.h \
fecd2382
RP
139 $(srcdir)/write.h
140
141LINKED_HEADERS = \
142 a.out.gnu.h \
143 a.out.h \
144 host.h \
145 targ-env.h \
146 targ-cpu.h \
147 obj-format.h \
148 atof-targ.h
149
150HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS)
151
152OBJS = \
153 targ-cpu.o \
154 obj-format.o \
155 atof-targ.o \
156 app.o \
157 as.o \
158 atof-generic.o \
159 bignum-copy.o \
160 cond.o \
161 expr.o \
5d53038b 162 flonum-konst.o \
fecd2382
RP
163 flonum-copy.o \
164 flonum-mult.o \
165 frags.o \
166 hash.o \
167 hex-value.o \
168 input-file.o \
169 input-scrub.o \
170 messages.o \
542e1629 171 obstack.o \
fecd2382
RP
172 output-file.o \
173 read.o \
542e1629 174 strerror.o \
fecd2382
RP
175 strstr.o \
176 subsegs.o \
177 symbols.o \
178 version.o \
179 write.o \
3340f7e5 180 listing.o \
fecd2382
RP
181 xmalloc.o \
182 xrealloc.o
183
f6b67e4c
RP
184#### host, target, and site specific Makefile frags come in here.
185
542e1629 186all: as.new
4b857710 187 @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) all)
79a54a5b 188
1058238c 189info:
4b857710 190 @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) info)
79a54a5b 191
81f73963 192install-info:
4b857710 193 @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) install-info)
79a54a5b
RP
194
195clean-info:
4b857710 196 @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) clean-info)
fecd2382 197
fecd2382
RP
198# Now figure out from those variables how to compile and link.
199
200# This is the variable actually used when we compile.
7121231f 201ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CROSS) $(CFLAGS) $(HDEFINES) $(TDEFINES) -DTARGET_CPU=\"$(target_cpu)\"
fecd2382 202
fecd2382
RP
203# How to link with both our special library facilities
204# and the system's installed libraries.
f6b67e4c 205
4b857710 206LIBS = $(LOCAL_LOADLIBES) $(CLIB) ../libiberty/libiberty.a
fecd2382
RP
207
208# Specify the directories to be searched for header files.
209# Both . and srcdir are used, in that order,
210# so that tm.h and config.h will be found in the compilation
211# subdirectory rather than in the source directory.
1058238c
RP
212INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config -I$(srcdir)/../include
213SUBDIR_INCLUDES = -I.. -I$(srcdir) -I$(srcdir)/config
fecd2382
RP
214
215# Always use -I$(srcdir)/config when compiling.
216.c.o:
217 $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
218
219# This tells GNU make version 3 not to export all the variables
220# defined in this file into the environment.
221.NOEXPORT:
542e1629 222
fecd2382 223# Files to be copied away after each stage in building.
da0b2bff 224STAGESTUFF = *.o as.new
fecd2382 225
b0952e12 226as.new: $(OBJS) $(LIBDEPS) $(LOCAL_LOADLIBES)
5d53038b 227 [ ! -f as.new ] || mv as.new as.old
da0b2bff 228 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES)
fecd2382 229
787c6bfe
RP
230check:
231
fecd2382
RP
232config.status:
233 @echo You must configure gas. Look at the INSTALL file for details.
234 @false
235
fecd2382
RP
236# Compiling object files from source files.
237
fecd2382 238app.o : app.c as.h host.h targ-env.h obj-format.h \
d1a9e594 239 targ-cpu.h struc-symbol.h \
fecd2382
RP
240 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
241as.o : as.c as.h host.h targ-env.h obj-format.h \
d1a9e594 242 targ-cpu.h struc-symbol.h \
fecd2382
RP
243 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
244atof-generic.o : atof-generic.c as.h host.h targ-env.h obj-format.h \
d1a9e594 245 targ-cpu.h struc-symbol.h \
fecd2382
RP
246 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
247bignum-copy.o : bignum-copy.c as.h host.h \
248 targ-env.h obj-format.h \
d1a9e594 249 targ-cpu.h struc-symbol.h \
fecd2382
RP
250 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
251cond.o : cond.c as.h host.h targ-env.h obj-format.h \
d1a9e594 252 targ-cpu.h struc-symbol.h \
da7aaffb
SEF
253 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
254
fecd2382 255debug.o : debug.c as.h host.h targ-env.h obj-format.h \
d1a9e594 256 targ-cpu.h struc-symbol.h \
fecd2382
RP
257 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
258 subsegs.h
259expr.o : expr.c as.h host.h targ-env.h obj-format.h \
d1a9e594 260 targ-cpu.h struc-symbol.h \
da7aaffb
SEF
261 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
262
5d53038b 263flonum-konst.o : flonum-konst.c flonum.h bignum.h
fecd2382 264flonum-copy.o : flonum-copy.c as.h host.h targ-env.h obj-format.h \
d1a9e594 265 targ-cpu.h struc-symbol.h \
fecd2382
RP
266 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
267flonum-mult.o : flonum-mult.c flonum.h bignum.h
268frags.o : frags.c as.h host.h targ-env.h obj-format.h \
d1a9e594 269 targ-cpu.h struc-symbol.h \
fecd2382 270 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
d1a9e594 271 subsegs.h
fecd2382 272hash.o : hash.c as.h host.h targ-env.h obj-format.h \
d1a9e594 273 targ-cpu.h struc-symbol.h \
fecd2382
RP
274 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
275hex-value.o : hex-value.c
276input-file.o : input-file.c as.h host.h \
277 targ-env.h obj-format.h targ-cpu.h \
d1a9e594 278 struc-symbol.h write.h flonum.h bignum.h expr.h \
fecd2382
RP
279 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
280input-scrub.o : input-scrub.c /usr/include/errno.h /usr/include/sys/errno.h \
281 as.h host.h targ-env.h obj-format.h \
d1a9e594 282 targ-cpu.h struc-symbol.h \
fecd2382
RP
283 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
284 input-file.h
3340f7e5
RP
285listing.o : listing.c as.h host.h targ-env.h flonum.h bignum.h \
286 listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
287 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
fecd2382 288messages.o : messages.c as.h host.h targ-env.h obj-format.h \
d1a9e594 289 targ-cpu.h struc-symbol.h \
fecd2382 290 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
d1a9e594 291obstack.o : obstack.c
fecd2382 292output-file.o : output-file.c as.h host.h targ-env.h obj-format.h \
d1a9e594 293 targ-cpu.h struc-symbol.h \
fecd2382
RP
294 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
295 output-file.h
296read.o : read.c as.h host.h targ-env.h obj-format.h \
d1a9e594 297 targ-cpu.h struc-symbol.h \
da7aaffb
SEF
298 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
299
787c6bfe 300strerror.o : strerror.c
fecd2382
RP
301strstr.o : strstr.c
302subsegs.o : subsegs.c as.h host.h targ-env.h obj-format.h \
d1a9e594 303 targ-cpu.h struc-symbol.h \
fecd2382 304 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
d1a9e594 305 subsegs.h
fecd2382 306symbols.o : symbols.c as.h host.h targ-env.h obj-format.h \
d1a9e594 307 targ-cpu.h struc-symbol.h \
fecd2382 308 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
d1a9e594 309 subsegs.h
fecd2382
RP
310version.o : version.c
311write.o : write.c as.h host.h targ-env.h obj-format.h \
d1a9e594 312 targ-cpu.h struc-symbol.h \
fecd2382 313 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
d1a9e594 314 subsegs.h output-file.h
fecd2382
RP
315xmalloc.o : xmalloc.c
316xrealloc.o : xrealloc.c
317atof-targ.o : atof-targ.c as.h host.h targ-env.h obj-format.h \
d1a9e594 318 targ-cpu.h struc-symbol.h \
fecd2382
RP
319 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
320 symbols.h tc.h obj.h
321obj-format.o : obj-format.c as.h host.h targ-env.h obj-format.h \
d1a9e594 322 targ-cpu.h struc-symbol.h \
fecd2382 323 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
d1a9e594 324 symbols.h tc.h obj.h
fecd2382 325targ-cpu.o : targ-cpu.c targ-env.h obj-format.h \
d1a9e594 326 targ-cpu.h struc-symbol.h \
fecd2382 327 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
da0b2bff 328 symbols.h tc.h obj.h $(TARG_CPU_DEPENDENTS)
d1a9e594 329
fecd2382
RP
330# Remake the info files.
331
921faa52 332doc: $(srcdir)/as.info
fecd2382 333
921faa52 334$(srcdir)/as.info: $(srcdir)/doc/as.texinfo
4b857710 335 @(cd doc; make $(FLAGS_TO_PASS) as.info; mv as.info $srcdir)
fecd2382 336
fecd2382 337clean:
4b857710 338 @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) clean)
542e1629 339 -rm -f $(STAGESTUFF) core
fecd2382
RP
340
341# Like clean but also delete the links made to configure gas.
542e1629
RP
342distclean: clean
343 -rm -f config.status Makefile host.h targ-env.h targ-cpu.h \
344 targ-cpu.c obj-format.h obj-format.c atof-targ.c \
345 gas.aux gas.cps gas.fns gas.info gas.kys gas.pgs
346 gas.tps gas.vrs TAGS gas.info* gas.?? gas.??s gas.log \
347 gas.toc gas.*aux *.dvi
348
fecd2382
RP
349# Entry points `install', `includes' and `uninstall'.
350
351# Copy the files into directories where they will be run.
542e1629 352install:
4b857710
ILT
353 -parent=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
354 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
355 -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
356 -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
357 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
358 -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
359 -rm -f $(bindir)/$(program_prefix)as$(program_suffix)
360 $(INSTALL_PROGRAM) as.new $(bindir)/$(program_prefix)as$(program_suffix)
787c6bfe 361 -rm -f $(tooldir)/as
4b857710
ILT
362 ln $(bindir)/$(program_prefix)as$(program_suffix) $(tooldir)/as
363 -rm -f $(man1dir)/$(program_prefix)as$(program_suffix).1
364 $(INSTALL_DATA) $(srcdir)/doc/as.1 $(man1dir)/$(program_prefix)as$(program_suffix).1
fecd2382 365
fecd2382
RP
366# Cancel installation by deleting the installed files.
367uninstall:
368 -rm -rf $(libsubdir)
6a3958b2 369 -rm -rf $(bindir)/as
fecd2382
RP
370 -rm -rf $(mandir)/gas.$(manext)
371
542e1629 372
fecd2382
RP
373# These exist for maintenance purposes.
374
375tags TAGS: force
787c6bfe 376 etags $(REAL_HEADERS) $(REAL_SOURCES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in
fecd2382 377
542e1629 378bootstrap: as.new force
fecd2382 379 $(MAKE) stage1
542e1629 380 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
fecd2382 381 $(MAKE) stage2
542e1629 382 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
a01bf1fb 383 $(MAKE) comparison against=stage2
fecd2382
RP
384
385bootstrap2: force
542e1629 386 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
fecd2382 387 $(MAKE) stage2
542e1629 388 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
da0b2bff 389 $(MAKE) comparison against=stage2
fecd2382
RP
390
391bootstrap3: force
542e1629 392 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
a01bf1fb 393 $(MAKE) comparison against=stage2
fecd2382
RP
394
395# Copy the object files from a particular stage into a subdirectory.
396stage1: force
397 -mkdir stage1
398 -mv $(STAGESTUFF) stage1
81f73963 399 if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi
fecd2382
RP
400
401stage2: force
402 -mkdir stage2
403 -mv $(STAGESTUFF) stage2
81f73963 404 if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi
fecd2382
RP
405
406stage3: force
407 -mkdir stage3
6a3958b2 408 -mv $(STAGESTUFF) stage3
81f73963 409 if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi
fecd2382 410
a01bf1fb
RP
411against=stage2
412
413comparison: force
414 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
415
6a3958b2 416de-stage1: force
da0b2bff 417 - (cd stage1 ; rm as ; mv -f * ..)
6a3958b2
RP
418 - rmdir stage1
419
420de-stage2: force
da0b2bff 421 - (cd stage2 ; rm as ; mv -f * ..)
6a3958b2
RP
422 - rmdir stage2
423
424de-stage3: force
da0b2bff 425 - (cd stage3 ; rm as ; mv -f * ..)
6a3958b2 426 - rmdir stage3
fecd2382 427
fecd2382
RP
428#In GNU Make, ignore whether `stage*' exists.
429.PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
fecd2382
RP
430
431force:
432
f1eb48b6 433Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 434 $(SHELL) ./config.status
61907f51 435
This page took 0.071238 seconds and 4 git commands to generate.