⛏️ index : haiku.git

SubDir HAIKU_TOP src system libroot posix musl math arm64 ;

# std=c11 so __FLT_EVAL_METHOD__ is 0 and not 16:
# https://gcc.gnu.org/bugzilla//show_bug.cgi?id=100854
SubDirCcFlags -Wno-unused-but-set-variable -std=c11 ;

SubDirSysHdrs [ FDirName $(SUBDIR) .. .. include ] ;
UseHeaders [ FDirName $(SUBDIR) .. .. internal ] ;
UseHeaders [ FDirName $(SUBDIR) .. .. arch generic ] ;

local generics =
	acos.c acosf.c acosl.c
	acosh.c acoshf.c acoshl.c
	asin.c asinf.c asinl.c
	asinh.c asinhf.c asinhl.c
	atan2.c atan2f.c atan2l.c
	atan.c atanf.c atanl.c
	atanh.c atanhf.c atanhl.c
	cbrt.c cbrtf.c cbrtl.c
	ceill.c
	copysign.c copysignf.c copysignl.c
	cos.c cosf.c cosl.c __cosl.c __cos.c __cosdf.c
	cosh.c coshf.c coshl.c
	erf.c erff.c erfl.c
	exp10.c exp10f.c exp10l.c
	exp2.c exp2f.c exp2f_data.c exp2l.c
	exp.c exp_data.c expf.c expl.c
	expm1.c	expm1f.c expm1l.c
	__expo2.c __expo2f.c
	fabsl.c
	fdim.c fdimf.c fdiml.c
	finite.c finitef.c
	floorl.c
	fmal.c
	fmaxl.c
	fminl.c
	fmod.c fmodf.c fmodl.c
	__fpclassify.c __fpclassifyf.c __fpclassifyl.c
	frexp.c frexpf.c frexpl.c
	hypot.c hypotf.c hypotl.c
	ilogb.c ilogbf.c ilogbl.c
	__invtrigl.c
	j0.c j0f.c j1.c j1f.c jn.c jnf.c
	ldexp.c ldexpf.c ldexpl.c
	lgamma.c lgammaf.c lgammaf_r.c lgammal.c lgamma_r.c
	llrintl.c
	llroundl.c
	log10.c log10f.c log10l.c
	log1p.c log1pf.c log1pl.c
	log2.c log2_data.c log2f.c log2f_data.c log2l.c
	logb.c logbf.c logbl.c
	log.c log_data.c logf.c logf_data.c logl.c
	lrintl.c
	lroundl.c
	__math_divzero.c __math_divzerof.c __math_invalid.c __math_invalidf.c
	__math_oflow.c __math_oflowf.c __math_uflow.c __math_uflowf.c
	__math_xflow.c __math_xflowf.c
	modf.c modff.c modfl.c
	nan.c nanf.c nanl.c
	nearbyintl.c
	nextafter.c nextafterf.c nextafterl.c
	nexttoward.c nexttowardf.c nexttowardl.c
	__polevll.c pow.c pow_data.c powf.c powf_data.c powl.c
	remainder.c remainderf.c remainderl.c
	__rem_pio2.c __rem_pio2f.c __rem_pio2_large.c __rem_pio2l.c
	remquo.c remquof.c remquol.c
	rintl.c
	roundl.c
	scalb.c scalbf.c scalbln.c scalblnf.c scalblnl.c scalbn.c scalbnf.c scalbnl.c
	signgam.c
	significand.c significandf.c
	__sin.c sin.c __sinl.c sinl.c
	sincos.c sincosf.c sincosl.c
	__sindf.c sinf.c
	sinh.c sinhf.c sinhl.c
	sqrtl.c
	__tan.c tan.c __tandf.c tanf.c  __tanl.c tanl.c
	tanh.c tanhf.c tanhl.c
	tgamma.c tgammaf.c tgammal.c
	truncl.c
	;

local architectureObject ;
for architectureObject in [ MultiArchSubDirSetup arm64 ] {
	on $(architectureObject) {
		local architecture = $(TARGET_PACKAGING_ARCH) ;

		UseHeaders [ FDirName $(SUBDIR) .. .. arch $(architecture) ] ;

		MergeObject <$(architecture)>posix_musl_math.o :
			ceil.c ceilf.c
			fabs.c fabsf.c
			floor.c floorf.c
			fma.c fmaf.c
			fmax.c fmaxf.c
			fmin.c fminf.c
			llrint.c llrintf.c
			llround.c llroundf.c
			lrint.c lrintf.c
			lround.c lroundf.c
			nearbyint.c nearbyintf.c
			rint.c rintf.c
			round.c roundf.c
			sqrt.c sqrtf.c
			trunc.c truncf.c

			$(generics)
			;

		SEARCH on [ FGristFiles $(generics) ] = [ FDirName $(SUBDIR) .. ] ;
	}
}