github.com/aergoio/aergo@v1.3.1/libtool/src/gmp-6.1.2/mini-gmp/tests/Makefile (about)

     1  # Note: Requires GNU make
     2  
     3  # Copyright 2011, 2012, 2014, 2016 Free Software Foundation, Inc.
     4  #
     5  # This file is part of the GNU MP Library test suite.
     6  #
     7  # The GNU MP Library test suite is free software; you can redistribute it
     8  # and/or modify it under the terms of the GNU General Public License as
     9  # published by the Free Software Foundation; either version 3 of the License,
    10  # or (at your option) any later version.
    11  #
    12  # The GNU MP Library test suite is distributed in the hope that it will be
    13  # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
    14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
    15  # Public License for more details.
    16  #
    17  # You should have received a copy of the GNU General Public License along with
    18  # the GNU MP Library test suite.  If not, see https://www.gnu.org/licenses/.
    19  
    20  srcdir=.
    21  MINI_GMP_DIR=..
    22  
    23  CC = gcc
    24  CFLAGS = -O -Wall -g
    25  CPPFLAGS =
    26  LDFLAGS =
    27  
    28  LIBS = -lgmp -lm -lmcheck
    29  
    30  CHECK_PROGRAMS = t-add t-sub t-mul t-invert t-div t-div_2exp \
    31  	t-double t-cmp_d t-gcd t-lcm t-import t-comb t-signed \
    32  	t-sqrt t-root t-powm t-logops t-bitops t-scan t-str \
    33  	t-reuse t-aorsmul t-limbs t-cong t-pprime_p
    34  # Default TESTS to all tests, allowing overriding TESTS for building tests
    35  # without running them.
    36  TESTS = $(CHECK_PROGRAMS)
    37  
    38  MISC_OBJS = hex-random.o mini-random.o testutils.o
    39  
    40  all:
    41  
    42  clean:
    43  	rm -f *.o $(CHECK_PROGRAMS)
    44  
    45  %: %.c
    46  .c:
    47  
    48  # Keep object files
    49  .PRECIOUS: %.o
    50  
    51  %.o: %.c $(MINI_GMP_DIR)/mini-gmp.h hex-random.h mini-random.h
    52  	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
    53  
    54  testutils.o: $(MINI_GMP_DIR)/mini-gmp.c
    55  
    56  %: %.o $(MISC_OBJS)
    57  	$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
    58  
    59  # Missing tests include:
    60  #   mpz_cmp_d, mpz_popcount, mpz_hamdist, mpz_ui_pow_ui
    61  
    62  check: $(CHECK_PROGRAMS)
    63  	$(srcdir)/run-tests $(TESTS)