1 # Makefile for GNU Assembler
2 # Copyright (C) 1987-1992 Free Software Foundation, Inc.
4 #This file is part of GNU GAS.
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
8 #the Free Software Foundation; either version 2, or (at your option)
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.
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.
20 # The targets for external use include:
21 # all, doc, proto, install, uninstall, includes, TAGS,
22 # clean, cleanconfig, realclean, stage1, stage2, stage3, stage4.
24 # Variables that exist for you to override.
25 # See below for how to change them for certain systems.
33 exec_prefix = $(prefix)
34 bindir = $(exec_prefix)/bin
35 libdir = $(exec_prefix)/lib
38 datadir = $(prefix)/lib
39 mandir = $(prefix)/man
40 man1dir = $(mandir)/man1
41 man2dir = $(mandir)/man2
42 man3dir = $(mandir)/man3
43 man4dir = $(mandir)/man4
44 man5dir = $(mandir)/man5
45 man6dir = $(mandir)/man6
46 man7dir = $(mandir)/man7
47 man8dir = $(mandir)/man8
48 man9dir = $(mandir)/man9
49 infodir = $(prefix)/info
50 includedir = $(prefix)/include
51 docdir
= $(datadir)/doc
56 INSTALL_PROGRAM
= $(INSTALL
)
57 INSTALL_DATA
= $(INSTALL
)
68 "exec_prefix=$(exec_prefix)" \
69 "tooldir=$(tooldir)" \
71 "AR_FLAGS=$(AR_FLAGS)" \
75 "LOADLIBES=$(LOADLIBES)" \
76 "LDFLAGS=$(LDFLAGS)" \
79 "MAKEINFO=$(MAKEINFO)" \
80 "INSTALL=$(INSTALL)" \
81 "INSTALL_DATA=$(INSTALL_DATA)" \
82 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
84 # Lists of files for various purposes.
89 $(srcdir)/atof-generic.c \
90 $(srcdir)/bignum-copy.c \
93 $(srcdir)/flonum-konst.c \
94 $(srcdir)/flonum-copy.c \
95 $(srcdir)/flonum-mult.c \
98 $(srcdir)/hex-value.c \
99 $(srcdir)/input-file.c \
100 $(srcdir)/input-scrub.c \
101 $(srcdir)/messages.c \
102 $(srcdir)/obstack.c \
103 $(srcdir)/output-file.c \
105 $(srcdir)/strerror.c \
107 $(srcdir)/subsegs.c \
108 $(srcdir)/symbols.c \
109 $(srcdir)/version.c \
111 $(srcdir)/listing.c \
112 $(srcdir)/xmalloc.c \
115 # in an expedient order
121 SOURCES
= $(LINKED_SOURCES
) $(REAL_SOURCES
)
130 $(srcdir)/input-file.h \
131 $(srcdir)/listing.h \
134 $(srcdir)/obstack.h \
136 $(srcdir)/struc-symbol.h \
137 $(srcdir)/subsegs.h \
138 $(srcdir)/symbols.h \
150 HEADERS
= $(LINKED_HEADERS
) $(REAL_HEADERS
)
184 #### host, target, and site specific Makefile frags come in here.
187 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) all)
190 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) info)
193 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) install-info
)
196 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) clean-info
)
198 # Now figure out from those variables how to compile and link.
200 # This is the variable actually used when we compile.
201 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(CROSS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
)
203 # How to link with both our special library facilities
204 # and the system's installed libraries.
206 LIBS
= $(LOCAL_LOADLIBES
) $(CLIB
) ..
/libiberty
/libiberty.a
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.
212 INCLUDES
= -I.
-I
$(srcdir) -I
$(srcdir)/config
-I
$(srcdir)/..
/include
213 SUBDIR_INCLUDES
= -I..
-I
$(srcdir) -I
$(srcdir)/config
215 # Always use -I$(srcdir)/config when compiling.
217 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
219 # This tells GNU make version 3 not to export all the variables
220 # defined in this file into the environment.
223 # Files to be copied away after each stage in building.
224 STAGESTUFF
= *.o
as.new
226 as.new
: $(OBJS
) $(LIBDEPS
)
227 [ ! -f
as.new
] || mv
as.new
as.old
228 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
233 @echo You must configure gas. Look at the INSTALL file for details.
236 # Compiling object files from source files.
238 app.o
: app.c
as.h host.h targ-env.h obj-format.h \
239 targ-cpu.h struc-symbol.h \
240 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
241 as.o
: as.c
as.h host.h targ-env.h obj-format.h \
242 targ-cpu.h struc-symbol.h \
243 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
244 atof-generic.o
: atof-generic.c
as.h host.h targ-env.h obj-format.h \
245 targ-cpu.h struc-symbol.h \
246 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
247 bignum-copy.o
: bignum-copy.c
as.h host.h \
248 targ-env.h obj-format.h \
249 targ-cpu.h struc-symbol.h \
250 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
251 cond.o
: cond.c
as.h host.h targ-env.h obj-format.h \
252 targ-cpu.h struc-symbol.h \
253 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
255 debug.o
: debug.c
as.h host.h targ-env.h obj-format.h \
256 targ-cpu.h struc-symbol.h \
257 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
259 expr.o
: expr.c
as.h host.h targ-env.h obj-format.h \
260 targ-cpu.h struc-symbol.h \
261 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
263 flonum-konst.o
: flonum-konst.c flonum.h bignum.h
264 flonum-copy.o
: flonum-copy.c
as.h host.h targ-env.h obj-format.h \
265 targ-cpu.h struc-symbol.h \
266 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
267 flonum-mult.o
: flonum-mult.c flonum.h bignum.h
268 frags.o
: frags.c
as.h host.h targ-env.h obj-format.h \
269 targ-cpu.h struc-symbol.h \
270 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
272 hash.o
: hash.c
as.h host.h targ-env.h obj-format.h \
273 targ-cpu.h struc-symbol.h \
274 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
275 hex-value.o
: hex-value.c
276 input-file.o
: input-file.c
as.h host.h \
277 targ-env.h obj-format.h targ-cpu.h \
278 struc-symbol.h write.h flonum.h bignum.h expr.h \
279 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
280 input-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 \
282 targ-cpu.h struc-symbol.h \
283 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
285 listing.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
288 messages.o
: messages.c
as.h host.h targ-env.h obj-format.h \
289 targ-cpu.h struc-symbol.h \
290 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
291 obstack.o
: obstack.c
292 output-file.o
: output-file.c
as.h host.h targ-env.h obj-format.h \
293 targ-cpu.h struc-symbol.h \
294 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
296 read.o
: read.c
as.h host.h targ-env.h obj-format.h \
297 targ-cpu.h struc-symbol.h \
298 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
300 strerror.o
: strerror.c
302 subsegs.o
: subsegs.c
as.h host.h targ-env.h obj-format.h \
303 targ-cpu.h struc-symbol.h \
304 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
306 symbols.o
: symbols.c
as.h host.h targ-env.h obj-format.h \
307 targ-cpu.h struc-symbol.h \
308 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
310 version.o
: version.c
311 write.o
: write.c
as.h host.h targ-env.h obj-format.h \
312 targ-cpu.h struc-symbol.h \
313 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
314 subsegs.h output-file.h
315 xmalloc.o
: xmalloc.c
316 xrealloc.o
: xrealloc.c
317 atof-targ.o
: atof-targ.c
as.h host.h targ-env.h obj-format.h \
318 targ-cpu.h struc-symbol.h \
319 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
321 obj-format.o
: obj-format.c
as.h host.h targ-env.h obj-format.h \
322 targ-cpu.h struc-symbol.h \
323 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
325 targ-cpu.o
: targ-cpu.c targ-env.h obj-format.h \
326 targ-cpu.h struc-symbol.h \
327 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
328 symbols.h tc.h obj.h
$(TARG_CPU_DEPENDENTS
)
330 # Remake the info files.
332 doc
: $(srcdir)/as.
info
334 $(srcdir)/as.
info: $(srcdir)/doc
/as.texinfo
335 @
(cd doc
; make
$(FLAGS_TO_PASS
) as.
info; mv
as.
info $srcdir)
338 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) clean)
339 -rm -f
$(STAGESTUFF
) core
341 # Like clean but also delete the links made to configure gas.
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
349 # Entry points `install', `includes' and `uninstall'.
351 # Copy the files into directories where they will be run.
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
)
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
366 # Cancel installation by deleting the installed files.
370 -rm -rf
$(mandir)/gas.
$(manext)
373 # These exist for maintenance purposes.
376 etags
$(REAL_HEADERS
) $(REAL_SOURCES
) $(srcdir)/config
/*.
[hc
] $(srcdir)/README
$(srcdir)/Makefile.in
378 bootstrap
: as.new
force
380 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
382 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
383 $(MAKE
) comparison against
=stage2
386 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
388 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
389 $(MAKE
) comparison against
=stage2
392 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
393 $(MAKE
) comparison against
=stage2
395 # Copy the object files from a particular stage into a subdirectory.
398 -mv
$(STAGESTUFF
) stage1
399 if
[ -f stage1
/as.new
-a
! -f stage1
/as ] ; then
(cd stage1
; ln
-s
as.new
as) ; fi
403 -mv
$(STAGESTUFF
) stage2
404 if
[ -f stage2
/as.new
-a
! -f stage2
/as ] ; then
(cd stage2
; ln
-s
as.new
as) ; fi
408 -mv
$(STAGESTUFF
) stage3
409 if
[ -f stage3
/as.new
-a
! -f stage3
/as ] ; then
(cd stage3
; ln
-s
as.new
as) ; fi
414 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
417 - (cd stage1
; rm as ; mv
-f
* ..
)
421 - (cd stage2
; rm as ; mv
-f
* ..
)
425 - (cd stage3
; rm as ; mv
-f
* ..
)
428 #In GNU Make, ignore whether `stage*' exists.
429 .PHONY
: stage1 stage2 stage3 stage4
clean realclean TAGS bootstrap
433 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
434 $(SHELL
) .
/config.status