You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile.install 3.8 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. TOPDIR = .
  2. export GOTOBLAS_MAKEFILE = 1
  3. -include $(TOPDIR)/Makefile.conf_last
  4. include ./Makefile.system
  5. PREFIX ?= /opt/OpenBLAS
  6. OPENBLAS_INCLUDE_DIR := $(PREFIX)/include
  7. OPENBLAS_LIBRARY_DIR := $(PREFIX)/lib
  8. OPENBLAS_BUILD_DIR := $(CURDIR)
  9. .PHONY : install
  10. .NOTPARALLEL : install
  11. lib.grd :
  12. $(error OpenBLAS: Please run "make" firstly)
  13. install : lib.grd
  14. @-mkdir -p $(DESTDIR)$(PREFIX)
  15. @-mkdir -p $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)
  16. @-mkdir -p $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
  17. @echo Generating openblas_config.h in $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)
  18. #for inc
  19. @echo \#ifndef OPENBLAS_CONFIG_H > $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/openblas_config.h
  20. @echo \#define OPENBLAS_CONFIG_H >> $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/openblas_config.h
  21. @awk 'NF {print $$1, "OPENBLAS_"$$2, $$3}' config_last.h >> $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/openblas_config.h
  22. @echo \#define OPENBLAS_VERSION \" OpenBLAS $(VERSION) \" >> $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/openblas_config.h
  23. @cat openblas_config_template.h >> $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/openblas_config.h
  24. @echo \#endif \/\* OPENBLAS_CONFIG_H \*\/ >> $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/openblas_config.h
  25. @echo Generating f77blas.h in $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)
  26. @echo \#ifndef OPENBLAS_F77BLAS_H > $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/f77blas.h
  27. @echo \#define OPENBLAS_F77BLAS_H >> $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/f77blas.h
  28. @echo \#include \"openblas_config.h\" >> $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/f77blas.h
  29. @cat common_interface.h >> $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/f77blas.h
  30. @echo \#endif >> $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/f77blas.h
  31. ifndef NO_CBLAS
  32. @echo Generating cblas.h in $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)
  33. @sed 's/common/openblas_config/g' cblas.h > $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/cblas.h
  34. endif
  35. ifndef NO_LAPACKE
  36. @echo Copying LAPACKE header files to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
  37. @-install -pDm644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke.h
  38. @-install -pDm644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_config.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke_config.h
  39. @-install -pDm644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_mangling_with_flags.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke_mangling.h
  40. @-install -pDm644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_utils.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke_utils.h
  41. endif
  42. #for install static library
  43. @echo Copying the static library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
  44. @install -pm644 $(LIBNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
  45. @cd $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) ; \
  46. ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
  47. #for install shared library
  48. ifndef NO_SHARED
  49. @echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
  50. ifeq ($(OSNAME), Linux)
  51. @install -pm755 $(LIBSONAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
  52. @cd $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) ; \
  53. ln -fs $(LIBSONAME) $(LIBPREFIX).so ; \
  54. ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
  55. endif
  56. ifeq ($(OSNAME), FreeBSD)
  57. @cp $(LIBSONAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
  58. @cd $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) ; \
  59. ln -fs $(LIBSONAME) $(LIBPREFIX).so
  60. endif
  61. ifeq ($(OSNAME), NetBSD)
  62. @cp $(LIBSONAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
  63. @cd $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) ; \
  64. ln -fs $(LIBSONAME) $(LIBPREFIX).so
  65. endif
  66. ifeq ($(OSNAME), Darwin)
  67. @-cp $(LIBDYNNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
  68. @-install_name_tool -id $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME)
  69. @-ln -fs $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).dylib
  70. endif
  71. ifeq ($(OSNAME), WINNT)
  72. @-cp $(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)
  73. endif
  74. ifeq ($(OSNAME), CYGWIN_NT)
  75. @-cp $(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)
  76. endif
  77. endif
  78. @echo Install OK!