Falcon source files (reference implementation)


Makefile

    1 # Build script for the Falcon implementation.
    2 #
    3 # ==========================(LICENSE BEGIN)============================
    4 #
    5 # Copyright (c) 2017-2019  Falcon Project
    6 #
    7 # Permission is hereby granted, free of charge, to any person obtaining
    8 # a copy of this software and associated documentation files (the
    9 # "Software"), to deal in the Software without restriction, including
   10 # without limitation the rights to use, copy, modify, merge, publish,
   11 # distribute, sublicense, and/or sell copies of the Software, and to
   12 # permit persons to whom the Software is furnished to do so, subject to
   13 # the following conditions:
   14 #
   15 # The above copyright notice and this permission notice shall be
   16 # included in all copies or substantial portions of the Software.
   17 #
   18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   19 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   20 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   21 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
   22 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
   23 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
   24 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   25 #
   26 # ===========================(LICENSE END)=============================
   27 #
   28 # @author   Thomas Pornin <thomas.pornin@nccgroup.com>
   29 
   30 .POSIX:
   31 
   32 # =====================================================================
   33 #
   34 # Configurable options:
   35 #   CC       C compiler; GCC or Clang are fine; MSVC (2015+) works too.
   36 #   CFLAGS   Compilation flags:
   37 #             * Optimization level -O2 or higher is recommended
   38 #            See config.h for some possible configuration macros.
   39 #   LD       Linker; normally the same command as the compiler.
   40 #   LDFLAGS  Linker options, not counting the extra libs.
   41 #   LIBS     Extra libraries for linking:
   42 #             * If using the native FPU, test_falcon and application
   43 #               code that calls this library may need: -lm
   44 #               (normally not needed on x86, both 32-bit and 64-bit)
   45 
   46 CC = clang
   47 CFLAGS = -Wall -Wextra -Wshadow -Wundef -O3 #-pg -fno-pie
   48 LD = clang
   49 LDFLAGS = #-pg -no-pie
   50 LIBS = #-lm
   51 
   52 # =====================================================================
   53 
   54 OBJ = codec.o common.o falcon.o fft.o fpr.o keygen.o rng.o shake.o sign.o vrfy.o
   55 
   56 all: test_falcon speed
   57 
   58 clean:
   59         -rm -f $(OBJ) test_falcon test_falcon.o speed speed.o
   60 
   61 test_falcon: test_falcon.o $(OBJ)
   62         $(LD) $(LDFLAGS) -o test_falcon test_falcon.o $(OBJ) $(LIBS)
   63 
   64 speed: speed.o $(OBJ)
   65         $(LD) $(LDFLAGS) -o speed speed.o $(OBJ) $(LIBS)
   66 
   67 codec.o: codec.c config.h inner.h fpr.h
   68         $(CC) $(CFLAGS) -c -o codec.o codec.c
   69 
   70 common.o: common.c config.h inner.h fpr.h
   71         $(CC) $(CFLAGS) -c -o common.o common.c
   72 
   73 falcon.o: falcon.c falcon.h config.h inner.h fpr.h
   74         $(CC) $(CFLAGS) -c -o falcon.o falcon.c
   75 
   76 fft.o: fft.c config.h inner.h fpr.h
   77         $(CC) $(CFLAGS) -c -o fft.o fft.c
   78 
   79 fpr.o: fpr.c config.h inner.h fpr.h
   80         $(CC) $(CFLAGS) -c -o fpr.o fpr.c
   81 
   82 keygen.o: keygen.c config.h inner.h fpr.h
   83         $(CC) $(CFLAGS) -c -o keygen.o keygen.c
   84 
   85 rng.o: rng.c config.h inner.h fpr.h
   86         $(CC) $(CFLAGS) -c -o rng.o rng.c
   87 
   88 shake.o: shake.c config.h inner.h fpr.h
   89         $(CC) $(CFLAGS) -c -o shake.o shake.c
   90 
   91 sign.o: sign.c config.h inner.h fpr.h
   92         $(CC) $(CFLAGS) -c -o sign.o sign.c
   93 
   94 speed.o: speed.c falcon.h
   95         $(CC) $(CFLAGS) -c -o speed.o speed.c
   96 
   97 test_falcon.o: test_falcon.c falcon.h config.h inner.h fpr.h
   98         $(CC) $(CFLAGS) -c -o test_falcon.o test_falcon.c
   99 
  100 vrfy.o: vrfy.c config.h inner.h fpr.h
  101         $(CC) $(CFLAGS) -c -o vrfy.o vrfy.c