| 1 | # Makefile for GNU Assembler |
| 2 | # Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996 |
| 3 | # Free Software Foundation, Inc. |
| 4 | |
| 5 | # This file is part of GNU GAS. |
| 6 | |
| 7 | # GNU GAS is free software; you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation; either version 2, or (at your option) |
| 10 | # any later version. |
| 11 | |
| 12 | # GNU GAS is distributed in the hope that it will be useful, |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | # GNU General Public License for more details. |
| 16 | |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with GNU GAS; see the file COPYING. If not, write to |
| 19 | # the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 20 | |
| 21 | # The targets for external use include: |
| 22 | # all, doc, proto, install, uninstall, includes, TAGS, |
| 23 | # clean, mostlyclean, distclean, realclean, stage1, stage2, stage3, stage4. |
| 24 | |
| 25 | # Variables that exist for you to override. |
| 26 | # See below for how to change them for certain systems. |
| 27 | |
| 28 | VPATH = @srcdir@ |
| 29 | srcdir = @srcdir@ |
| 30 | srcroot = $(srcdir)/.. |
| 31 | |
| 32 | target_alias = @target_alias@ |
| 33 | prefix = @prefix@ |
| 34 | |
| 35 | program_transform_name = @program_transform_name@ |
| 36 | exec_prefix = @exec_prefix@ |
| 37 | bindir = @bindir@ |
| 38 | libdir = @libdir@ |
| 39 | tooldir = $(exec_prefix)/$(target_alias) |
| 40 | |
| 41 | datadir = @datadir@ |
| 42 | mandir = @mandir@ |
| 43 | man1dir = $(mandir)/man1 |
| 44 | man2dir = $(mandir)/man2 |
| 45 | man3dir = $(mandir)/man3 |
| 46 | man4dir = $(mandir)/man4 |
| 47 | man5dir = $(mandir)/man5 |
| 48 | man6dir = $(mandir)/man6 |
| 49 | man7dir = $(mandir)/man7 |
| 50 | man8dir = $(mandir)/man8 |
| 51 | man9dir = $(mandir)/man9 |
| 52 | infodir = @infodir@ |
| 53 | includedir = @includedir@ |
| 54 | |
| 55 | VERSION=cygnus-2.6 |
| 56 | |
| 57 | SHELL = /bin/sh |
| 58 | |
| 59 | INSTALL = $${srcroot}/install.sh -c |
| 60 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
| 61 | INSTALL_DATA = @INSTALL_DATA@ |
| 62 | INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' |
| 63 | INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1 |
| 64 | |
| 65 | DISTSTUFF= make-gas.com m68k-parse.c |
| 66 | |
| 67 | AR = ar |
| 68 | AR_FLAGS = qv |
| 69 | BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi` |
| 70 | BISONFLAGS = |
| 71 | MAKEINFO = makeinfo |
| 72 | TEXI2DVI = texi2dvi |
| 73 | RANLIB = ranlib |
| 74 | CC = @CC@ |
| 75 | CFLAGS = -g |
| 76 | LDFLAGS = |
| 77 | HLDFLAGS = @HLDFLAGS@ |
| 78 | RPATH_ENVVAR = @RPATH_ENVVAR@ |
| 79 | |
| 80 | MAKEOVERRIDES= |
| 81 | |
| 82 | EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \ |
| 83 | echo $${rootme}/../expect/expect ; \ |
| 84 | else echo expect ; fi` |
| 85 | |
| 86 | FLAGS_TO_PASS = \ |
| 87 | "prefix=$(prefix)" \ |
| 88 | "exec_prefix=$(exec_prefix)" \ |
| 89 | "tooldir=$(tooldir)" \ |
| 90 | "AR=$(AR)" \ |
| 91 | "AR_FLAGS=$(AR_FLAGS)" \ |
| 92 | "CC=$(CC)" \ |
| 93 | "CFLAGS=$(CFLAGS)" \ |
| 94 | "RANLIB=$(RANLIB)" \ |
| 95 | "LOADLIBES=$(LOADLIBES)" \ |
| 96 | "LDFLAGS=$(LDFLAGS)" \ |
| 97 | "BISON=$(BISON)" \ |
| 98 | "LEX=$(LEX)" \ |
| 99 | "MAKEINFO=$(MAKEINFO)" \ |
| 100 | "INSTALL=$(INSTALL)" \ |
| 101 | "INSTALL_DATA=$(INSTALL_DATA)" \ |
| 102 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" |
| 103 | |
| 104 | RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \ |
| 105 | echo $${srcdir}/../dejagnu/runtest ; else echo runtest; \ |
| 106 | fi` |
| 107 | RUNTESTFLAGS= |
| 108 | |
| 109 | # Lists of files for various purposes. |
| 110 | |
| 111 | REAL_SOURCES = \ |
| 112 | $(srcdir)/app.c \ |
| 113 | $(srcdir)/as.c \ |
| 114 | $(srcdir)/atof-generic.c \ |
| 115 | $(srcdir)/bignum-copy.c \ |
| 116 | $(srcdir)/cond.c \ |
| 117 | $(srcdir)/expr.c \ |
| 118 | $(srcdir)/flonum-konst.c \ |
| 119 | $(srcdir)/flonum-copy.c \ |
| 120 | $(srcdir)/flonum-mult.c \ |
| 121 | $(srcdir)/frags.c \ |
| 122 | $(srcdir)/hash.c \ |
| 123 | $(srcdir)/input-file.c \ |
| 124 | $(srcdir)/input-scrub.c \ |
| 125 | $(srcdir)/literal.c \ |
| 126 | $(srcdir)/messages.c \ |
| 127 | $(srcdir)/output-file.c \ |
| 128 | $(srcdir)/read.c \ |
| 129 | $(srcdir)/subsegs.c \ |
| 130 | $(srcdir)/symbols.c \ |
| 131 | $(srcdir)/write.c \ |
| 132 | $(srcdir)/listing.c \ |
| 133 | $(srcdir)/ecoff.c \ |
| 134 | $(srcdir)/stabs.c |
| 135 | |
| 136 | # in an expedient order |
| 137 | LINKED_SOURCES = \ |
| 138 | targ-cpu.c \ |
| 139 | obj-format.c \ |
| 140 | atof-targ.c |
| 141 | |
| 142 | SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES) |
| 143 | |
| 144 | REAL_HEADERS = \ |
| 145 | $(srcdir)/as.h \ |
| 146 | $(srcdir)/bignum.h \ |
| 147 | $(srcdir)/expr.h \ |
| 148 | $(srcdir)/flonum.h \ |
| 149 | $(srcdir)/frags.h \ |
| 150 | $(srcdir)/hash.h \ |
| 151 | $(srcdir)/input-file.h \ |
| 152 | $(srcdir)/listing.h \ |
| 153 | $(srcdir)/tc.h \ |
| 154 | $(srcdir)/obj.h \ |
| 155 | $(srcdir)/read.h \ |
| 156 | $(srcdir)/struc-symbol.h \ |
| 157 | $(srcdir)/subsegs.h \ |
| 158 | $(srcdir)/symbols.h \ |
| 159 | $(srcdir)/write.h \ |
| 160 | $(srcdir)/ecoff.h |
| 161 | |
| 162 | LINKED_HEADERS = \ |
| 163 | targ-env.h \ |
| 164 | targ-cpu.h \ |
| 165 | obj-format.h \ |
| 166 | atof-targ.h |
| 167 | |
| 168 | HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS) |
| 169 | |
| 170 | TE_OBJS= |
| 171 | |
| 172 | # @target_frag@ |
| 173 | |
| 174 | OBJS = \ |
| 175 | targ-cpu.o \ |
| 176 | obj-format.o \ |
| 177 | atof-targ.o \ |
| 178 | app.o \ |
| 179 | as.o \ |
| 180 | atof-generic.o \ |
| 181 | bignum-copy.o \ |
| 182 | cond.o \ |
| 183 | expr.o \ |
| 184 | flonum-konst.o \ |
| 185 | flonum-copy.o \ |
| 186 | flonum-mult.o \ |
| 187 | frags.o \ |
| 188 | hash.o \ |
| 189 | input-file.o \ |
| 190 | input-scrub.o \ |
| 191 | literal.o \ |
| 192 | messages.o \ |
| 193 | output-file.o \ |
| 194 | read.o \ |
| 195 | subsegs.o \ |
| 196 | symbols.o \ |
| 197 | write.o \ |
| 198 | listing.o \ |
| 199 | ecoff.o \ |
| 200 | stabs.o \ |
| 201 | sb.o \ |
| 202 | macro.o \ |
| 203 | @extra_objects@ \ |
| 204 | $(TE_OBJS) |
| 205 | |
| 206 | GASPOBJS = \ |
| 207 | gasp.o \ |
| 208 | macro.o \ |
| 209 | sb.o \ |
| 210 | hash.o |
| 211 | |
| 212 | all: .gdbinit as.new gasp.new |
| 213 | @srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
| 214 | (cd doc ; $(MAKE) $(FLAGS_TO_PASS) all) |
| 215 | |
| 216 | dvi info install-info clean-info: |
| 217 | @srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
| 218 | (cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@) |
| 219 | |
| 220 | make-gas.com: stamp-mk.com |
| 221 | stamp-mk.com: vmsconf.sh Makefile |
| 222 | sh $(srcdir)/vmsconf.sh $(OBJS) > new-make.com |
| 223 | $(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com |
| 224 | touch stamp-mk.com |
| 225 | |
| 226 | # Now figure out from those variables how to compile and link. |
| 227 | |
| 228 | # This is the variable actually used when we compile. |
| 229 | ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CROSS) $(CFLAGS) $(HDEFINES) $(TDEFINES) |
| 230 | |
| 231 | # How to link with both our special library facilities |
| 232 | # and the system's installed libraries. |
| 233 | |
| 234 | LIBDEPS = @OPCODES_DEP@ @BFDDEP@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a |
| 235 | LIBS = @OPCODES_LIB@ @BFDLIB@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a |
| 236 | |
| 237 | # Specify the directories to be searched for header files. |
| 238 | # Both . and srcdir are used, in that order, |
| 239 | # so that tm.h and config.h will be found in the compilation |
| 240 | # subdirectory rather than in the source directory. |
| 241 | INCLUDES = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(srcdir)/../include -I$(srcdir)/.. -I$(srcdir)/../bfd |
| 242 | |
| 243 | # Always use -I$(srcdir)/config when compiling. |
| 244 | .c.o: |
| 245 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $< |
| 246 | |
| 247 | # This tells GNU make version 3 not to export all the variables |
| 248 | # defined in this file into the environment. |
| 249 | .NOEXPORT: |
| 250 | |
| 251 | # Files to be copied away after each stage in building. |
| 252 | STAGESTUFF = *.o as.new gasp.new |
| 253 | |
| 254 | $(OBJS): @ALL_OBJ_DEPS@ |
| 255 | |
| 256 | as.new: $(OBJS) $(LIBDEPS) |
| 257 | $(CC) $(HLDFLAGS) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES) |
| 258 | |
| 259 | $(OBJS): config.h as.h targ-env.h obj-format.h targ-cpu.h flonum.h expr.h \ |
| 260 | struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h obj.h \ |
| 261 | listing.h bignum.h |
| 262 | |
| 263 | gasp.new: $(GASPOBJS) ../libiberty/libiberty.a |
| 264 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gasp.new $(GASPOBJS) ../libiberty/libiberty.a $(LOADLIBES) |
| 265 | |
| 266 | installcheck: |
| 267 | @echo No installcheck target is available yet for the GNU assembler. |
| 268 | |
| 269 | site.exp: ./Makefile |
| 270 | @echo "Making a new config file..." |
| 271 | -@rm -f ./tmp? |
| 272 | @touch site.exp |
| 273 | -@mv site.exp site.bak |
| 274 | @echo "## these variables are automatically generated by make ##" > ./tmp0 |
| 275 | @echo "# Do not edit here. If you wish to override these values," >> ./tmp0 |
| 276 | @echo "# do so in the last section." >> ./tmp0 |
| 277 | @echo set host_os @host_os@ >> ./tmp0 |
| 278 | @echo set host_alias @host_alias@ >> ./tmp0 |
| 279 | @echo set host_cpu @host_cpu@ >> ./tmp0 |
| 280 | @echo set host_vendor @host_vendor@ >> ./tmp0 |
| 281 | @echo set target_os @target_os@ >> ./tmp0 |
| 282 | @echo set target_alias @target_alias@ >> ./tmp0 |
| 283 | @echo set target_cpu @target_cpu@ >> ./tmp0 |
| 284 | @echo set target_vendor @target_vendor@ >> ./tmp0 |
| 285 | @echo set host_triplet @host@ >> ./tmp0 |
| 286 | @echo set target_triplet @target@ >> ./tmp0 |
| 287 | @echo set target_canonical @target@ >> ./tmp0 |
| 288 | @echo set srcdir ${srcdir}/testsuite >> ./tmp0 |
| 289 | @echo set exec_prefix ${exec_prefix} >> ./tmp0 |
| 290 | @echo set objdir `pwd` >> ./tmp0 |
| 291 | @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0 |
| 292 | @sed -e '1,/^## All variables above are.*##/ d' < site.bak >> ./tmp0 |
| 293 | @mv -f ./tmp0 site.exp |
| 294 | |
| 295 | check: site.exp |
| 296 | if [ -d testsuite ]; then \ |
| 297 | true; \ |
| 298 | else \ |
| 299 | mkdir testsuite; \ |
| 300 | fi |
| 301 | rm -f testsuite/site.exp |
| 302 | cp site.exp testsuite/site.exp |
| 303 | rootme=`pwd`; export rootme; \ |
| 304 | srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \ |
| 305 | $(RPATH_ENVVAR)=$$rootme/../bfd:$$rootme/../opcodes:$$$(RPATH_ENVVAR); \ |
| 306 | export $(RPATH_ENVVAR); \ |
| 307 | cd testsuite; \ |
| 308 | EXPECT=${EXPECT} ; export EXPECT ; \ |
| 309 | if [ -f $${rootme}/../expect/expect ] ; then \ |
| 310 | TCL_LIBRARY=$${srcdir}/../tcl/library ; \ |
| 311 | export TCL_LIBRARY ; fi ; \ |
| 312 | $(RUNTEST) --tool gas --srcdir $${srcdir}/testsuite $(RUNTESTFLAGS) |
| 313 | |
| 314 | config.status: configure |
| 315 | if [ -r config.status ]; then \ |
| 316 | sh ./config.status --recheck ; \ |
| 317 | else \ |
| 318 | echo You must configure gas. Look at the INSTALL file for details. ; \ |
| 319 | exit 1 ; \ |
| 320 | fi |
| 321 | |
| 322 | config.h: config-stamp ; @true |
| 323 | config-stamp: Makefile conf |
| 324 | -rm -f config.new config-stamp |
| 325 | echo '/* config.h. Generated automatically by make. */' > config.new |
| 326 | echo '#ifndef GAS_VERSION' >> config.new |
| 327 | echo '#define GAS_VERSION "$(VERSION)"' >> config.new |
| 328 | echo '' >> config.new |
| 329 | cat conf >> config.new |
| 330 | echo '#endif /* GAS_VERSION */' >> config.new |
| 331 | $(srcdir)/../move-if-change config.new config.h |
| 332 | touch config-stamp |
| 333 | |
| 334 | # Compiling object files from source files. |
| 335 | |
| 336 | TARG_CPU_DEP_a29k = |
| 337 | TARG_CPU_DEP_alpha = $(srcdir)/../include/opcode/alpha.h subsegs.h |
| 338 | # start-sanitize-arc |
| 339 | TARG_CPU_DEP_arc = $(srcdir)/../include/opcode/arc.h subsegs.h |
| 340 | # end-sanitize-arc |
| 341 | TARG_CPU_DEP_arm = subsegs.h |
| 342 | TARG_CPU_DEP_generic = |
| 343 | TARG_CPU_DEP_h8300 = $(srcdir)/../include/opcode/h8300.h |
| 344 | TARG_CPU_DEP_h8500 = $(srcdir)/../opcodes/h8500-opc.h subsegs.h |
| 345 | TARG_CPU_DEP_hppa = subsegs.h |
| 346 | TARG_CPU_DEP_i386 = $(srcdir)/../include/opcode/i386.h subsegs.h |
| 347 | TARG_CPU_DEP_i860 = |
| 348 | TARG_CPU_DEP_i960 = |
| 349 | TARG_CPU_DEP_m68k = $(srcdir)/../include/opcode/m68k.h \ |
| 350 | $(srcdir)/config/m68k-parse.h subsegs.h |
| 351 | TARG_CPU_DEP_m88k = $(srcdir)/config/m88k-opcode.h subsegs.h |
| 352 | TARG_CPU_DEP_mips = $(srcdir)/../include/opcode/mips.h subsegs.h |
| 353 | TARG_CPU_DEP_ns32k = |
| 354 | TARG_CPU_DEP_ppc = subsegs.h |
| 355 | TARG_CPU_DEP_sh = $(srcdir)/../opcodes/sh-opc.h subsegs.h |
| 356 | TARG_CPU_DEP_sparc = subsegs.h |
| 357 | TARG_CPU_DEP_tahoe = |
| 358 | TARG_CPU_DEP_vax = |
| 359 | TARG_CPU_DEP_w65 = $(srcdir)/../opcodes/w65-opc.h subsegs.h |
| 360 | TARG_CPU_DEP_z8k = $(srcdir)/../opcodes/z8k-opc.h |
| 361 | |
| 362 | gasp.o : gasp.c sb.h macro.h config.h |
| 363 | sb.o : sb.c sb.h config.h |
| 364 | macro.o : macro.c macro.h sb.h hash.h config.h |
| 365 | app.o : app.c write.h |
| 366 | as.o : as.c output-file.h write.h subsegs.h sb.h macro.h |
| 367 | atof-generic.o : atof-generic.c |
| 368 | bignum-copy.o : bignum-copy.c |
| 369 | cond.o : cond.c |
| 370 | debug.o : debug.c subsegs.h |
| 371 | expr.o : expr.c |
| 372 | flonum-konst.o : flonum-konst.c |
| 373 | flonum-copy.o : flonum-copy.c |
| 374 | flonum-mult.o : flonum-mult.c |
| 375 | frags.o : frags.c subsegs.h |
| 376 | hash.o : hash.c |
| 377 | input-file.o : input-file.c input-file.h |
| 378 | input-scrub.o : input-scrub.c input-file.h sb.h |
| 379 | listing.o : listing.c input-file.h subsegs.h |
| 380 | literal.o : literal.c subsegs.h |
| 381 | messages.o : messages.c |
| 382 | output-file.o : output-file.c output-file.h |
| 383 | read.o : read.c sb.h macro.h |
| 384 | subsegs.o : subsegs.c subsegs.h |
| 385 | symbols.o : symbols.c subsegs.h |
| 386 | write.o : write.c subsegs.h output-file.h |
| 387 | ecoff.o : ecoff.c ecoff.h \ |
| 388 | $(srcdir)/../include/coff/internal.h $(srcdir)/../include/coff/sym.h \ |
| 389 | $(srcdir)/../include/coff/ecoff.h \ |
| 390 | $(srcdir)/../include/coff/symconst.h \ |
| 391 | $(srcdir)/../include/aout/stab_gnu.h |
| 392 | stabs.o : stabs.c subsegs.h $(srcdir)/../include/aout/stab_gnu.h |
| 393 | atof-targ.o : atof-targ.c |
| 394 | obj-format.o : obj-format.c |
| 395 | targ-cpu.o : targ-cpu.c $(TARG_CPU_DEP_@target_cpu_type@) |
| 396 | |
| 397 | obj-elf.o : $(srcdir)/config/obj-elf.c |
| 398 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-elf.c |
| 399 | obj-ecoff.o : $(srcdir)/config/obj-ecoff.c |
| 400 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-ecoff.c |
| 401 | |
| 402 | e-mipself.o : $(srcdir)/config/e-mipself.c |
| 403 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipself.c |
| 404 | e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c |
| 405 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipsecoff.c |
| 406 | |
| 407 | # The m68k operand parser. |
| 408 | |
| 409 | m68k-parse.c: $(srcdir)/config/m68k-parse.y |
| 410 | $(BISON) $(BISONFLAGS) $(srcdir)/config/m68k-parse.y |
| 411 | mv -f y.tab.c m68k-parse.c |
| 412 | m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h |
| 413 | |
| 414 | # Remake the info files. |
| 415 | |
| 416 | doc: $(srcdir)/as.info |
| 417 | |
| 418 | $(srcdir)/as.info: $(srcdir)/doc/as.texinfo |
| 419 | @(cd doc; $(MAKE) $(FLAGS_TO_PASS) as.info; mv as.info $srcdir) |
| 420 | |
| 421 | diststuff: $(DISTSTUFF) info |
| 422 | |
| 423 | clean-here: |
| 424 | -rm -f $(STAGESTUFF) core stamp-mk.com |
| 425 | -rm -f testsuite/*.o testsuite/*.out \ |
| 426 | testsuite/gas.log testsuite/gas.sum testsuite/site.exp |
| 427 | |
| 428 | clean mostlyclean: clean-here |
| 429 | @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@ |
| 430 | |
| 431 | # Like clean but also delete the links made to configure gas. |
| 432 | |
| 433 | DISTCLEAN_HERE = config.status Makefile targ-env.h targ-cpu.h \ |
| 434 | targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \ |
| 435 | config-stamp config.h conf config.log config.cache .gdbinit \ |
| 436 | testsuite/Makefile testsuite/config.status |
| 437 | |
| 438 | distclean: clean-here |
| 439 | @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@ |
| 440 | -rm -f $(DISTCLEAN_HERE) |
| 441 | |
| 442 | maintainer-clean realclean: clean-here |
| 443 | @echo "This command is intended for maintainers to use;" |
| 444 | @echo "it deletes files that may require special tools to rebuild." |
| 445 | @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@ |
| 446 | -rm -rf $(DISTCLEAN_HERE) $(DISTSTUFF) |
| 447 | |
| 448 | # Entry points `install', `includes' and `uninstall'. |
| 449 | |
| 450 | # Copy the files into directories where they will be run. |
| 451 | install: |
| 452 | srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
| 453 | $(INSTALL_XFORM) as.new $(bindir)/as; \ |
| 454 | $(INSTALL_XFORM1) $(srcdir)/doc/as.1 $(man1dir)/as.1; \ |
| 455 | test -d $(tooldir) || mkdir $(tooldir); \ |
| 456 | test -d $(tooldir)/bin || mkdir $(tooldir)/bin; \ |
| 457 | n=`echo as | sed '$(program_transform_name)'`; \ |
| 458 | rm -f $(tooldir)/bin/as; \ |
| 459 | ln $(bindir)/$$n $(tooldir)/bin/as >/dev/null 2>/dev/null \ |
| 460 | || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as |
| 461 | srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
| 462 | $(INSTALL_XFORM) gasp.new $(bindir)/gasp |
| 463 | |
| 464 | # Cancel installation by deleting the installed files. |
| 465 | uninstall: |
| 466 | -n=`t='$(program_transform_name)'; echo as | sed $$t`; \ |
| 467 | rm -f $(bindir)/$$n; \ |
| 468 | rm -f $(mandir)/$$n.1 |
| 469 | -n=`t='$(program_transform_name)'; echo gasp | sed $$t`; \ |
| 470 | rm -f $(bindir)/$$n; \ |
| 471 | |
| 472 | # These exist for maintenance purposes. |
| 473 | |
| 474 | tags TAGS: force |
| 475 | etags $(REAL_HEADERS) $(REAL_SOURCES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in |
| 476 | |
| 477 | bootstrap: as.new force |
| 478 | $(MAKE) stage1 |
| 479 | rm -f stage && ln -s stage1 stage |
| 480 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new |
| 481 | $(MAKE) stage2 |
| 482 | rm -f stage && ln -s stage2 stage |
| 483 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new |
| 484 | $(MAKE) comparison against=stage2 |
| 485 | |
| 486 | bootstrap2: force |
| 487 | rm -f stage && ln -s stage1 stage |
| 488 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new |
| 489 | $(MAKE) stage2 |
| 490 | rm -f stage && ln -s stage2 stage |
| 491 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new |
| 492 | $(MAKE) comparison against=stage2 |
| 493 | |
| 494 | bootstrap3: force |
| 495 | rm -f stage && ln -s stage2 stage |
| 496 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new |
| 497 | $(MAKE) comparison against=stage2 |
| 498 | |
| 499 | # Copy the object files from a particular stage into a subdirectory. |
| 500 | stage1: force |
| 501 | -mkdir stage1 |
| 502 | -mv $(STAGESTUFF) stage1 |
| 503 | if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi |
| 504 | |
| 505 | stage2: force |
| 506 | -mkdir stage2 |
| 507 | -mv $(STAGESTUFF) stage2 |
| 508 | if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi |
| 509 | |
| 510 | stage3: force |
| 511 | -mkdir stage3 |
| 512 | -mv $(STAGESTUFF) stage3 |
| 513 | if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi |
| 514 | |
| 515 | against=stage2 |
| 516 | |
| 517 | # This rule is derived from corresponding code in the Makefile.in for gcc. |
| 518 | # The "tail +16c" is to bypass headers which may include timestamps or |
| 519 | # temporary assembly file names. |
| 520 | comparison: force |
| 521 | x=0 ; \ |
| 522 | for file in *.o ; do \ |
| 523 | tail +16c ./$$file > tmp-foo1; \ |
| 524 | if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \ |
| 525 | if cmp tmp-foo1 tmp-foo2 ; then \ |
| 526 | true ; \ |
| 527 | else \ |
| 528 | echo $$file differs ; \ |
| 529 | x=1 ; \ |
| 530 | fi ; \ |
| 531 | else true; fi ; \ |
| 532 | done ; \ |
| 533 | exit $$x |
| 534 | -rm -f tmp-foo* |
| 535 | |
| 536 | de-stage1: force |
| 537 | - (cd stage1 ; rm -f as ; mv -f * ..) |
| 538 | - rmdir stage1 |
| 539 | |
| 540 | de-stage2: force |
| 541 | - (cd stage2 ; rm -f as ; mv -f * ..) |
| 542 | - rmdir stage2 |
| 543 | |
| 544 | de-stage3: force |
| 545 | - (cd stage3 ; rm -f as ; mv -f * ..) |
| 546 | - rmdir stage3 |
| 547 | |
| 548 | #In GNU Make, ignore whether `stage*' exists. |
| 549 | .PHONY: stage1 stage2 stage3 stage4 clean mostlyclean realclean distclean |
| 550 | .PHONY: TAGS bootstrap |
| 551 | |
| 552 | force: |
| 553 | |
| 554 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \ |
| 555 | $(srcdir)/configure.in config.status conf.in |
| 556 | $(SHELL) ./config.status |
| 557 | .gdbinit: $(srcdir)/gdbinit.in config.status |
| 558 | $(SHELL) ./config.status |