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.
32 exec_prefix = $(prefix)
33 bindir = $(exec_prefix)/bin
34 libdir = $(exec_prefix)/lib
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
)
65 # Lists of files for various purposes.
70 $(srcdir)/atof-generic.c \
71 $(srcdir)/bignum-copy.c \
74 $(srcdir)/flonum-konst.c \
75 $(srcdir)/flonum-copy.c \
76 $(srcdir)/flonum-mult.c \
79 $(srcdir)/hex-value.c \
80 $(srcdir)/input-file.c \
81 $(srcdir)/input-scrub.c \
82 $(srcdir)/messages.c \
84 $(srcdir)/output-file.c \
86 $(srcdir)/strerror.c \
96 # in an expedient order
102 SOURCES
= $(LINKED_SOURCES
) $(REAL_SOURCES
)
111 $(srcdir)/input-file.h \
112 $(srcdir)/listing.h \
115 $(srcdir)/obstack.h \
117 $(srcdir)/struc-symbol.h \
118 $(srcdir)/subsegs.h \
119 $(srcdir)/symbols.h \
131 HEADERS
= $(LINKED_HEADERS
) $(REAL_HEADERS
)
165 #### host, target, and site specific Makefile frags come in here.
168 (cd doc
; $(MAKE
) all)
171 (cd doc
; $(MAKE
) info "MAKEINFO=$(MAKEINFO)")
174 (cd doc
; $(MAKE
) install-info
)
177 (cd doc
; $(MAKE
) clean-info
)
179 # Now figure out from those variables how to compile and link.
181 # This is the variable actually used when we compile.
182 ALL_CFLAGS
= $(MINUS_G
) $(INTERNAL_CFLAGS
) $(CFLAGS
) $(HDEFINES
) $(TDEFINES
)
184 # How to link with both our special library facilities
185 # and the system's installed libraries.
187 LIBS
= $(LOCAL_LOADLIBES
) $(CLIB
) # ../libiberty/libiberty.a
189 # Specify the directories to be searched for header files.
190 # Both . and srcdir are used, in that order,
191 # so that tm.h and config.h will be found in the compilation
192 # subdirectory rather than in the source directory.
193 INCLUDES
= -I.
-I
$(srcdir) -I
$(srcdir)/config
-I
$(srcdir)/..
/include
194 SUBDIR_INCLUDES
= -I..
-I
$(srcdir) -I
$(srcdir)/config
196 # Always use -I$(srcdir)/config when compiling.
198 $(CC
) -c
$(ALL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $<
200 # This tells GNU make version 3 not to export all the variables
201 # defined in this file into the environment.
204 # Files to be copied away after each stage in building.
205 STAGESTUFF
= *.o
as.new
207 as.new
: $(OBJS
) $(LIBDEPS
)
208 [ ! -f
as.new
] || mv
as.new
as.old
209 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
as.new
$(OBJS
) $(LIBS
) $(LOADLIBES
)
214 @echo You must configure gas. Look at the INSTALL file for details.
217 # Compiling object files from source files.
219 app.o
: app.c
as.h host.h targ-env.h obj-format.h \
220 targ-cpu.h struc-symbol.h \
221 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
222 as.o
: as.c
as.h host.h targ-env.h obj-format.h \
223 targ-cpu.h struc-symbol.h \
224 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
225 atof-generic.o
: atof-generic.c
as.h host.h targ-env.h obj-format.h \
226 targ-cpu.h struc-symbol.h \
227 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
228 bignum-copy.o
: bignum-copy.c
as.h host.h \
229 targ-env.h obj-format.h \
230 targ-cpu.h struc-symbol.h \
231 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
232 cond.o
: cond.c
as.h host.h targ-env.h obj-format.h \
233 targ-cpu.h struc-symbol.h \
234 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
236 debug.o
: debug.c
as.h host.h targ-env.h obj-format.h \
237 targ-cpu.h struc-symbol.h \
238 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
240 expr.o
: expr.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
244 flonum-konst.o
: flonum-konst.c flonum.h bignum.h
245 flonum-copy.o
: flonum-copy.c
as.h host.h targ-env.h obj-format.h \
246 targ-cpu.h struc-symbol.h \
247 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
248 flonum-mult.o
: flonum-mult.c flonum.h bignum.h
249 frags.o
: frags.c
as.h host.h targ-env.h obj-format.h \
250 targ-cpu.h struc-symbol.h \
251 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
253 hash.o
: hash.c
as.h host.h targ-env.h obj-format.h \
254 targ-cpu.h struc-symbol.h \
255 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
256 hex-value.o
: hex-value.c
257 input-file.o
: input-file.c
as.h host.h \
258 targ-env.h obj-format.h targ-cpu.h \
259 struc-symbol.h write.h flonum.h bignum.h expr.h \
260 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
261 input-scrub.o
: input-scrub.c
/usr
/include/errno.h
/usr
/include/sys
/errno.h \
262 as.h host.h targ-env.h obj-format.h \
263 targ-cpu.h struc-symbol.h \
264 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
266 listing.o
: listing.c
as.h host.h targ-env.h flonum.h bignum.h \
267 listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
268 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
269 messages.o
: messages.c
as.h host.h targ-env.h obj-format.h \
270 targ-cpu.h struc-symbol.h \
271 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
272 obstack.o
: obstack.c
273 output-file.o
: output-file.c
as.h host.h targ-env.h obj-format.h \
274 targ-cpu.h struc-symbol.h \
275 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
277 read.o
: read.c
as.h host.h targ-env.h obj-format.h \
278 targ-cpu.h struc-symbol.h \
279 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
281 strerror.o
: strerror.c
283 subsegs.o
: subsegs.c
as.h host.h targ-env.h obj-format.h \
284 targ-cpu.h struc-symbol.h \
285 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
287 symbols.o
: symbols.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 \
291 version.o
: version.c
292 write.o
: write.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 \
295 subsegs.h output-file.h
296 xmalloc.o
: xmalloc.c
297 xrealloc.o
: xrealloc.c
298 atof-targ.o
: atof-targ.c
as.h host.h targ-env.h obj-format.h \
299 targ-cpu.h struc-symbol.h \
300 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
302 obj-format.o
: obj-format.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 \
306 targ-cpu.o
: targ-cpu.c 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 \
309 symbols.h tc.h obj.h
$(TARG_CPU_DEPENDENTS
)
311 # Remake the info files.
313 doc
: $(srcdir)/as.
info
315 $(srcdir)/as.
info: $(srcdir)/doc
/as.texinfo
316 (cd doc
; make
as.
info; mv
as.
info $srcdir)
319 (cd doc
; $(MAKE
) clean)
320 -rm -f
$(STAGESTUFF
) core
322 # Like clean but also delete the links made to configure gas.
324 -rm -f config.status Makefile host.h targ-env.h targ-cpu.h \
325 targ-cpu.c obj-format.h obj-format.c atof-targ.c \
326 gas.aux gas.cps gas.fns gas.
info gas.kys gas.pgs
327 gas.tps gas.vrs TAGS gas.
info* gas.?? gas.??s gas.log \
328 gas.toc gas.
*aux
*.
dvi
330 # Entry points `install', `includes' and `uninstall'.
332 # Copy the files into directories where they will be run.
334 -rm -f
$(bindir)/$(program_prefix
)as
335 $(INSTALL_PROGRAM
) as.new
$(bindir)/$(program_prefix
)as
337 ln
$(bindir)/$(program_prefix
)as $(tooldir
)/as
338 -rm -f
$(man1dir)/$(program_prefix
)as.1
339 $(INSTALL_DATA
) $(srcdir)/doc
/as.1 $(man1dir)/$(program_prefix
)as.1
341 # Create the installation directory.
345 -mkdir
$(libdir)/gcc
/$(target
)
346 -mkdir
$(libdir)/gcc
/$(target
)/$(version
)
348 # Cancel installation by deleting the installed files.
352 -rm -rf
$(mandir)/gas.
$(manext)
355 # These exist for maintenance purposes.
358 etags
$(REAL_HEADERS
) $(REAL_SOURCES
) $(srcdir)/config
/*.
[hc
] $(srcdir)/README
$(srcdir)/Makefile.in
360 bootstrap
: as.new
force
362 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
364 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
365 $(MAKE
) comparison against
=stage2
368 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
370 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
371 $(MAKE
) comparison against
=stage2
374 $(MAKE
) CC
="$(CC)" CFLAGS
="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA
= as.new
375 $(MAKE
) comparison against
=stage2
377 # Copy the object files from a particular stage into a subdirectory.
380 -mv
$(STAGESTUFF
) stage1
381 if
[ -f stage1
/as.new
-a
! -f stage1
/as ] ; then
(cd stage1
; ln
-s
as.new
as) ; fi
385 -mv
$(STAGESTUFF
) stage2
386 if
[ -f stage2
/as.new
-a
! -f stage2
/as ] ; then
(cd stage2
; ln
-s
as.new
as) ; fi
390 -mv
$(STAGESTUFF
) stage3
391 if
[ -f stage3
/as.new
-a
! -f stage3
/as ] ; then
(cd stage3
; ln
-s
as.new
as) ; fi
396 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
399 - (cd stage1
; rm as ; mv
-f
* ..
)
403 - (cd stage2
; rm as ; mv
-f
* ..
)
407 - (cd stage3
; rm as ; mv
-f
* ..
)
410 #In GNU Make, ignore whether `stage*' exists.
411 .PHONY
: stage1 stage2 stage3 stage4
clean realclean TAGS bootstrap
415 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
416 $(SHELL
) .
/config.status