Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. OPENLIBM_HOME=$(abspath ..)
  2. include ../Make.inc
  3. # Set rpath of tests to builddir for loading shared library
  4. OPENLIBM_LIB = -L.. -lopenlibm
  5. ifneq ($(OS),WINNT)
  6. ifneq ($(OS),Darwin)
  7. OPENLIBM_LIB += -Wl,-rpath=$(OPENLIBM_HOME)
  8. endif
  9. endif
  10. all: test-double test-float # test-double-system test-float-system
  11. bench: bench-syslibm bench-openlibm
  12. test-double: test-double.c libm-test.c libm-test-ulps.h
  13. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) $(LDFLAGS) $(LDFLAGS_arch) [email protected] -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
  14. test-float: test-float.c libm-test.c libm-test-ulps.h
  15. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) $(LDFLAGS) $(LDFLAGS_arch) [email protected] -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
  16. test-double-system: test-double.c libm-test.c libm-test-ulps.h
  17. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) $(LDFLAGS) $(LDFLAGS_arch) $< -DSYS_MATH_H -lm -o $@
  18. test-float-system: test-float.c libm-test.c libm-test-ulps.h
  19. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) $(LDFLAGS) $(LDFLAGS_arch) $< -DSYS_MATH_H -lm -o $@
  20. bench-openlibm: libm-bench.cpp
  21. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) $(LDFLAGS) $(LDFLAGS_arch) $< $(OPENLIBM_LIB) -o $@
  22. bench-syslibm: libm-bench.cpp
  23. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) $(LDFLAGS) $(LDFLAGS_arch) $< -lm -o $@
  24. clean:
  25. rm -fr test-double test-float test-double-system test-float-system bench-openlibm bench-syslibm *.dSYM