Makefile.am 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
  2. AUTOMAKE_OPTIONS = subdir-objects
  3. @SET_MAKE@
  4. include MakeVariables.in
  5. # DOXYGEN SUPPORT
  6. include aminclude.am
  7. INSTALL_DIR = $(DESTDIR)$(datadir)/$(PACKAGE)
  8. EX_DIR = ./examples
  9. RESULT_DIR = ./result
  10. # the subdirectories of the project to go into
  11. #SUBDIRS =
  12. DIST_SUBDIRS= \
  13. doc/doc
  14. EXTRA_DIST = \
  15. $(EX_DIR)/src \
  16. $(EX_DIR)/include \
  17. $(EX_DIR)/Makefile \
  18. $(EX_DIR)/scripts \
  19. $(DX_CONFIG) \
  20. scripts
  21. # additional include pathes necessary to compile the C++ library
  22. AM_CXXFLAGS = $(CXXFLAGS_PVFMM)
  23. AM_LDFLAGS = -static $(LDFLAGS_PVFMM)
  24. ###############################################################################
  25. # THE LIBRARIES TO BUILD
  26. ###############################################################################
  27. # the library names to build (note we are building static libs only)
  28. pkglib_LIBRARIES = lib/libpvfmm.a
  29. # where to install the headers on the system
  30. lib_libfmm_adir = $(pkgincludedir)
  31. # the list of header files that belong to the library (to be installed later)
  32. lib_libfmm_a_HEADERS = \
  33. include/pvfmm_config.h \
  34. include/pvfmm_common.hpp \
  35. include/pvfmm.hpp \
  36. include/blas.h \
  37. include/cheb_node.hpp \
  38. include/cheb_utils.hpp \
  39. include/device_wrapper.hpp \
  40. include/dtypes.h \
  41. include/fft_wrapper.hpp \
  42. include/fmm_cheb.hpp \
  43. include/fmm_gll.hpp \
  44. include/fmm_node.hpp \
  45. include/fmm_pts.hpp \
  46. include/fmm_tree.hpp \
  47. include/interac_list.hpp \
  48. include/kernel.hpp \
  49. include/lapack.h \
  50. include/legendre_rule.hpp \
  51. include/matrix.hpp \
  52. include/mat_utils.hpp \
  53. include/mem_utils.hpp \
  54. include/mortonid.hpp \
  55. include/mpi_node.hpp \
  56. include/mpi_tree.hpp \
  57. include/ompUtils.h \
  58. include/parUtils.h \
  59. include/precomp_mat.hpp \
  60. include/profile.hpp \
  61. include/tree.hpp \
  62. include/tree_node.hpp \
  63. include/vector.hpp \
  64. include/cheb_node.txx \
  65. include/cheb_utils.txx \
  66. include/device_wrapper.txx \
  67. include/fmm_cheb.txx \
  68. include/fmm_node.txx \
  69. include/fmm_pts.txx \
  70. include/fmm_tree.txx \
  71. include/interac_list.txx \
  72. include/kernel.txx \
  73. include/matrix.txx \
  74. include/mat_utils.txx \
  75. include/mem_utils.txx \
  76. include/mortonid.txx \
  77. include/mpi_node.txx \
  78. include/mpi_tree.txx \
  79. include/ompUtils.txx \
  80. include/parUtils.txx \
  81. include/precomp_mat.txx \
  82. include/tree.txx \
  83. include/vector.txx \
  84. include/cuda_func.hpp
  85. #nodist_lib_libpvfmm_a_HEADERS = \
  86. # include/pvfmm_config.h
  87. # the sources to add to the library and to add to the source distribution
  88. lib_libpvfmm_a_SOURCES = \
  89. $(lib_libpvfmm_a_HEADERS) \
  90. src/fmm_gll.cpp \
  91. src/legendre_rule.cpp \
  92. src/mortonid.cpp \
  93. src/profile.cpp \
  94. src/tree_node.cpp
  95. if NVCC_OK
  96. lib_libpvfmm_a_SOURCES = \
  97. $(lib_libpvfmm_a_HEADERS) \
  98. src/cuda_func.cu
  99. endif
  100. dist_noinst_SCRIPTS = autogen.sh
  101. core: $(pkglib_LIBRARIES)
  102. all: #all-docs all-examples
  103. ###############################################################################
  104. # COMPILE .cu FILES
  105. #------------------------------------------------------------------------------
  106. if NVCC_OK
  107. .cu.o :
  108. $(NVCC) $(NVCCFLAGS) ${INCLUDE_PVFMM} -c $< -o $@
  109. endif
  110. ###############################################################################
  111. # BUILD EXAMPLES
  112. #------------------------------------------------------------------------------
  113. all-examples: core
  114. cd $(EX_DIR) && $(MAKE);
  115. $(EX_DIR)/bin/%: core
  116. cd $(EX_DIR) && $(MAKE) bin/$(notdir $@)
  117. ###############################################################################
  118. # BUILD DOCUMENTATION
  119. #------------------------------------------------------------------------------
  120. pdf-doc:
  121. cd doc/doc && $(MAKE);
  122. all-docs: doxygen-doc pdf-doc
  123. ###############################################################################
  124. # INSTALL/UNINSTALL MakeVariables, pvfmm_config.h
  125. #------------------------------------------------------------------------------
  126. install-make-variables:
  127. $(MKDIR_P) $(INSTALL_DIR)
  128. sed -e 's/(TOP_SRCDIR_PVFMM)/(INSTALL_DIR_PVFMM)/' \
  129. -e "s/PKG_SUBDIR_PVFMM =/PKG_SUBDIR_PVFMM = \/$(PACKAGE)/" \
  130. MakeVariables > $(INSTALL_DIR)/MakeVariables
  131. uninstall-make-variables:
  132. $(RM) $(INSTALL_DIR)/MakeVariables
  133. ###############################################################################
  134. # INSTALL/UNINSTALL DOCS
  135. #------------------------------------------------------------------------------
  136. if DOXYGEN_OK
  137. install-doxygen-doc: doxygen-doc
  138. for doxygen_dir in $(srcdir)/doc/doxygen/*/ ; do \
  139. doxygen_dir=$${doxygen_dir%*/}; \
  140. dest_dir=$(INSTALL_DIR)/doc/$${doxygen_dir##*/}; \
  141. $(MKDIR_P) $${dest_dir}; \
  142. $(INSTALL_DATA) $${doxygen_dir}/* $${dest_dir}; done;
  143. uninstall-doxygen-doc:
  144. $(RM) -r $(INSTALL_DIR)/doc/*
  145. $(RM) -r $(INSTALL_DIR)/doc
  146. else
  147. install-doxygen-doc:
  148. uninstall-doxygen-doc:
  149. endif
  150. ###############################################################################
  151. # LOCAL INSTALL/UNINSTALL
  152. #------------------------------------------------------------------------------
  153. install: install-am
  154. @echo
  155. @echo '======================================================================='
  156. @echo 'You should add the following to your ~/.bashrc'
  157. @echo ' export PVFMM_DIR=$(INSTALL_DIR)'
  158. @echo
  159. @echo 'You will need to load $$(PVFMM_DIR)/MakeVariables in your Makefile and'
  160. @echo 'use the variables CXXFLAGS_PVFMM and LDFLAGS_PVFMM for compiling your code.'
  161. @echo '======================================================================='
  162. install-data-local: install-make-variables install-doxygen-doc
  163. cd doc/doc && $(MAKE) install;
  164. uninstall-local: uninstall-make-variables uninstall-doxygen-doc
  165. cd doc/doc && $(MAKE) uninstall;
  166. ###############################################################################
  167. # LOCAL CLEAN
  168. #------------------------------------------------------------------------------
  169. clean-doxygen:
  170. $(RM) -r $(DX_CLEANFILES)
  171. clean-local: clean-doxygen
  172. cd $(EX_DIR) && $(MAKE) clean;
  173. $(RM) -r $(RESULT_DIR)/*
  174. $(RM) *~ */*~ */*/*~
  175. #------------------------------------------------------------------------------