# 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   -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -pthread  -o $@ $< -L/usr/lib64  -Wl,-rpath,/usr/lib64 -lntl

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

# COMPILER OPTIONS
# "-I/usr/include" ensures ntl header files found at compile time
# "-g" enables the debugger
# "-O2" enables (level 2) optimization (highly recommend not changing)
# "-pthread" enables multi-threading (also needed for linking)
# "$<" 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
# "-Wl,-rpath,/usr/lib64" ensures ntl is found at runtime
#    alternatively, add /usr/lib64 to LD_LIBRARY_PATH
# "-lntl" ensures that program will link to ntl

# ntl was installed using libtool

# in your project, you could alternatively compile and link as follows:
#	libtool --tag=CXX --mode=link g++ -I/usr/include   -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -pthread  -o $@ $< -L/usr/lib64  -lntl
# which ensures ntl all dependencies are properly linked and accessible at runtime
# and may offer convenient access to more linkage options via libtool
