refactor & clean-up makefiles
This commit is contained in:
parent
68a360ab7f
commit
087d2b4cf1
42
makefile
42
makefile
|
@ -14,17 +14,14 @@ ifneq ($V,1)
|
||||||
endif
|
endif
|
||||||
${silent} ${CC} -c ${CFLAGS} $^ -o $@
|
${silent} ${CC} -c ${CFLAGS} $^ -o $@
|
||||||
|
|
||||||
#version of library
|
|
||||||
VERSION=0.43.0
|
|
||||||
|
|
||||||
include makefile.include
|
|
||||||
|
|
||||||
#default files to install
|
#default files to install
|
||||||
ifndef LIBNAME
|
ifndef LIBNAME
|
||||||
LIBNAME=libtommath.a
|
LIBNAME=libtommath.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
default: ${LIBNAME}
|
include makefile.include
|
||||||
|
|
||||||
|
LCOV_ARGS=--directory .
|
||||||
|
|
||||||
#START_INS
|
#START_INS
|
||||||
OBJECTS=bncore.o bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
|
OBJECTS=bncore.o bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
|
||||||
|
@ -58,24 +55,6 @@ $(LIBNAME): $(OBJECTS)
|
||||||
$(AR) $(ARFLAGS) $@ $(OBJECTS)
|
$(AR) $(ARFLAGS) $@ $(OBJECTS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
|
||||||
#make the code coverage of the library
|
|
||||||
#
|
|
||||||
coverage: CFLAGS += -fprofile-arcs -ftest-coverage -DTIMING_NO_LOGS
|
|
||||||
coverage: LFLAGS += -lgcov
|
|
||||||
|
|
||||||
coverage: test_standalone timing
|
|
||||||
./test
|
|
||||||
./ltmtest
|
|
||||||
|
|
||||||
lcov: coverage
|
|
||||||
rm -f coverage.info
|
|
||||||
lcov --capture --no-external --no-recursion --directory . --output-file coverage.info -q
|
|
||||||
genhtml coverage.info --output-directory coverage -q
|
|
||||||
|
|
||||||
coveralls: coverage
|
|
||||||
cpp-coveralls
|
|
||||||
|
|
||||||
#make a profiled library (takes a while!!!)
|
#make a profiled library (takes a while!!!)
|
||||||
#
|
#
|
||||||
# This will build the library with profile generation
|
# This will build the library with profile generation
|
||||||
|
@ -100,10 +79,10 @@ profiled_single:
|
||||||
ranlib $(LIBNAME)
|
ranlib $(LIBNAME)
|
||||||
|
|
||||||
install: $(LIBNAME)
|
install: $(LIBNAME)
|
||||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
|
install -d $(DESTDIR)$(LIBPATH)
|
||||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
|
install -d $(DESTDIR)$(INCPATH)
|
||||||
install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH)
|
install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)
|
||||||
install -g $(GROUP) -o $(USER) $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
|
install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
|
||||||
|
|
||||||
test: $(LIBNAME) demo/demo.o
|
test: $(LIBNAME) demo/demo.o
|
||||||
$(CC) $(CFLAGS) demo/demo.o $(LIBNAME) $(LFLAGS) -o test
|
$(CC) $(CFLAGS) demo/demo.o $(LIBNAME) $(LFLAGS) -o test
|
||||||
|
@ -177,13 +156,6 @@ manual: mandvi
|
||||||
pretty:
|
pretty:
|
||||||
perl pretty.build
|
perl pretty.build
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.gcda *.gcno *.bat *.o *.a *.obj *.lib *.exe *.dll etclib/*.o demo/demo.o test ltmtest mpitest mtest/mtest mtest/mtest.exe \
|
|
||||||
*.idx *.toc *.log *.aux *.dvi *.lof *.ind *.ilg *.ps *.log *.s mpi.c *.da *.dyn *.dpi tommath.tex `find . -type f | grep [~] | xargs` *.lo *.la
|
|
||||||
rm -rf .libs
|
|
||||||
cd etc ; MAKE=${MAKE} ${MAKE} clean
|
|
||||||
cd pics ; MAKE=${MAKE} ${MAKE} clean
|
|
||||||
|
|
||||||
#zipup the project (take that!)
|
#zipup the project (take that!)
|
||||||
no_oops: clean
|
no_oops: clean
|
||||||
cd .. ; cvs commit
|
cd .. ; cvs commit
|
||||||
|
|
|
@ -2,6 +2,13 @@
|
||||||
# Include makefile for libtommath
|
# Include makefile for libtommath
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#version of library
|
||||||
|
VERSION=0.43.0
|
||||||
|
VERSION_SO=0:43
|
||||||
|
|
||||||
|
# default make target
|
||||||
|
default: ${LIBNAME}
|
||||||
|
|
||||||
# Compiler and Linker Names
|
# Compiler and Linker Names
|
||||||
ifndef PREFIX
|
ifndef PREFIX
|
||||||
PREFIX=
|
PREFIX=
|
||||||
|
@ -52,19 +59,6 @@ HEADERS=tommath_private.h $(HEADERS_PUB)
|
||||||
|
|
||||||
test_standalone: CFLAGS+=-DLTM_DEMO_TEST_VS_MTEST=0
|
test_standalone: CFLAGS+=-DLTM_DEMO_TEST_VS_MTEST=0
|
||||||
|
|
||||||
#install as this user
|
|
||||||
ifndef INSTALL_GROUP
|
|
||||||
GROUP=wheel
|
|
||||||
else
|
|
||||||
GROUP=$(INSTALL_GROUP)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef INSTALL_USER
|
|
||||||
USER=root
|
|
||||||
else
|
|
||||||
USER=$(INSTALL_USER)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#LIBPATH-The directory for libtommath to be installed to.
|
#LIBPATH-The directory for libtommath to be installed to.
|
||||||
#INCPATH-The directory to install the header files for libtommath.
|
#INCPATH-The directory to install the header files for libtommath.
|
||||||
#DATAPATH-The directory to install the pdf docs.
|
#DATAPATH-The directory to install the pdf docs.
|
||||||
|
@ -72,3 +66,35 @@ LIBPATH?=/usr/lib
|
||||||
INCPATH?=/usr/include
|
INCPATH?=/usr/include
|
||||||
DATAPATH?=/usr/share/doc/libtommath/pdf
|
DATAPATH?=/usr/share/doc/libtommath/pdf
|
||||||
|
|
||||||
|
#make the code coverage of the library
|
||||||
|
#
|
||||||
|
coverage: CFLAGS += -fprofile-arcs -ftest-coverage -DTIMING_NO_LOGS
|
||||||
|
coverage: LFLAGS += -lgcov
|
||||||
|
coverage: LDFLAGS += -lgcov
|
||||||
|
|
||||||
|
coverage: test_standalone timing
|
||||||
|
./test
|
||||||
|
./ltmtest
|
||||||
|
|
||||||
|
lcov: coverage
|
||||||
|
rm -f coverage.info
|
||||||
|
lcov --capture --no-external --no-recursion $(LCOV_ARGS) --output-file coverage.info -q
|
||||||
|
genhtml coverage.info --output-directory coverage -q
|
||||||
|
|
||||||
|
coveralls: coverage
|
||||||
|
cpp-coveralls
|
||||||
|
|
||||||
|
# target that removes all coverage output
|
||||||
|
cleancov-clean:
|
||||||
|
rm -f `find . -type f -name "*.info" | xargs`
|
||||||
|
rm -rf coverage/
|
||||||
|
|
||||||
|
# cleans everything - coverage output and standard 'clean'
|
||||||
|
cleancov: cleancov-clean clean
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.gcda *.gcno *.bat *.o *.a *.obj *.lib *.exe *.dll etclib/*.o demo/demo.o test ltmtest mpitest mtest/mtest mtest/mtest.exe \
|
||||||
|
*.idx *.toc *.log *.aux *.dvi *.lof *.ind *.ilg *.ps *.log *.s mpi.c *.da *.dyn *.dpi tommath.tex `find . -type f | grep [~] | xargs` *.lo *.la
|
||||||
|
rm -rf .libs/
|
||||||
|
cd etc ; MAKE=${MAKE} ${MAKE} clean
|
||||||
|
cd pics ; MAKE=${MAKE} ${MAKE} clean
|
||||||
|
|
|
@ -1,22 +1,18 @@
|
||||||
#Makefile for GCC
|
#Makefile for GCC
|
||||||
#
|
#
|
||||||
#Tom St Denis
|
#Tom St Denis
|
||||||
VERSION=0:42
|
|
||||||
|
#default files to install
|
||||||
|
ifndef LIBNAME
|
||||||
|
LIBNAME=libtommath.la
|
||||||
|
endif
|
||||||
|
|
||||||
include makefile.include
|
include makefile.include
|
||||||
|
|
||||||
LT ?= libtool
|
LT ?= libtool
|
||||||
LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
|
LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
|
||||||
|
|
||||||
default: libtommath.la
|
LCOV_ARGS=--directory .libs --directory .
|
||||||
|
|
||||||
#default files to install
|
|
||||||
ifndef LIBNAME
|
|
||||||
LIBNAME=libtommath.la
|
|
||||||
endif
|
|
||||||
ifndef LIBNAME_S
|
|
||||||
LIBNAME_S=libtommath.a
|
|
||||||
endif
|
|
||||||
|
|
||||||
#START_INS
|
#START_INS
|
||||||
OBJECTS=bncore.o bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
|
OBJECTS=bncore.o bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
|
||||||
|
@ -52,12 +48,12 @@ objs: $(OBJECTS)
|
||||||
$(LTCOMPILE) $(CFLAGS) $(LDFLAGS) -o $@ -c $<
|
$(LTCOMPILE) $(CFLAGS) $(LDFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
$(LIBNAME): $(OBJECTS)
|
$(LIBNAME): $(OBJECTS)
|
||||||
$(LT) --mode=link --tag=CC $(CC) $(LDFLAGS) *.lo -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION)
|
$(LT) --mode=link --tag=CC $(CC) $(LDFLAGS) *.lo -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO)
|
||||||
|
|
||||||
install: $(LIBNAME)
|
install: $(LIBNAME)
|
||||||
install -d $(DESTDIR)$(LIBPATH)
|
install -d $(DESTDIR)$(LIBPATH)
|
||||||
$(LT) --mode=install install -c $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
|
|
||||||
install -d $(DESTDIR)$(INCPATH)
|
install -d $(DESTDIR)$(INCPATH)
|
||||||
|
$(LT) --mode=install install -c $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
|
||||||
install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
|
install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
|
||||||
|
|
||||||
test: $(LIBNAME) demo/demo.o
|
test: $(LIBNAME) demo/demo.o
|
||||||
|
@ -72,4 +68,4 @@ mtest:
|
||||||
cd mtest ; $(CC) $(CFLAGS) $(LDFLAGS) mtest.c -o mtest
|
cd mtest ; $(CC) $(CFLAGS) $(LDFLAGS) mtest.c -o mtest
|
||||||
|
|
||||||
timing: $(LIBNAME)
|
timing: $(LIBNAME)
|
||||||
$(LT) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -DTIMER demo/timing.c $(LIBNAME_S) -o ltmtest
|
$(LT) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -DTIMER demo/timing.c $(LIBNAME) -o ltmtest
|
||||||
|
|
Loading…
Reference in New Issue