makefiles: add makefile.include

to be used in makefile and makefile.shared

use -Wextra instead of deprecated -W
add additional warnings also used in libtomcrypt
  can be disabled by defining NO_ADDTL_WARNINGS
add possibility to define COMPILE_SIZE or COMPILE_DEBUG
This commit is contained in:
Steffen Jaeckel 2014-12-14 19:43:50 +01:00
parent 35488c9e84
commit ffb172f403
3 changed files with 37 additions and 36 deletions

View File

@ -5,7 +5,7 @@
#version of library
VERSION=0.42.0
CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare
include makefile.include
# Compiler and Linker Names
ifndef PREFIX
@ -23,22 +23,6 @@ ifndef MAKE
MAKE=make
endif
ifndef IGNORE_SPEED
#for speed
CFLAGS += -O3 -funroll-loops
#for size
#CFLAGS += -Os
#x86 optimizations [should be valid for any GCC install though]
CFLAGS += -fomit-frame-pointer
#debug
#CFLAGS += -g3
endif
#install as this user
ifndef INSTALL_GROUP
GROUP=wheel
@ -59,8 +43,6 @@ endif
default: ${LIBNAME}
HEADERS=tommath.h tommath_class.h tommath_superclass.h
#LIBPATH-The directory for libtommath to be installed to.
#INCPATH-The directory to install the header files for libtommath.
#DATAPATH-The directory to install the pdf docs.

34
makefile.include Normal file
View File

@ -0,0 +1,34 @@
#
# Include makefile for libtommath
#
CFLAGS += -I./ -Wall -Wsign-compare -Wextra -Wshadow
ifndef NO_ADDTL_WARNINGS
# additional warnings
CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align
CFLAGS += -Wstrict-prototypes -Wpointer-arith
endif
ifndef IGNORE_SPEED
#for speed
CFLAGS += -O3 -funroll-loops
#x86 optimizations [should be valid for any GCC install though]
CFLAGS += -fomit-frame-pointer
endif
ifdef COMPILE_SIZE
#for size
CFLAGS += -Os
endif
ifdef COMPILE_DEBUG
#debug
CFLAGS += -g3
endif
HEADERS=tommath.h tommath_class.h tommath_superclass.h

View File

@ -3,24 +3,11 @@
#Tom St Denis
VERSION=0:42
include makefile.include
LT ?= libtool
LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare
ifndef IGNORE_SPEED
#for speed
CFLAGS += -O3 -funroll-loops
#for size
#CFLAGS += -Os
#x86 optimizations [should be valid for any GCC install though]
CFLAGS += -fomit-frame-pointer
endif
#install as this user
ifndef INSTALL_GROUP
GROUP=wheel
@ -79,8 +66,6 @@ bn_s_mp_add.o bn_s_mp_exptmod.o bn_s_mp_mul_digs.o bn_s_mp_mul_high_digs.o bn_s_
#END_INS
HEADERS=tommath.h tommath_class.h tommath_superclass.h
objs: $(OBJECTS)
.c.o: