Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. ifeq ($(OS),Linux)
  6. OPENLIBM_LIB += -Wl,-rpath=$(OPENLIBM_HOME)
  7. endif
  8. all: test-double test-float # test-double-system test-float-system
  9. bench: bench-syslibm bench-openlibm
  10. ifeq ($(USECLANG),1)
  11. CPPFLAGS += -DUSECLANG=1
  12. endif
  13. test-double: test-double.c libm-test.c libm-test-ulps.h
  14. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $@.c -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
  15. test-float: test-float.c libm-test.c libm-test-ulps.h
  16. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $@.c -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
  17. test-double-system: test-double.c libm-test.c libm-test-ulps.h
  18. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $< -DSYS_MATH_H -lm -o $@
  19. test-float-system: test-float.c libm-test.c libm-test-ulps.h
  20. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $< -DSYS_MATH_H -lm -o $@
  21. bench-openlibm: libm-bench.cpp
  22. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $< $(OPENLIBM_LIB) -o $@
  23. bench-syslibm: libm-bench.cpp
  24. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $< -lm -o $@
  25. clean:
  26. rm -fr test-double test-float test-double-system test-float-system bench-openlibm bench-syslibm *.dSYM