aboutsummaryrefslogtreecommitdiff
path: root/libraries/libtfm/Makefile
blob: 6da552d84766c9aea811df665b3712b13acfb598 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.Prepro
# This duplicates more of sw/thirdparty/libtfm/Makefile than I
# would like, but it does the job.  Prettier makefiles can wait for another day.

# vpath %.c ${LIBTFM_SRC}
# vpath %.h ${LIBTFM_SRC}

BITS := 8192

HDR  := ${LIBTFM_SRC}/tomsfastmath/src/headers/tfm.h
LIB  := tomsfastmath/libtfm.a

#CFLAGS	+= -DTFM_X86
#CFLAGS	+= -DTFM_NO_ASM

CFLAGS	+= -fPIC -Wall -W -Wshadow -I${LIBTFM_SRC}/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 ${LIBTFM_SRC} && find tomsfastmath/src -type d) | xargs mkdir -p
	cd tomsfastmath; ${MAKE} CFLAGS='${CFLAGS}'