# This is a sample makefile that can be used to compile programs using 
# an installed version of NTL.
# Using this ensures that your programs compile with flags consistent
# with the build, and link to the right libraries.
#
# The basic functionality provided by this makefile is to allow
# you to compile 'foo.cpp' into the executable file 'foo' by executing
#    make foo   
# You can adapt this to the needs of your own project as necessary.


.cpp:
	g++ -I/usr/include   -O1 -fomit-frame-pointer -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -flto -fno-rtti -pthread -mcpu=native  $< -o $@  -L/usr/lib64   -lntl   -lgmp    -lgf2x  -lm

# ntl was installed as a static library with dependencies: gmp gf2x

# COMPILER OPTIONS
# "-I/usr/include" ensures ntl header files found at compile time
# "-pthread" enables multi-threading (also needed for linking)
# "-mcpu=native" targets compilation to the native instruction set
#    (preferred over -march=native for arm platforms)
# "$<" expands to "foo.cpp" when run as "make foo"

# LINKER OPTIONS
# "-o $@" expands to "-o foo" when run as "make foo"
# "-L/usr/lib64" ensures ntl is found at link time
# "-lntl" ensures that program will link to ntl
