# 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:
	/usr/bin/clang++ -I/opt/local/include  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64 -std=c++11 -pthread -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64 -o $@ $< -L/opt/local/lib   -lntl

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

# COMPILER OPTIONS
# "-I/opt/local/include" ensures ntl header files found at compile time
# "-std=c++11" enables the C++11 standard
# "-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/opt/local/lib" ensures ntl is found at link time
# "-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 /usr/bin/clang++ -I/opt/local/include  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64 -std=c++11 -pthread -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64 -o $@ $< -L/opt/local/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
# - on macOS, you may need to use someling like glibtool installed by (say)
# - homebrew, and not the system libtool
