Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233
  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. test-double: test-double.c libm-test.c
  11. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) [email protected] -D__BSD_VISIBLE -I../include -I../src $(OPENLIBM_LIB) -o $@
  12. test-float: test-float.c libm-test.c
  13. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) [email protected] -D__BSD_VISIBLE -I../include -I../src $(OPENLIBM_LIB) -o $@
  14. test-double-system: test-double.c libm-test.c
  15. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $< -DSYS_MATH_H -lm -o $@
  16. test-float-system: test-float.c libm-test.c
  17. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $< -DSYS_MATH_H -lm -o $@
  18. bench-openlibm: libm-bench.cpp
  19. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $< $(OPENLIBM_LIB) -o $@
  20. bench-syslibm: libm-bench.cpp
  21. $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $< -lm -o $@
  22. clean:
  23. rm -fr test-double test-float test-double-system test-float-system bench-openlibm bench-syslibm *.dSYM