2012-07-02 04:19:00 +02:00
|
|
|
OPENLIBM_HOME=$(abspath ..)
|
|
|
|
include ../Make.inc
|
|
|
|
|
2015-11-12 20:56:08 +01:00
|
|
|
# Set rpath of tests to builddir for loading shared library
|
2015-11-13 04:46:51 +01:00
|
|
|
OPENLIBM_LIB = -L.. -lopenlibm
|
2017-09-06 20:08:25 +02:00
|
|
|
ifneq (,$(findstring $(OS),Linux FreeBSD))
|
2015-11-13 04:46:51 +01:00
|
|
|
OPENLIBM_LIB += -Wl,-rpath=$(OPENLIBM_HOME)
|
|
|
|
endif
|
2015-11-12 20:56:08 +01:00
|
|
|
|
2012-08-19 13:33:16 +02:00
|
|
|
all: test-double test-float # test-double-system test-float-system
|
2012-07-02 04:19:00 +02:00
|
|
|
|
2014-12-04 16:57:19 +01:00
|
|
|
bench: bench-syslibm bench-openlibm
|
|
|
|
|
2016-04-25 09:32:33 +02:00
|
|
|
test-double: test-double.c libm-test.c libm-test-ulps.h
|
2017-01-15 22:21:46 +01:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_arch) $(LDFLAGS) $(LDFLAGS_arch) $@.c -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
|
2012-07-02 04:19:00 +02:00
|
|
|
|
2016-04-25 09:32:33 +02:00
|
|
|
test-float: test-float.c libm-test.c libm-test-ulps.h
|
2017-01-15 22:21:46 +01:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_arch) $(LDFLAGS) $(LDFLAGS_arch) $@.c -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
|
2012-07-02 04:39:04 +02:00
|
|
|
|
2016-04-25 09:32:33 +02:00
|
|
|
test-double-system: test-double.c libm-test.c libm-test-ulps.h
|
2017-01-15 22:21:46 +01:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_arch) $(LDFLAGS) $(LDFLAGS_arch) $< -DSYS_MATH_H -lm -o $@
|
2012-07-02 04:39:04 +02:00
|
|
|
|
2016-04-25 09:32:33 +02:00
|
|
|
test-float-system: test-float.c libm-test.c libm-test-ulps.h
|
2017-01-15 22:21:46 +01:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_arch) $(LDFLAGS) $(LDFLAGS_arch) $< -DSYS_MATH_H -lm -o $@
|
2014-12-04 16:57:19 +01:00
|
|
|
|
|
|
|
bench-openlibm: libm-bench.cpp
|
2017-01-15 22:21:46 +01:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_arch) $(LDFLAGS) $(LDFLAGS_arch) $< $(OPENLIBM_LIB) -o $@
|
2014-12-04 16:57:19 +01:00
|
|
|
|
|
|
|
bench-syslibm: libm-bench.cpp
|
2017-01-15 22:21:46 +01:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_arch) $(LDFLAGS) $(LDFLAGS_arch) $< -lm -o $@
|
2014-12-04 16:57:19 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -fr test-double test-float test-double-system test-float-system bench-openlibm bench-syslibm *.dSYM
|