$NetBSD: patch-aa,v 1.4 2001/06/20 10:19:28 jtb Exp $ --- makefile.orig Fri Jun 8 14:23:17 2001 +++ makefile @@ -7,7 +7,7 @@ ############################################################### -CC=gcc +#CC=gcc # A C or C++ compiler, e. g., gcc, cc, xlc. # There are a few components written in C which may be compiled # under C++, but C compilers tend to generate slightly better code. @@ -15,11 +15,11 @@ # compatible code. -CXX=g++ +#CXX=g++ # A C++ compiler, e.g., g++, CC, xlC -CFLAGS=-O2 +#CFLAGS=-O2 # Flags for the C compiler # Some useful flags: # -O2 -- recommended level of optimization @@ -31,7 +31,7 @@ -CXXFLAGS=$(CFLAGS) +#CXXFLAGS=$(CFLAGS) # Flags for the C++ compiler (usually the same as CFLAGS) # Some useful flags: # -+ -- needed with xlC to make it treat .c files as C++ files @@ -40,16 +40,16 @@ # The defaults should almost always be OK. -AR=ar +#AR=ar # command to make a library ARFLAGS=ruv # arguments for AR -RANLIB=ranlib +#RANLIB=ranlib # set to echo if you want to disable it completely -LDFLAGS= +#LDFLAGS= # arguments for linker for C++ programs LDFLAGS_CXX=$(LDFLAGS) @@ -61,13 +61,13 @@ LDLIBS_CXX=$(LDLIBS) # libraries for linking C++ programs -CPPFLAGS= +#CPPFLAGS= # arguments for the C preprocessor -PREFIX=/usr/local +#PREFIX=/usr/local LIBDIR=$(PREFIX)/lib INCLUDEDIR=$(PREFIX)/include -DOCDIR=$(PREFIX)/doc +DOCDIR=$(PREFIX)/share/doc # where to install NTL ############################################################### @@ -87,15 +87,15 @@ ############################################################### -GMP_INCDIR= +GMP_INCDIR= -I${GMP_PREFIX}/include # Set to -I if using GMP and GMP # is not installed in a standard system directory, empty otherwise -GMP_LIBDIR= +GMP_LIBDIR= -Wl,-R${GMP_PREFIX}/lib -L${GMP_PREFIX}/lib # Set to -L if using GMP and GMP # is not installed in a standard system directory, empty otherwise -GMP_LIB= +GMP_LIB= -lgmp # Set to -lgmp if using GMP, empty otherwise ############################################################### @@ -285,11 +285,11 @@ NTL_INCLUDE = -I../include -I. # NTL needs this to find its include files -COMPILE = $(CC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) -c -COMPILE_CXX = $(CXX) $(NTL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) -c +COMPILE = $(LIBTOOL) $(CC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) -c +COMPILE_CXX = $(LIBTOOL) $(CXX) $(NTL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) -c -LINK = $(CC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -LINK_CXX = $(CXX) $(NTL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS_CXX) +LINK = $(LIBTOOL) $(CC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) +LINK_CXX = $(LIBTOOL) $(CXX) $(NTL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS_CXX) @@ -298,14 +298,14 @@ make setup2 make setup3 make setup4 - make ntl.a + make libntl.la # setup1 generates the file ../incluse/NTL/mach_desc.h setup1: $(COMPILE) MakeDescAux.c - $(LINK) -o MakeDesc MakeDesc.c MakeDescAux.o $(LDLIBS) + $(LINK) -o MakeDesc MakeDesc.c MakeDescAux.lo $(LDLIBS) ./MakeDesc mv mach_desc.h ../include/NTL/mach_desc.h @@ -332,9 +332,9 @@ sh Wizard $(WIZARD) -ntl.a: $(OBJ) - $(AR) $(ARFLAGS) ntl.a $(OBJ) - - $(RANLIB) ntl.a +libntl.la: $(OBJ) + $(LIBTOOL) $(CC) -o libntl.la $(OBJ:.o=.lo) -rpath $(LIBDIR) \ + --version-info 0:0 lip.o: lip.c g_lip_impl.h c_lip_impl.h lip_gmp_aux_impl.h $(COMPILE) $(GMP_INCDIR) lip.c @@ -351,7 +351,7 @@ $(COMPILE_CXX) $< .c: - $(LINK_CXX) -o $@ $< ntl.a $(GMP_LIBDIR) $(GMP_LIB) $(LDLIBS_CXX) + $(LINK_CXX) -o $@ $< libntl.la $(GMP_LIBDIR) $(GMP_LIB) $(LDLIBS_CXX) ################################################################# # @@ -379,17 +379,12 @@ install: - mkdir -p $(LIBDIR) - cp ntl.a $(LIBDIR)/libntl.a - mkdir -p $(INCLUDEDIR) - - rm -r $(INCLUDEDIR)/NTL - mkdir $(INCLUDEDIR)/NTL - cp ../include/NTL/*.h $(INCLUDEDIR)/NTL - mkdir -p $(DOCDIR) - - rm -r $(DOCDIR)/NTL - mkdir $(DOCDIR)/NTL - cp ../doc/*.txt $(DOCDIR)/NTL - cp ../doc/*.html $(DOCDIR)/NTL + $(LIBTOOL) $(BSD_INSTALL_DATA) libntl.la $(LIBDIR) + $(BSD_INSTALL_DATA_DIR) $(INCLUDEDIR)/NTL + $(BSD_INSTALL_DATA) ../include/NTL/*.h $(INCLUDEDIR)/NTL + $(BSD_INSTALL_DATA_DIR) $(DOCDIR)/NTL + $(BSD_INSTALL_DATA) ../doc/*.txt $(DOCDIR)/NTL + $(BSD_INSTALL_DATA) ../doc/*.html $(DOCDIR)/NTL uninstall: @@ -409,16 +404,16 @@ ################################################################# clobber: - - rm ntl.a mach_desc.h ../include/NTL/mach_desc.h GetTime.c - - rm lip_gmp_aux_impl.h ../include/NTL/gmp_aux.h + - rm -fr libntl.la .libs mach_desc.h ../include/NTL/mach_desc.h GetTime.c + - rm -f lip_gmp_aux_impl.h ../include/NTL/gmp_aux.h - sh RemoveProg $(PROGS) MakeDesc TestGetTime gen_lip_gmp_aux gen_gmp_aux - - rm *.o - - rm -r small + - rm -f *.o *.lo + - rm -fr small clean: - - rm *.o + - rm -f *.o *.lo - sh RemoveProg MakeDesc TestGetTime gen_lip_gmp_aux gen_gmp_aux - - rm -r small + - rm -fr small ################################################################# # @@ -464,17 +459,17 @@ WOBJ = $(WO2) -wntl.a: $(WOBJ) - $(AR) $(ARFLAGS) wntl.a $(WOBJ) - - $(RANLIB) wntl.a +libwntl.la: $(WOBJ) + $(LIBTOOL) $(CC) -o libwntl.la $(WOBJ:.o=.lo) -rpath $(LIBDIR) \ + --version-info 0:0 MulTimeTest: - $(LINK_CXX) -o MulTimeTest MulTimeTest.c wntl.a $(GMP_LIBDIR) $(GMP_LIB) $(LDLIBS_CXX) + $(LINK_CXX) -o MulTimeTest MulTimeTest.c libwntl.la $(GMP_LIBDIR) $(GMP_LIB) $(LDLIBS_CXX) PolyTimeTest: - $(LINK_CXX) -o PolyTimeTest PolyTimeTest.c wntl.a $(GMP_LIBDIR) $(GMP_LIB) $(LDLIBS_CXX) + $(LINK_CXX) -o PolyTimeTest PolyTimeTest.c libwntl.la $(GMP_LIBDIR) $(GMP_LIB) $(LDLIBS_CXX) InitSettings: $(LINK_CXX) -o InitSettings InitSettings.c $(LDLIBS_CXX)