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.
31 program_transform_name
=
32 exec_prefix = $(prefix)
33 bindir = $(exec_prefix)/bin
34 libdir = $(exec_prefix)/lib
35 tooldir
= $(libdir)/$(target_alias
)
37 datadir = $(prefix)/lib
38 mandir = $(prefix)/man
39 man1dir = $(mandir)/man1
40 man2dir = $(mandir)/man2
41 man3dir = $(mandir)/man3
42 man4dir = $(mandir)/man4
43 man5dir = $(mandir)/man5
44 man6dir = $(mandir)/man6
45 man7dir = $(mandir)/man7
46 man8dir = $(mandir)/man8
47 man9dir = $(mandir)/man9
48 infodir = $(prefix)/info
49 includedir = $(prefix)/include
50 docdir
= $(datadir)/doc
55 INSTALL_PROGRAM
= $(INSTALL
)
56 INSTALL_DATA
= $(INSTALL
)
67 "exec_prefix=$(exec_prefix)" \
68 "tooldir=$(tooldir)" \
70 "AR_FLAGS=$(AR_FLAGS)" \
74 "LOADLIBES=$(LOADLIBES)" \
75 "LDFLAGS=$(LDFLAGS)" \
78 "MAKEINFO=$(MAKEINFO)" \
79 "INSTALL=$(INSTALL)" \
80 "INSTALL_DATA=$(INSTALL_DATA)" \
81 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
83 # Lists of files for various purposes.
88 $(srcdir)/atof-generic.c \
89 $(srcdir)/bignum-copy.c \
92 $(srcdir)/flonum-konst.c \
93 $(srcdir)/flonum-copy.c \
94 $(srcdir)/flonum-mult.c \
97 $(srcdir)/hex-value.c \
98 $(srcdir)/input-file.c \
99 $(srcdir)/input-scrub.c \
100 $(srcdir)/messages.c \
101 $(srcdir)/obstack.c \
102 $(srcdir)/output-file.c \
104 $(srcdir)/strerror.c \
106 $(srcdir)/subsegs.c \
107 $(srcdir)/symbols.c \
108 $(srcdir)/version.c \
110 $(srcdir)/listing.c \
111 $(srcdir)/xmalloc.c \
114 # in an expedient order
120 SOURCES
= $(LINKED_SOURCES
) $(REAL_SOURCES
)
129 $(srcdir)/input-file.h \
130 $(srcdir)/listing.h \
133 $(srcdir)/obstack.h \
135 $(srcdir)/struc-symbol.h \
136 $(srcdir)/subsegs.h \
137 $(srcdir)/symbols.h \
149 HEADERS
= $(LINKED_HEADERS
) $(REAL_HEADERS
)
183 #### host, target, and site specific Makefile frags come in here.
186 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) all)
189 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) info)
192 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) install-info
)
195 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) clean-info
)
197 # Now figure out from those variables how to compile and link.
199 # This is the variable actually used when we compile.
200 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(CROSS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
) -DTARGET_CPU
=\"$(target_cpu
)\"
202 # How to link with both our special library facilities
203 # and the system's installed libraries.
205 LIBS
= ..
/opcodes
/libopcodes.a
$(LOCAL_LOADLIBES
) $(CLIB
) ..
/libiberty
/libiberty.a
207 # Specify the directories to be searched for header files.
208 # Both . and srcdir are used, in that order,
209 # so that tm.h and config.h will be found in the compilation
210 # subdirectory rather than in the source directory.
211 INCLUDES
= -I.
-I
$(srcdir) -I
$(srcdir)/config
-I
$(srcdir)/..
/include
212 SUBDIR_INCLUDES
= -I..
-I
$(srcdir) -I
$(srcdir)/config
214 # Always use -I$(srcdir)/config when compiling.
216 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
218 # This tells GNU make version 3 not to export all the variables
219 # defined in this file into the environment.
222 # Files to be copied away after each stage in building.
223 STAGESTUFF
= *.o
as.new
225 as.new
: $(OBJS
) $(LIBDEPS
) $(LOCAL_LOADLIBES
)
226 [ ! -f
as.new
] || mv
as.new
as.old
227 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
232 @echo You must configure gas. Look at the INSTALL file for details.
235 # Compiling object files from source files.
237 app.o
: app.c
as.h host.h targ-env.h obj-format.h \
238 targ-cpu.h struc-symbol.h \
239 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
240 as.o
: as.c
as.h host.h targ-env.h obj-format.h \
241 targ-cpu.h struc-symbol.h \
242 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
243 atof-generic.o
: atof-generic.c
as.h host.h targ-env.h obj-format.h \
244 targ-cpu.h struc-symbol.h \
245 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
246 bignum-copy.o
: bignum-copy.c
as.h host.h \
247 targ-env.h obj-format.h \
248 targ-cpu.h struc-symbol.h \
249 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
250 cond.o
: cond.c
as.h host.h targ-env.h obj-format.h \
251 targ-cpu.h struc-symbol.h \
252 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
254 debug.o
: debug.c
as.h host.h targ-env.h obj-format.h \
255 targ-cpu.h struc-symbol.h \
256 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
258 expr.o
: expr.c
as.h host.h targ-env.h obj-format.h \
259 targ-cpu.h struc-symbol.h \
260 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
262 flonum-konst.o
: flonum-konst.c flonum.h bignum.h
263 flonum-copy.o
: flonum-copy.c
as.h host.h targ-env.h obj-format.h \
264 targ-cpu.h struc-symbol.h \
265 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
266 flonum-mult.o
: flonum-mult.c flonum.h bignum.h
267 frags.o
: frags.c
as.h host.h targ-env.h obj-format.h \
268 targ-cpu.h struc-symbol.h \
269 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
271 hash.o
: hash.c
as.h host.h targ-env.h obj-format.h \
272 targ-cpu.h struc-symbol.h \
273 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
274 hex-value.o
: hex-value.c
275 input-file.o
: input-file.c
as.h host.h \
276 targ-env.h obj-format.h targ-cpu.h \
277 struc-symbol.h write.h flonum.h bignum.h expr.h \
278 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
279 input-scrub.o
: input-scrub.c
/usr
/include/errno.h
/usr
/include/sys
/errno.h \
280 as.h host.h targ-env.h obj-format.h \
281 targ-cpu.h struc-symbol.h \
282 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
284 listing.o
: listing.c
as.h host.h targ-env.h flonum.h bignum.h \
285 listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
286 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
287 messages.o
: messages.c
as.h host.h targ-env.h obj-format.h \
288 targ-cpu.h struc-symbol.h \
289 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
290 obstack.o
: obstack.c
291 output-file.o
: output-file.c
as.h host.h targ-env.h obj-format.h \
292 targ-cpu.h struc-symbol.h \
293 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
295 read.o
: read.c
as.h host.h targ-env.h obj-format.h \
296 targ-cpu.h struc-symbol.h \
297 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
299 strerror.o
: strerror.c
301 subsegs.o
: subsegs.c
as.h host.h targ-env.h obj-format.h \
302 targ-cpu.h struc-symbol.h \
303 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
305 symbols.o
: symbols.c
as.h host.h targ-env.h obj-format.h \
306 targ-cpu.h struc-symbol.h \
307 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
309 version.o
: version.c
310 write.o
: write.c
as.h host.h targ-env.h obj-format.h \
311 targ-cpu.h struc-symbol.h \
312 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
313 subsegs.h output-file.h
314 xmalloc.o
: xmalloc.c
315 xrealloc.o
: xrealloc.c
316 atof-targ.o
: atof-targ.c
as.h host.h targ-env.h obj-format.h \
317 targ-cpu.h struc-symbol.h \
318 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
320 obj-format.o
: obj-format.c
as.h host.h targ-env.h obj-format.h \
321 targ-cpu.h struc-symbol.h \
322 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
324 targ-cpu.o
: targ-cpu.c targ-env.h obj-format.h \
325 targ-cpu.h struc-symbol.h \
326 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
327 symbols.h tc.h obj.h
$(TARG_CPU_DEPENDENTS
)
329 # Remake the info files.
331 doc
: $(srcdir)/as.
info
333 $(srcdir)/as.
info: $(srcdir)/doc
/as.texinfo
334 @
(cd doc
; make
$(FLAGS_TO_PASS
) as.
info; mv
as.
info $srcdir)
337 @
(cd doc
; $(MAKE
) $(FLAGS_TO_PASS
) clean)
338 -rm -f
$(STAGESTUFF
) core
340 # Like clean but also delete the links made to configure gas.
342 -rm -f config.status Makefile host.h targ-env.h targ-cpu.h \
343 targ-cpu.c obj-format.h obj-format.c atof-targ.c \
344 gas.aux gas.cps gas.fns gas.
info gas.kys gas.pgs
345 gas.tps gas.vrs TAGS gas.
info* gas.?? gas.??s gas.log \
346 gas.toc gas.
*aux
*.
dvi
348 # Entry points `install', `includes' and `uninstall'.
350 # Copy the files into directories where they will be run.
352 -parent
=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
353 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
354 -if
[ -d
$(bindir) ] ; then true
; else mkdir
$(bindir) ; fi
355 -parent
=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
356 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
357 -if
[ -d
$(man1dir) ] ; then true
; else mkdir
$(man1dir) ; fi
358 -n
=`t='$(program_transform_name)'; echo as | sed -e "" $$t`; \
359 rm -f
$(bindir)/$$n; \
360 $(INSTALL_PROGRAM
) as.new
$(bindir)/$$n; \
361 $(INSTALL_DATA
) $(srcdir)/doc
/as.1 $(man1dir)/$$n.1; \
362 if
[ -d
$(tooldir
) ]; then \
363 if
[ -d
$(tooldir
)/bin
] ; then true
; else mkdir
$(tooldir
)/bin
; fi
; \
364 rm -f
$(tooldir
)/bin
/as; \
365 ln
$(bindir)/$$n $(tooldir
)/bin
/as \
366 ||
$(INSTALL_PROGRAM
) as.new
$(tooldir
)/bin
/as; \
369 # Cancel installation by deleting the installed files.
371 -n
=`t='$(program_transform_name)'; echo as | sed -e "" $$t`; \
372 rm -f
$(bindir)/$$n; \
373 rm -f
$(mandir)/$$n.1
375 # These exist for maintenance purposes.
378 etags
$(REAL_HEADERS
) $(REAL_SOURCES
) $(srcdir)/config
/*.
[hc
] $(srcdir)/README
$(srcdir)/Makefile.in
380 bootstrap
: as.new
force
382 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
384 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
385 $(MAKE
) comparison against
=stage2
388 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
390 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
391 $(MAKE
) comparison against
=stage2
394 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
395 $(MAKE
) comparison against
=stage2
397 # Copy the object files from a particular stage into a subdirectory.
400 -mv
$(STAGESTUFF
) stage1
401 if
[ -f stage1
/as.new
-a
! -f stage1
/as ] ; then
(cd stage1
; ln
-s
as.new
as) ; fi
405 -mv
$(STAGESTUFF
) stage2
406 if
[ -f stage2
/as.new
-a
! -f stage2
/as ] ; then
(cd stage2
; ln
-s
as.new
as) ; fi
410 -mv
$(STAGESTUFF
) stage3
411 if
[ -f stage3
/as.new
-a
! -f stage3
/as ] ; then
(cd stage3
; ln
-s
as.new
as) ; fi
416 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
419 - (cd stage1
; rm as ; mv
-f
* ..
)
423 - (cd stage2
; rm as ; mv
-f
* ..
)
427 - (cd stage3
; rm as ; mv
-f
* ..
)
430 #In GNU Make, ignore whether `stage*' exists.
431 .PHONY
: stage1 stage2 stage3 stage4
clean realclean TAGS bootstrap
435 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
436 $(SHELL
) .
/config.status