# 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:
	clang++ -I/clangarm64/include   -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wp,-D__USE_MINGW_ANSI_STDIO=1 -pthread  -o $@ $< -L/clangarm64/lib  -Wl,-rpath,/clangarm64/lib -lntl

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

# COMPILER OPTIONS
# "-I/clangarm64/include" ensures ntl header files found at compile time
# "-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/clangarm64/lib" ensures ntl is found at link time
# "-Wl,-rpath,/clangarm64/lib" ensures ntl is found at runtime
#    alternatively, add /clangarm64/lib 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 clang++ -I/clangarm64/include   -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wp,-D__USE_MINGW_ANSI_STDIO=1 -pthread  -o $@ $< -L/clangarm64/lib  -lntl
# which ensures ntl all dependencies are properly linked and accessible at runtime
# and may offer convenient access to more linkage options via libtool
