diff options
author | Rob Austein <sra@hactrn.net> | 2016-06-24 17:08:20 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-06-24 17:08:20 -0400 |
commit | 129e802fd4e0ca73f9dbae7968331d055c3a97d1 (patch) | |
tree | 4bfc0592328844886a6a4693b053254f8f893527 /libtfm | |
parent | 8be614f02ddd5772582e375084ad0822524fd888 (diff) |
VPATH build for libpkcs11.so, and first cut at libpkcs11.dylib for Mac OS X.
The Mac OS X build compiles, but is otherwise completely untested, and
won't even be testable until cryptech_rpcd support configuring
high-speed UARTs on Mac OS X (OS-specific voodoo).
Diffstat (limited to 'libtfm')
-rw-r--r-- | libtfm/GNUmakefile | 46 | ||||
-rw-r--r-- | libtfm/tomsfastmath/GNUmakefile | 8 |
2 files changed, 54 insertions, 0 deletions
diff --git a/libtfm/GNUmakefile b/libtfm/GNUmakefile new file mode 100644 index 0000000..df90ddf --- /dev/null +++ b/libtfm/GNUmakefile @@ -0,0 +1,46 @@ + +# This duplicates more of sw/thirdparty/libtfm/GNUmakefile than I +# would like, but it does the job. Prettier makefiles can wait for another day. + +ifndef CRYPTECH_ROOT + CRYPTECH_ROOT := $(abspath ../../..) +endif + +REPO := ${CRYPTECH_ROOT}/sw/thirdparty/libtfm + +# vpath %.c ${REPO} +# vpath %.h ${REPO} + +BITS := 8192 + +HDR := ${REPO}/tomsfastmath/src/headers/tfm.h +LIB := tomsfastmath/libtfm.a + +#CFLAGS += -DTFM_X86 +#CFLAGS += -DTFM_NO_ASM + +CFLAGS += -fPIC -Wall -W -Wshadow -I${REPO}/tomsfastmath/src/headers -g3 -DFP_MAX_SIZE="(${BITS}*2+(8*DIGIT_BIT))" + +TARGETS := $(notdir ${HDR} ${LIB}) + +all: ${TARGETS} + +clean: + rm -rf ${TARGETS} $(notdir ${HDR}.tmp) ${LIB} tomsfastmath/src + +distclean: clean + rm -f TAGS + +$(notdir ${HDR}): ${HDR} + echo >$@.tmp '/* Configure size of largest bignum we want to handle -- see notes in tfm.pdf */' + echo >>$@.tmp '#define FP_MAX_SIZE (${BITS}*2+(8*DIGIT_BIT))' + echo >>$@.tmp '' + cat >>$@.tmp $^ + mv -f $@.tmp $@ + +$(notdir ${LIB}): ${LIB} + ln -f $^ $@ + +${LIB}: ${HDR} + (cd ${REPO} && find tomsfastmath/src -type d) | xargs mkdir -p + cd tomsfastmath; ${MAKE} CFLAGS='${CFLAGS}' diff --git a/libtfm/tomsfastmath/GNUmakefile b/libtfm/tomsfastmath/GNUmakefile new file mode 100644 index 0000000..ea0a524 --- /dev/null +++ b/libtfm/tomsfastmath/GNUmakefile @@ -0,0 +1,8 @@ +ifndef CRYPTECH_ROOT + CRYPTECH_ROOT := $(abspath ../../../..) +endif + +vpath %.c ${CRYPTECH_ROOT}/sw/thirdparty/libtfm/tomsfastmath +vpath %.h ${CRYPTECH_ROOT}/sw/thirdparty/libtfm/tomsfastmath + +include ${CRYPTECH_ROOT}/sw/thirdparty/libtfm/tomsfastmath/makefile |