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