Annotation of OpenXM_contrib/gmp/mpn/Makeasm.am, Revision 1.1
1.1 ! ohara 1: ## Automake asm file rules.
! 2:
! 3: # Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
! 4: #
! 5: # This file is part of the GNU MP Library.
! 6: #
! 7: # The GNU MP Library is free software; you can redistribute it and/or modify
! 8: # it under the terms of the GNU Lesser General Public License as published by
! 9: # the Free Software Foundation; either version 2.1 of the License, or (at your
! 10: # option) any later version.
! 11: #
! 12: # The GNU MP Library is distributed in the hope that it will be useful, but
! 13: # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
! 14: # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
! 15: # License for more details.
! 16: #
! 17: # You should have received a copy of the GNU Lesser General Public License
! 18: # along with the GNU MP Library; see the file COPYING.LIB. If not, write to
! 19: # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
! 20: # MA 02111-1307, USA.
! 21:
! 22:
! 23: # COMPILE minus CC.
! 24: #
! 25: COMPILE_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
! 26: $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
! 27:
! 28: # Flags used for preprocessing (in ansi2knr rules).
! 29: #
! 30: PREPROCESS_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
! 31: $(CPPFLAGS)
! 32:
! 33:
! 34: # Recent versions of automake (1.5 and up for instance) append automake
! 35: # generated suffixes to this $(SUFFIXES) list. This is essential for us,
! 36: # since .c must come after .s, .S and .asm. If .c is before .s, for
! 37: # instance, then in the mpn directory "make" will see add_n.c mentioned in
! 38: # an explicit rule (the ansi2knr stuff) and decide it must have add_n.c,
! 39: # even if add_n.c doesn't exist but add_n.s does. See GNU make
! 40: # documentation "(make)Implicit Rule Search", part 5c.
! 41: #
! 42: # On IRIX 6 native make this doesn't work properly though. Somehow .c
! 43: # remains ahead of .s, perhaps because .c.s is a builtin rule. .asm works
! 44: # fine though, and mpn/mips3 uses this.
! 45: #
! 46: SUFFIXES = .s .S .asm
! 47:
! 48:
! 49: # .s assembler, no preprocessing.
! 50: #
! 51: .s.o:
! 52: $(CCAS) $(COMPILE_FLAGS) `test -f $< || echo '$(srcdir)/'`$<
! 53: .s.obj:
! 54: $(CCAS) $(COMPILE_FLAGS) `cygpath -w $<`
! 55: .s.lo:
! 56: $(LIBTOOL) --mode=compile $(CCAS) $(COMPILE_FLAGS) `test -f $< || echo '$(srcdir)/'`$<
! 57:
! 58:
! 59: # can be overridden during development, eg. "make RM_TMP=: mul_1.lo"
! 60: RM_TMP = rm -f
! 61:
! 62:
! 63: # .S assembler, preprocessed with cpp.
! 64: #
! 65: # It's necessary to run $(CPP) separately, since it seems not all compilers
! 66: # recognise .S files, in particular "cc" on HP-UX 10 and 11 doesn't (and
! 67: # will silently do nothing if given a .S).
! 68: #
! 69: # For .lo we need a helper script, as described below for .asm.lo.
! 70: #
! 71: .S.o:
! 72: $(CPP) $(PREPROCESS_FLAGS) `test -f $< || echo '$(srcdir)/'`$< | grep -v '^#' >tmp-$*.s
! 73: $(CCAS) $(COMPILE_FLAGS) tmp-$*.s -o $@
! 74: $(RM_TMP) tmp-$*.s
! 75: .S.obj:
! 76: $(CPP) $(PREPROCESS_FLAGS) `cygpath -w $<` | grep -v '^#' >tmp-$*.s
! 77: $(CCAS) $(COMPILE_FLAGS) tmp-$*.s -o $@
! 78: $(RM_TMP) tmp-$*.s
! 79: .S.lo:
! 80: $(LIBTOOL) --mode=compile --tag=CC $(top_srcdir)/mpn/cpp-ccas --cpp="$(CPP) $(PREPROCESS_FLAGS)" $(CCAS) $(COMPILE_FLAGS) `test -f $< || echo '$(srcdir)/'`$<
! 81:
! 82:
! 83: # .asm assembler, preprocessed with m4.
! 84: #
! 85: # .o and .obj are non-PIC and just need m4 followed by a compile.
! 86: #
! 87: # .lo is a bit tricky. Libtool (as of version 1.5) has foo.lo as a little
! 88: # text file, and .libs/foo.o and foo.o as the PIC and non-PIC objects,
! 89: # respectively. It'd be asking for lots of trouble to try to create foo.lo
! 90: # ourselves, so instead arrange to invoke libtool like a --mode=compile, but
! 91: # with a special m4-ccas script which first m4 preprocesses, then compiles.
! 92: # --tag=CC is necessary since foo.asm is otherwise unknown to libtool.
! 93: #
! 94: # Libtool adds -DPIC when building a shared object and the .asm files look
! 95: # for that. But it should be noted that the other PIC flags are on occasion
! 96: # important too, in particular FreeBSD 2.2.8 gas 1.92.3 requires -k before
! 97: # it accepts PIC constructs like @GOT, and gcc adds that flag only under
! 98: # -fPIC. (Later versions of gas are happy to accept PIC stuff any time.)
! 99: #
! 100: .asm.o:
! 101: $(M4) -DOPERATION_$* `test -f $< || echo '$(srcdir)/'`$< >tmp-$*.s
! 102: $(CCAS) $(COMPILE_FLAGS) tmp-$*.s -o $@
! 103: $(RM_TMP) tmp-$*.s
! 104: .asm.obj:
! 105: $(M4) -DOPERATION_$* `cygpath -w $<` >tmp-$*.s
! 106: $(CCAS) $(COMPILE_FLAGS) tmp-$*.s -o $@
! 107: $(RM_TMP) tmp-$*.s
! 108: .asm.lo:
! 109: $(LIBTOOL) --mode=compile --tag=CC $(top_srcdir)/mpn/m4-ccas --m4="$(M4)" $(CCAS) $(COMPILE_FLAGS) `test -f $< || echo '$(srcdir)/'`$<
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>