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)/output-file.c \
103 $(srcdir)/subsegs.c \
104 $(srcdir)/symbols.c \
106 $(srcdir)/listing.c \
109 # in an expedient order
115 SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES)
124 $(srcdir)/input-file.h \
125 $(srcdir)/listing.h \
129 $(srcdir)/struc-symbol.h \
130 $(srcdir)/subsegs.h \
131 $(srcdir)/symbols.h \
143 HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS)
173 #### host, target, and site specific Makefile frags come in here.
178 @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) all)
181 @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) info)
184 @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) install-info)
187 @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) clean-info)
189 # Now figure out from those variables how to compile and link.
191 # This is the variable actually used when we compile.
192 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CROSS) $(CFLAGS) $(HDEFINES) $(TDEFINES) \
195 # How to link with both our special library facilities
196 # and the system's installed libraries.
198 LIBS = ../opcodes/libopcodes.a $(BFDLIB) $(LOCAL_LOADLIBES) \
199 ../libiberty/libiberty.a
201 # Specify the directories to be searched for header files.
202 # Both . and srcdir are used, in that order,
203 # so that tm.h and config.h will be found in the compilation
204 # subdirectory rather than in the source directory.
205 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config -I$(srcdir)/../include
206 SUBDIR_INCLUDES = -I.. -I$(srcdir) -I$(srcdir)/config
208 # Always use -I$(srcdir)/config when compiling.
210 $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
212 # This tells GNU make version 3 not to export all the variables
213 # defined in this file into the environment.
216 # Files to be copied away after each stage in building.
217 STAGESTUFF = *.o as.new
219 as.new: $(OBJS) $(LIBS)
220 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES)
223 @echo No checks are available yet for the GNU assembler.
226 @echo You must configure gas. Look at the INSTALL file for details.
229 config.h: config-stamp ; @true
230 config-stamp: Makefile
231 -rm -f config.new config-stamp
232 echo '#define TARGET_CPU "$(target_cpu)"' > config.new
233 echo '#define TARGET_ALIAS "$(target_alias)"' >> config.new
234 echo '#define TARGET_CANONICAL "$(target_canonical)"' >> config.new
235 $(srcdir)/../move-if-change config.new config.h
238 version.c: vers-stamp ; @true
240 echo '#include "ansidecl.h"' > version.new
241 echo 'CONST char version_string[] = "$(VERSION)";' >> version.new
242 $(srcdir)/../move-if-change version.new version.c
245 # Compiling object files from source files.
247 app.o : app.c as.h host.h 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 as.o : as.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 subsegs.h \
254 atof-generic.o : atof-generic.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
257 bignum-copy.o : bignum-copy.c as.h host.h \
258 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
261 cond.o : cond.c as.h host.h targ-env.h obj-format.h \
262 targ-cpu.h struc-symbol.h \
263 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
265 debug.o : debug.c as.h host.h targ-env.h obj-format.h \
266 targ-cpu.h struc-symbol.h \
267 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
269 expr.o : expr.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
273 flonum-konst.o : flonum-konst.c flonum.h bignum.h
274 flonum-copy.o : flonum-copy.c as.h host.h targ-env.h obj-format.h \
275 targ-cpu.h struc-symbol.h \
276 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
277 flonum-mult.o : flonum-mult.c flonum.h bignum.h
278 frags.o : frags.c as.h host.h targ-env.h obj-format.h \
279 targ-cpu.h struc-symbol.h \
280 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
282 hash.o : hash.c as.h host.h targ-env.h obj-format.h \
283 targ-cpu.h struc-symbol.h \
284 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
285 hex-value.o : hex-value.c
286 input-file.o : input-file.c as.h host.h \
287 targ-env.h obj-format.h targ-cpu.h \
288 struc-symbol.h write.h flonum.h bignum.h expr.h \
289 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
290 input-scrub.o : input-scrub.c /usr/include/errno.h /usr/include/sys/errno.h \
291 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 listing.o : listing.c as.h host.h targ-env.h flonum.h bignum.h \
296 listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
297 frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
298 messages.o : messages.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 symbols.h tc.h obj.h
301 output-file.o : output-file.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 read.o : read.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
308 subsegs.o : subsegs.c as.h host.h targ-env.h obj-format.h \
309 targ-cpu.h struc-symbol.h \
310 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
312 symbols.o : symbols.c as.h host.h targ-env.h obj-format.h \
313 targ-cpu.h struc-symbol.h \
314 write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
316 version.o : version.c
317 write.o : write.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 symbols.h tc.h obj.h \
320 subsegs.h output-file.h
321 xmalloc.o : xmalloc.c
322 atof-targ.o : atof-targ.c as.h host.h targ-env.h obj-format.h \
323 targ-cpu.h struc-symbol.h \
324 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
326 obj-format.o : obj-format.c as.h host.h targ-env.h obj-format.h \
327 targ-cpu.h struc-symbol.h \
328 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
329 subsegs.h symbols.h tc.h obj.h
330 targ-cpu.o : targ-cpu.c config.h targ-env.h obj-format.h \
331 targ-cpu.h struc-symbol.h \
332 write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
333 symbols.h tc.h obj.h $(TARG_CPU_DEPENDENTS)
335 # Remake the info files.
337 doc: $(srcdir)/as.info
339 $(srcdir)/as.info: $(srcdir)/doc/as.texinfo
340 @(cd doc; make $(FLAGS_TO_PASS) as.info; mv as.info $srcdir)
343 @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) clean)
344 -rm -f $(STAGESTUFF) core
346 # Like clean but also delete the links made to configure gas.
348 -rm -f config.status Makefile host.h targ-env.h targ-cpu.h \
349 targ-cpu.c obj-format.h obj-format.c atof-targ.c \
350 gas.aux gas.cps gas.fns gas.info gas.kys gas.pgs
351 gas.tps gas.vrs TAGS gas.info* gas.?? gas.??s gas.log \
352 gas.toc gas.*aux *.dvi
354 # Entry points `install', `includes' and `uninstall'.
356 # Copy the files into directories where they will be run.
358 -parent=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
359 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
360 -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
361 -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
362 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
363 -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
364 -n=`t='$(program_transform_name)'; echo as | sed -e "" $$t`; \
365 rm -f $(bindir)/$$n; \
366 $(INSTALL_PROGRAM) as.new $(bindir)/$$n; \
367 $(INSTALL_DATA) $(srcdir)/doc/as.1 $(man1dir)/$$n.1; \
368 if [ -d $(tooldir) ]; then \
369 if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
370 rm -f $(tooldir)/bin/as; \
371 ln $(bindir)/$$n $(tooldir)/bin/as \
372 || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as; \
375 # Cancel installation by deleting the installed files.
377 -n=`t='$(program_transform_name)'; echo as | sed -e "" $$t`; \
378 rm -f $(bindir)/$$n; \
379 rm -f $(mandir)/$$n.1
381 # These exist for maintenance purposes.
384 etags $(REAL_HEADERS) $(REAL_SOURCES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in
386 bootstrap: as.new force
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 -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
396 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
397 $(MAKE) comparison against=stage2
400 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
401 $(MAKE) comparison against=stage2
403 # Copy the object files from a particular stage into a subdirectory.
406 -mv $(STAGESTUFF) stage1
407 if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi
411 -mv $(STAGESTUFF) stage2
412 if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi
416 -mv $(STAGESTUFF) stage3
417 if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi
422 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
425 - (cd stage1 ; rm as ; mv -f * ..)
429 - (cd stage2 ; rm as ; mv -f * ..)
433 - (cd stage3 ; rm as ; mv -f * ..)
436 #In GNU Make, ignore whether `stage*' exists.
437 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
441 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \
442 $(srcdir)/configure.in
443 $(SHELL) ./config.status