openlibm/test/Makefile
jeremyd2019 60dec83e33
msys2 ci (#243)
* add msys2 ci job

* run CI on any branch

* install base-devel on msys2

* remove soname and nodefaultlibs flags from mingw

* avoid soname on Windows

* add OLM_DLLEXPORT to signgam

it needs to be exported from the DLL also

* define IMPORT_EXPORTS on WINNT

While there are function export thunks in the import library that allow the linker to do the right thing for functions even if this is not set, it is required for the linker to do the right thing with variables being imported from a DLL (namely, signgam)

* add OLM_DLLEXPORT to openlibm_fenv_i387.h

seems this whole header was overlooked

* Update openlibm_fenv_i387.h

include openlibm_defs.h for OLM_DLLEXPORT
2021-09-09 18:49:37 -04:00

38 lines
1.4 KiB
Makefile

OPENLIBM_HOME=$(abspath ..)
include ../Make.inc
# Set rpath of tests to builddir for loading shared library
OPENLIBM_LIB = -L.. -lopenlibm
ifneq ($(OS),WINNT)
ifneq ($(OS),Darwin)
OPENLIBM_LIB += -Wl,-rpath=$(OPENLIBM_HOME)
endif
else # WINNT
CFLAGS_add += -DIMPORT_EXPORTS
endif
all: test-double test-float # test-double-system test-float-system
bench: bench-syslibm bench-openlibm
test-double: test-double.c libm-test.c libm-test-ulps.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) $(LDFLAGS) $(LDFLAGS_arch) $@.c -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
test-float: test-float.c libm-test.c libm-test-ulps.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) $(LDFLAGS) $(LDFLAGS_arch) $@.c -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
test-double-system: test-double.c libm-test.c libm-test-ulps.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) $(LDFLAGS) $(LDFLAGS_arch) $< -DSYS_MATH_H -lm -o $@
test-float-system: test-float.c libm-test.c libm-test-ulps.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) $(LDFLAGS) $(LDFLAGS_arch) $< -DSYS_MATH_H -lm -o $@
bench-openlibm: libm-bench.cpp
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) $(LDFLAGS) $(LDFLAGS_arch) $< $(OPENLIBM_LIB) -o $@
bench-syslibm: libm-bench.cpp
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) $(LDFLAGS) $(LDFLAGS_arch) $< -lm -o $@
clean:
rm -fr test-double test-float test-double-system test-float-system bench-openlibm bench-syslibm *.dSYM