Advertisement
Guest User

Untitled

a guest
Apr 6th, 2018
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.01 KB | None | 0 0
  1. # Copyright (c) 2012-2018 DreamWorks Animation LLC
  2. #
  3. # All rights reserved. This software is distributed under the
  4. # Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
  5. #
  6. # Redistributions of source code must retain the above copyright
  7. # and license notice and the following restrictions and disclaimer.
  8. #
  9. # * Neither the name of DreamWorks Animation nor the names of
  10. # its contributors may be used to endorse or promote products derived
  11. # from this software without specific prior written permission.
  12. #
  13. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  14. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  16. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  17. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
  18. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  19. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  20. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  21. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  23. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. # IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
  25. # LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
  26. #
  27. # Makefile for the OpenVDB library
  28.  
  29. # See INSTALL for a list of requirements.
  30. #
  31. # Targets:
  32. # lib the OpenVDB library
  33. #
  34. # doc HTML documentation (doc/html/index.html)
  35. # pdfdoc PDF documentation (doc/latex/refman.pdf;
  36. # requires LaTeX and ghostscript)
  37. # python OpenVDB Python module
  38. # pytest unit tests for the Python module
  39. # pydoc HTML documentation for the Python module
  40. # (doc/html/python/index.html)
  41. # vdb_lod command-line tool to generate volume mipmaps
  42. # vdb_print command-line tool to inspect OpenVDB files
  43. # vdb_render command-line tool to ray-trace OpenVDB files
  44. # vdb_view command-line tool to view OpenVDB files
  45. # vdb_test unit tests for the OpenVDB library
  46. #
  47. # all [default target] all of the above
  48. # install install all of the above except vdb_test
  49. # into subdirectories of DESTDIR
  50. # install_lib install just the OpenVDB library and its headers
  51. # into subdirectories of DESTDIR
  52. # depend recompute source file header dependencies
  53. # header_test check for missing or indirectly included headers
  54. # clean delete generated files from the local directory
  55. # test run tests
  56. #
  57. # Options:
  58. # abi=N build for compatibility with version N of the
  59. # OpenVDB Grid ABI, where N is 2, 3, 4, etc.
  60. # (some newer features will be disabled)
  61. # shared=no link executables against static OpenVDB libraries
  62. # (default: link against shared libraries)
  63. # debug=yes build with debugging symbols and without optimization
  64. # verbose=yes run commands (e.g., doxygen) in verbose mode
  65.  
  66.  
  67. #
  68. # The following variables must be defined, either here or on the command line
  69. # (e.g., "make install DESTDIR=/usr/local"):
  70. #
  71. # Note that if you plan to build the Houdini OpenVDB tools (distributed
  72. # separately), you must build the OpenVDB library and the Houdini tools
  73. # against compatible versions of the Boost, OpenEXR and TBB libraries.
  74. # Until Houdini 16.5, all three were included in the HDK, so the relevant
  75. # variables below point by default to the HDK library and header directories:
  76. # $(HDSO) and $(HT)/include, respectively. (Source the houdini_setup script
  77. # to set those two environment variables.) Beginning with Houdini 16.5,
  78. # you must provide your own distribution of Boost.
  79. #
  80. # To build the OpenVDB Python module, you will need local distributions of
  81. # Python, Boost.Python, and optionally NumPy. The Houdini HDK includes
  82. # Python 2.x, but not the libboost_python library or NumPy or, as of
  83. # Houdini 16.5, the Boost.Python headers, so both Boost.Python and NumPy
  84. # have to be built separately. Point the variables $(BOOST_PYTHON_LIB_DIR),
  85. # $(BOOST_PYTHON_LIB) and $(NUMPY_INCL_DIR) below to your local distributions
  86. # of those libraries.
  87. #
  88.  
  89. shared=no
  90.  
  91. # The directory into which to install libraries, executables and header files
  92. DESTDIR := /opt/OpenVDB
  93.  
  94. # The directory into which to install libraries (e.g., for Linux multiarch support)
  95. DESTDIR_LIB_DIR := $(DESTDIR)/lib
  96.  
  97. # The parent directory of the boost/ header directory
  98. BOOST_INCL_DIR := /usr/include
  99. # The directory containing libboost_iostreams, libboost_system, etc.
  100. BOOST_LIB_DIR := /usr/lib/x86_64-linux-gnu/
  101. BOOST_LIB := -lboost_iostreams -lboost_system
  102. BOOST_THREAD_LIB := -lboost_thread
  103.  
  104. # The parent directory of the OpenEXR/ header directory
  105. EXR_INCL_DIR := $(HT)/include
  106. # The directory containing IlmImf
  107. EXR_LIB_DIR := $(HDSO)
  108. EXR_LIB := -lIlmImf
  109.  
  110. # The parent directory of the OpenEXR/ header directory (which contains half.h)
  111. ILMBASE_INCL_DIR := /usr/include/OpenEXR/
  112. # The directory containing libIlmThread, libIlmThread, libHalf etc.
  113. ILMBASE_LIB_DIR := /usr/lib/x86_64-linux-gnu/
  114. ILMBASE_LIB := -lIlmThread -lIex -lImath
  115. HALF_LIB := -lHalf
  116.  
  117. # The parent directory of the tbb/ header directory
  118. TBB_INCL_DIR := /usr/include
  119. # The directory containing libtbb
  120. TBB_LIB_DIR := /usr/lib/x86_64-linux-gnu/
  121. TBB_LIB := -ltbb
  122.  
  123. # The parent directory of the blosc.h header
  124. # (leave blank if Blosc is unavailable)
  125. BLOSC_INCL_DIR := $(HT)/include
  126. # The directory containing libblosc
  127. BLOSC_LIB_DIR := $(HDSO)
  128. BLOSC_LIB := -lblosc
  129.  
  130. # A scalable, concurrent malloc replacement library
  131. # such as jemalloc (included in the Houdini HDK) or TBB malloc
  132. # (leave blank if unavailable)
  133. CONCURRENT_MALLOC_LIB := -ljemalloc
  134. #CONCURRENT_MALLOC_LIB := -ltbbmalloc_proxy -ltbbmalloc
  135. # The directory containing the malloc replacement library
  136. CONCURRENT_MALLOC_LIB_DIR := /usr/lib/x86_64-linux-gnu
  137.  
  138. # The parent directory of the cppunit/ header directory
  139. # (leave blank if CppUnit is unavailable)
  140. CPPUNIT_INCL_DIR := /usr/include
  141. # The directory containing libcppunit
  142. CPPUNIT_LIB_DIR := /usr/lib/x86_64-linux-gnu
  143. CPPUNIT_LIB := -lcppunit
  144.  
  145. # The parent directory of the log4cplus/ header directory
  146. # (leave blank if log4cplus is unavailable)
  147. LOG4CPLUS_INCL_DIR := /usr/include
  148. # The directory containing liblog4cplus
  149. LOG4CPLUS_LIB_DIR := /usr/lib
  150. LOG4CPLUS_LIB := -llog4cplus
  151.  
  152. # The directory containing glfw.h
  153. # (leave blank if GLFW is unavailable)
  154. GLFW_INCL_DIR := /usr/include
  155. # The directory containing libglfw
  156. GLFW_LIB_DIR := /usr/lib
  157. GLFW_LIB := -lglfw
  158. # The major version number of the GLFW library
  159. # (header filenames changed between GLFW 2 and 3, so this must be specified explicitly)
  160. GLFW_MAJOR_VERSION := 3
  161.  
  162. # The version of Python for which to build the OpenVDB module
  163. # (leave blank if Python is unavailable)
  164. PYTHON_VERSION := 3
  165. # The directory containing Python.h
  166. #PYTHON_INCL_DIR := $(HFS)/python/include/python$(PYTHON_VERSION)
  167. PYTHON_INCL_DIR := /usr/include/python3.5m/
  168. # The directory containing pyconfig.h
  169. PYCONFIG_INCL_DIR := $(PYTHON_INCL_DIR)
  170. # The directory containing libpython
  171. PYTHON_LIB_DIR := /usr/lib/python3.5/
  172. PYTHON_LIB := -lpython3.5m
  173. # The directory containing libboost_python
  174. BOOST_PYTHON_LIB_DIR := /usr/lib/x86_64-linux-gnu
  175. #BOOST_PYTHON_LIB := -lboost_python
  176. BOOST_PYTHON_LIB := -lboost_python-py35
  177.  
  178. # The directory containing arrayobject.h
  179. # (leave blank if NumPy is unavailable)
  180. NUMPY_INCL_DIR := /usr/lib/python$(PYTHON_VERSION)/dist-packages/numpy/core/include/numpy
  181. # The Epydoc executable
  182. # (leave blank if Epydoc is unavailable)
  183. EPYDOC := #/rel/map/generic_default-2014.24.237/bin/epydoc
  184. # Set PYTHON_WRAP_ALL_GRID_TYPES to "yes" to specify that the Python module
  185. # should expose (almost) all of the grid types defined in openvdb.h
  186. # Otherwise, only FloatGrid, BoolGrid and Vec3SGrid will be exposed
  187. # (see, e.g., exportIntGrid() in python/pyIntGrid.cc).
  188. # Compiling the Python module with PYTHON_WRAP_ALL_GRID_TYPES set to "yes"
  189. # can be very memory-intensive.
  190. PYTHON_WRAP_ALL_GRID_TYPES := no
  191.  
  192. # The Doxygen executable
  193. # (leave blank if Doxygen is unavailable)
  194. DOXYGEN := doxygen
  195.  
  196.  
  197. #
  198. # Ideally, users shouldn't need to change anything below this line.
  199. #
  200.  
  201. SHELL = /bin/bash
  202.  
  203. # Turn off implicit rules for speed.
  204. .SUFFIXES:
  205.  
  206. ifneq (,$(INSTALL_DIR))
  207. $(warning Warning: $$(INSTALL_DIR) is no longer used; set $$(DESTDIR) instead.)
  208. endif
  209.  
  210. # Determine the platform.
  211. ifeq ("$(OS)","Windows_NT")
  212. WINDOWS_NT := 1
  213. else
  214. UNAME_S := $(shell uname -s)
  215. ifeq ("$(UNAME_S)","Linux")
  216. LINUX := 1
  217. else
  218. ifeq ("$(UNAME_S)","Darwin")
  219. MBSD := 1
  220. endif
  221. endif
  222. endif
  223.  
  224. ifeq (yes,$(strip $(debug)))
  225. OPTIMIZE := -g
  226. else
  227. OPTIMIZE := -O3 -DNDEBUG
  228. endif
  229.  
  230. ifeq (yes,$(strip $(verbose)))
  231. QUIET :=
  232. QUIET_TEST := -v
  233. else
  234. QUIET := > /dev/null
  235. QUIET_TEST := $(QUIET)
  236. endif
  237.  
  238. has_blosc := no
  239. ifneq (,$(and $(BLOSC_LIB_DIR),$(BLOSC_INCL_DIR),$(BLOSC_LIB)))
  240. has_blosc := yes
  241. endif
  242.  
  243. has_cppunit := no
  244. ifneq (,$(and $(CPPUNIT_INCL_DIR),$(CPPUNIT_LIB_DIR),$(CPPUNIT_LIB)))
  245. has_cppunit := yes
  246. endif
  247.  
  248. has_glfw := no
  249. ifneq (,$(and $(GLFW_LIB_DIR),$(GLFW_INCL_DIR),$(GLFW_LIB)))
  250. has_glfw := yes
  251. endif
  252.  
  253. has_log4cplus := no
  254. ifneq (,$(and $(LOG4CPLUS_LIB_DIR),$(LOG4CPLUS_INCL_DIR),$(LOG4CPLUS_LIB)))
  255. has_log4cplus := yes
  256. endif
  257.  
  258. has_python := no
  259. ifneq (,$(and $(PYTHON_VERSION),$(PYTHON_LIB_DIR),$(PYTHON_INCL_DIR), \
  260. $(PYCONFIG_INCL_DIR),$(PYTHON_LIB),$(BOOST_PYTHON_LIB_DIR),$(BOOST_PYTHON_LIB)))
  261. has_python := yes
  262. endif
  263.  
  264. INCLDIRS := -I . -I .. -isystem $(BOOST_INCL_DIR) -isystem $(ILMBASE_INCL_DIR) -isystem $(TBB_INCL_DIR)
  265. ifeq (yes,$(has_blosc))
  266. INCLDIRS += -isystem $(BLOSC_INCL_DIR)
  267. endif
  268. ifeq (yes,$(has_log4cplus))
  269. INCLDIRS += -isystem $(LOG4CPLUS_INCL_DIR)
  270. endif
  271.  
  272. CXXFLAGS += -std=c++11
  273.  
  274. CXXFLAGS += -pthread $(OPTIMIZE) $(INCLDIRS)
  275. ifeq (yes,$(has_blosc))
  276. CXXFLAGS += -DOPENVDB_USE_BLOSC
  277. endif
  278. ifeq (yes,$(has_log4cplus))
  279. CXXFLAGS += -DOPENVDB_USE_LOG4CPLUS
  280. endif
  281. abi := $(strip $(abi))
  282. ifneq (,$(abi))
  283. CXXFLAGS += -DOPENVDB_3_ABI_COMPATIBLE # TODO: deprecated
  284. CXXFLAGS += -DOPENVDB_ABI_VERSION_NUMBER=$(abi)
  285. endif
  286. ifneq (2,$(strip $(GLFW_MAJOR_VERSION)))
  287. CXXFLAGS += -DOPENVDB_USE_GLFW_3
  288. endif
  289.  
  290. LIBS := \
  291. -ldl -lm -lz \
  292. -L$(ILMBASE_LIB_DIR) $(HALF_LIB) \
  293. -L$(TBB_LIB_DIR) $(TBB_LIB) \
  294. -L$(BOOST_LIB_DIR) $(BOOST_LIB) \
  295. #
  296. LIBS_RPATH := \
  297. -ldl -lm -lz \
  298. -Wl,-rpath,$(ILMBASE_LIB_DIR) -L$(ILMBASE_LIB_DIR) $(HALF_LIB) \
  299. -Wl,-rpath,$(TBB_LIB_DIR) -L$(TBB_LIB_DIR) $(TBB_LIB) \
  300. -Wl,-rpath,$(BOOST_LIB_DIR) -L$(BOOST_LIB_DIR) $(BOOST_LIB) \
  301. #
  302. ifeq (yes,$(has_blosc))
  303. LIBS += -L$(BLOSC_LIB_DIR) $(BLOSC_LIB)
  304. LIBS_RPATH += -Wl,-rpath,$(BLOSC_LIB_DIR) -L$(BLOSC_LIB_DIR) $(BLOSC_LIB)
  305. endif
  306. ifeq (yes,$(has_log4cplus))
  307. LIBS += -L$(LOG4CPLUS_LIB_DIR) $(LOG4CPLUS_LIB)
  308. LIBS_RPATH += -Wl,-rpath,$(LOG4CPLUS_LIB_DIR) -L$(LOG4CPLUS_LIB_DIR) $(LOG4CPLUS_LIB)
  309. endif
  310. ifneq (,$(strip $(CONCURRENT_MALLOC_LIB)))
  311. ifneq (,$(strip $(CONCURRENT_MALLOC_LIB_DIR)))
  312. LIBS_RPATH += -Wl,-rpath,$(CONCURRENT_MALLOC_LIB_DIR) -L$(CONCURRENT_MALLOC_LIB_DIR)
  313. endif
  314. endif
  315. ifdef LINUX
  316. LIBS += -lrt
  317. LIBS_RPATH += -lrt
  318. endif
  319.  
  320. INCLUDE_NAMES := \
  321. Exceptions.h \
  322. Grid.h \
  323. io/Archive.h \
  324. io/Compression.h \
  325. io/File.h \
  326. io/GridDescriptor.h \
  327. io/io.h \
  328. io/Queue.h \
  329. io/Stream.h \
  330. io/TempFile.h \
  331. math/BBox.h \
  332. math/ConjGradient.h \
  333. math/Coord.h \
  334. math/DDA.h \
  335. math/FiniteDifference.h \
  336. math/LegacyFrustum.h \
  337. math/Maps.h \
  338. math/Mat.h \
  339. math/Mat3.h \
  340. math/Mat4.h \
  341. math/Math.h \
  342. math/Operators.h \
  343. math/Proximity.h \
  344. math/QuantizedUnitVec.h \
  345. math/Quat.h \
  346. math/Ray.h \
  347. math/Stats.h \
  348. math/Stencils.h \
  349. math/Transform.h\
  350. math/Tuple.h\
  351. math/Vec2.h \
  352. math/Vec3.h \
  353. math/Vec4.h \
  354. Metadata.h \
  355. MetaMap.h \
  356. openvdb.h \
  357. Platform.h \
  358. PlatformConfig.h \
  359. points/AttributeArray.h \
  360. points/AttributeArrayString.h \
  361. points/AttributeGroup.h \
  362. points/AttributeSet.h \
  363. points/IndexFilter.h \
  364. points/IndexIterator.h \
  365. points/PointAttribute.h \
  366. points/PointConversion.h \
  367. points/PointCount.h \
  368. points/PointDataGrid.h \
  369. points/PointDelete.h \
  370. points/PointGroup.h \
  371. points/PointMask.h \
  372. points/PointScatter.h \
  373. points/StreamCompression.h \
  374. tools/ChangeBackground.h \
  375. tools/Clip.h \
  376. tools/Composite.h \
  377. tools/Dense.h \
  378. tools/DenseSparseTools.h \
  379. tools/Diagnostics.h \
  380. tools/Filter.h \
  381. tools/GridOperators.h \
  382. tools/GridTransformer.h \
  383. tools/Interpolation.h \
  384. tools/LevelSetAdvect.h \
  385. tools/LevelSetFilter.h \
  386. tools/LevelSetFracture.h \
  387. tools/LevelSetMeasure.h \
  388. tools/LevelSetMorph.h \
  389. tools/LevelSetPlatonic.h \
  390. tools/LevelSetRebuild.h \
  391. tools/LevelSetSphere.h \
  392. tools/LevelSetTracker.h \
  393. tools/LevelSetUtil.h \
  394. tools/Mask.h \
  395. tools/MeshToVolume.h \
  396. tools/Morphology.h \
  397. tools/MultiResGrid.h \
  398. tools/ParticleAtlas.h \
  399. tools/ParticlesToLevelSet.h \
  400. tools/PointAdvect.h \
  401. tools/PointIndexGrid.h \
  402. tools/PointPartitioner.h \
  403. tools/PointScatter.h \
  404. tools/PointsToMask.h \
  405. tools/PoissonSolver.h \
  406. tools/PotentialFlow.h \
  407. tools/Prune.h \
  408. tools/RayIntersector.h \
  409. tools/RayTracer.h \
  410. tools/SignedFloodFill.h \
  411. tools/Statistics.h \
  412. tools/TopologyToLevelSet.h \
  413. tools/ValueTransformer.h \
  414. tools/VectorTransformer.h \
  415. tools/VelocityFields.h \
  416. tools/VolumeAdvect.h \
  417. tools/VolumeToMesh.h \
  418. tools/VolumeToSpheres.h \
  419. tree/InternalNode.h \
  420. tree/Iterator.h \
  421. tree/LeafBuffer.h \
  422. tree/LeafManager.h \
  423. tree/LeafNode.h \
  424. tree/LeafNodeBool.h \
  425. tree/LeafNodeMask.h \
  426. tree/NodeManager.h \
  427. tree/NodeUnion.h \
  428. tree/RootNode.h \
  429. tree/Tree.h \
  430. tree/TreeIterator.h \
  431. tree/ValueAccessor.h \
  432. Types.h \
  433. util/CpuTimer.h \
  434. util/Formats.h \
  435. util/logging.h \
  436. util/MapsUtil.h \
  437. util/Name.h \
  438. util/NodeMasks.h \
  439. util/NullInterrupter.h \
  440. util/PagedArray.h \
  441. util/Util.h \
  442. version.h \
  443. #
  444.  
  445. SRC_NAMES := \
  446. Grid.cc \
  447. io/Archive.cc \
  448. io/Compression.cc \
  449. io/File.cc \
  450. io/GridDescriptor.cc \
  451. io/Queue.cc \
  452. io/Stream.cc \
  453. io/TempFile.cc \
  454. math/Maps.cc \
  455. math/Proximity.cc \
  456. math/QuantizedUnitVec.cc \
  457. math/Transform.cc \
  458. Metadata.cc \
  459. MetaMap.cc \
  460. openvdb.cc \
  461. Platform.cc \
  462. points/AttributeArray.cc \
  463. points/AttributeArrayString.cc \
  464. points/AttributeGroup.cc \
  465. points/AttributeSet.cc \
  466. points/points.cc \
  467. points/StreamCompression.cc \
  468. util/Formats.cc \
  469. util/Util.cc \
  470. #
  471.  
  472. UNITTEST_INCLUDE_NAMES := \
  473. unittest/util.h \
  474. #
  475.  
  476. UNITTEST_SRC_NAMES := \
  477. unittest/main.cc \
  478. unittest/TestAttributeArray.cc \
  479. unittest/TestAttributeArrayString.cc \
  480. unittest/TestAttributeSet.cc \
  481. unittest/TestAttributeGroup.cc \
  482. unittest/TestBBox.cc \
  483. unittest/TestConjGradient.cc \
  484. unittest/TestCoord.cc \
  485. unittest/TestCpt.cc \
  486. unittest/TestCurl.cc \
  487. unittest/TestDense.cc \
  488. unittest/TestDenseSparseTools.cc \
  489. unittest/TestDiagnostics.cc \
  490. unittest/TestDivergence.cc \
  491. unittest/TestDoubleMetadata.cc \
  492. unittest/TestExceptions.cc \
  493. unittest/TestFile.cc \
  494. unittest/TestFloatMetadata.cc \
  495. unittest/TestGradient.cc \
  496. unittest/TestGrid.cc \
  497. unittest/TestGridBbox.cc \
  498. unittest/TestGridDescriptor.cc \
  499. unittest/TestGridIO.cc \
  500. unittest/TestGridTransformer.cc \
  501. unittest/TestIndexFilter.cc \
  502. unittest/TestIndexIterator.cc \
  503. unittest/TestInit.cc \
  504. unittest/TestInt32Metadata.cc \
  505. unittest/TestInt64Metadata.cc \
  506. unittest/TestInternalOrigin.cc \
  507. unittest/TestLaplacian.cc \
  508. unittest/TestLeaf.cc \
  509. unittest/TestLeafBool.cc \
  510. unittest/TestLeafManager.cc \
  511. unittest/TestLeafMask.cc \
  512. unittest/TestLeafIO.cc \
  513. unittest/TestLeafOrigin.cc \
  514. unittest/TestLevelSetRayIntersector.cc \
  515. unittest/TestLevelSetUtil.cc \
  516. unittest/TestLinearInterp.cc \
  517. unittest/TestMaps.cc \
  518. unittest/TestMat4Metadata.cc \
  519. unittest/TestMath.cc \
  520. unittest/TestMeanCurvature.cc \
  521. unittest/TestMeshToVolume.cc \
  522. unittest/TestMetadata.cc \
  523. unittest/TestMetadataIO.cc \
  524. unittest/TestMetaMap.cc \
  525. unittest/TestMultiResGrid.cc \
  526. unittest/TestName.cc \
  527. unittest/TestNodeIterator.cc \
  528. unittest/TestNodeManager.cc \
  529. unittest/TestNodeMask.cc \
  530. unittest/TestParticleAtlas.cc \
  531. unittest/TestParticlesToLevelSet.cc \
  532. unittest/TestPointAttribute.cc \
  533. unittest/TestPointConversion.cc \
  534. unittest/TestPointCount.cc \
  535. unittest/TestPointDataLeaf.cc \
  536. unittest/TestPointDelete.cc \
  537. unittest/TestPointGroup.cc \
  538. unittest/TestPointIndexGrid.cc \
  539. unittest/TestPointMask.cc \
  540. unittest/TestPointPartitioner.cc \
  541. unittest/TestPointScatter.cc \
  542. unittest/TestPointsToMask.cc \
  543. unittest/TestPoissonSolver.cc \
  544. unittest/TestPotentialFlow.cc \
  545. unittest/TestPrePostAPI.cc \
  546. unittest/TestQuadraticInterp.cc \
  547. unittest/TestQuantizedUnitVec.cc \
  548. unittest/TestQuat.cc \
  549. unittest/TestRay.cc \
  550. unittest/TestStats.cc \
  551. unittest/TestStream.cc \
  552. unittest/TestStreamCompression.cc \
  553. unittest/TestStringMetadata.cc \
  554. unittest/TestTools.cc \
  555. unittest/TestTopologyToLevelSet.cc \
  556. unittest/TestTransform.cc \
  557. unittest/TestTree.cc \
  558. unittest/TestTreeCombine.cc \
  559. unittest/TestTreeGetSetValues.cc \
  560. unittest/TestTreeIterators.cc \
  561. unittest/TestTreeVisitor.cc \
  562. unittest/TestUtil.cc \
  563. unittest/TestValueAccessor.cc \
  564. unittest/TestVec2Metadata.cc \
  565. unittest/TestVec3Metadata.cc \
  566. unittest/TestVolumeRayIntersector.cc \
  567. unittest/TestVolumeToMesh.cc \
  568. unittest/TestVolumeToSpheres.cc \
  569. #
  570.  
  571. DOC_FILES := doc/doc.txt doc/faq.txt doc/changes.txt doc/codingstyle.txt doc/examplecode.txt doc/api_0_98_0.txt doc/math.txt doc/points.txt doc/python.txt
  572. DOC_INDEX := doc/html/index.html
  573. DOC_PDF := doc/latex/refman.pdf
  574.  
  575. LIBVIEWER_INCLUDE_NAMES := \
  576. viewer/Camera.h \
  577. viewer/ClipBox.h \
  578. viewer/Font.h \
  579. viewer/RenderModules.h \
  580. viewer/Viewer.h \
  581. #
  582. # Used for "install" target only
  583. LIBVIEWER_PUBLIC_INCLUDE_NAMES := \
  584. viewer/Viewer.h \
  585. #
  586. LIBVIEWER_SRC_NAMES := \
  587. viewer/Camera.cc \
  588. viewer/ClipBox.cc \
  589. viewer/Font.cc \
  590. viewer/RenderModules.cc \
  591. viewer/Viewer.cc \
  592. #
  593. ifdef MBSD
  594. LIBVIEWER_FLAGS := -framework Cocoa -framework OpenGL -framework IOKit
  595. else
  596. LIBVIEWER_FLAGS := -lGL -lGLU
  597. endif
  598.  
  599.  
  600. CMD_INCLUDE_NAMES := \
  601. #
  602.  
  603. CMD_SRC_NAMES := \
  604. cmd/openvdb_print/main.cc \
  605. cmd/openvdb_render/main.cc \
  606. cmd/openvdb_view/main.cc \
  607. #
  608.  
  609.  
  610. PYTHON_INCLUDE_NAMES := \
  611. python/pyopenvdb.h \
  612. python/pyutil.h \
  613. python/pyAccessor.h \
  614. python/pyGrid.h \
  615. #
  616. # Used for "install" target only
  617. PYTHON_PUBLIC_INCLUDE_NAMES := \
  618. python/pyopenvdb.h \
  619. #
  620. PYTHON_SRC_NAMES := \
  621. python/pyFloatGrid.cc \
  622. python/pyIntGrid.cc \
  623. python/pyMetadata.cc \
  624. python/pyOpenVDBModule.cc \
  625. python/pyTransform.cc \
  626. python/pyVec3Grid.cc \
  627. #
  628. PYCXXFLAGS := -fPIC -isystem python -isystem $(PYTHON_INCL_DIR) -isystem $(PYCONFIG_INCL_DIR)
  629. ifneq (,$(strip $(NUMPY_INCL_DIR)))
  630. PYCXXFLAGS += -isystem $(NUMPY_INCL_DIR) -DPY_OPENVDB_USE_NUMPY
  631. endif
  632. ifneq (no,$(strip $(PYTHON_WRAP_ALL_GRID_TYPES)))
  633. PYCXXFLAGS += -DPY_OPENVDB_WRAP_ALL_GRID_TYPES
  634. endif
  635.  
  636.  
  637. HEADER_SUBDIRS := $(dir $(INCLUDE_NAMES))
  638.  
  639. ALL_INCLUDE_FILES := \
  640. $(INCLUDE_NAMES) \
  641. $(UNITTEST_INCLUDE_NAMES) \
  642. $(CMD_INCLUDE_NAMES) \
  643. $(LIBVIEWER_INCLUDE_NAMES) \
  644. $(PYTHON_INCLUDE_NAMES) \
  645. #
  646. SRC_FILES := \
  647. $(SRC_NAMES) \
  648. $(UNITTEST_SRC_NAMES) \
  649. $(CMD_SRC_NAMES) \
  650. $(LIBVIEWER_SRC_NAMES) \
  651. $(PYTHON_SRC_NAMES) \
  652. #
  653. ALL_SRC_FILES := $(SRC_FILES)
  654.  
  655. OBJ_NAMES := $(SRC_NAMES:.cc=.o)
  656. UNITTEST_OBJ_NAMES := $(UNITTEST_SRC_NAMES:.cc=.o)
  657. LIBVIEWER_OBJ_NAMES := $(LIBVIEWER_SRC_NAMES:.cc=.o)
  658. PYTHON_OBJ_NAMES := $(PYTHON_SRC_NAMES:.cc=.o)
  659.  
  660. LIB_MAJOR_VERSION=$(shell grep 'define OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER ' \
  661. version.h | sed 's/[^0-9]*//g')
  662. LIB_MINOR_VERSION=$(shell grep 'define OPENVDB_LIBRARY_MINOR_VERSION_NUMBER ' \
  663. version.h | sed 's/[^0-9]*//g')
  664. LIB_PATCH_VERSION=$(shell grep 'define OPENVDB_LIBRARY_PATCH_VERSION_NUMBER ' \
  665. version.h | sed 's/[^0-9]*//g')
  666.  
  667. LIB_VERSION=$(LIB_MAJOR_VERSION).$(LIB_MINOR_VERSION).$(LIB_PATCH_VERSION)
  668. SO_VERSION=$(LIB_MAJOR_VERSION).$(LIB_MINOR_VERSION)
  669.  
  670. LIBOPENVDB_NAME=libopenvdb
  671. LIBOPENVDB_STATIC := $(LIBOPENVDB_NAME).a
  672. ifndef MBSD
  673. LIBOPENVDB_SHARED_NAME := $(LIBOPENVDB_NAME).so
  674. LIBOPENVDB_SHARED := $(LIBOPENVDB_NAME).so.$(LIB_VERSION)
  675. LIBOPENVDB_SONAME := $(LIBOPENVDB_NAME).so.$(SO_VERSION)
  676. LIBOPENVDB_SONAME_FLAGS := -Wl,-soname,$(LIBOPENVDB_SONAME)
  677. else
  678. LIBOPENVDB_SHARED_NAME := $(LIBOPENVDB_NAME).dylib
  679. LIBOPENVDB_SHARED := $(LIBOPENVDB_NAME).$(LIB_VERSION).dylib
  680. LIBOPENVDB_SONAME := $(LIBOPENVDB_NAME).$(SO_VERSION).dylib
  681. LIBOPENVDB_SONAME_FLAGS := -Wl,-install_name,$(DESTDIR_LIB_DIR)/$(LIBOPENVDB_SONAME)
  682. endif
  683.  
  684. # TODO: libopenvdb_viewer is currently built into vdb_view and is not installed separately.
  685. LIBVIEWER_NAME=libopenvdb_viewer
  686. LIBVIEWER_STATIC := $(LIBVIEWER_NAME).a
  687. ifndef MBSD
  688. LIBVIEWER_SHARED_NAME := $(LIBVIEWER_NAME).so
  689. LIBVIEWER_SHARED := $(LIBVIEWER_NAME).so.$(LIB_VERSION)
  690. LIBVIEWER_SONAME := $(LIBVIEWER_NAME).so.$(SO_VERSION)
  691. LIBVIEWER_SONAME_FLAGS := -Wl,-soname,$(LIBVIEWER_SONAME)
  692. else
  693. LIBVIEWER_SHARED_NAME := $(LIBVIEWER_NAME).dylib
  694. LIBVIEWER_SHARED := $(LIBVIEWER_NAME).$(LIB_VERSION).dylib
  695. LIBVIEWER_SONAME := $(LIBVIEWER_NAME).$(SO_VERSION).dylib
  696. LIBVIEWER_SONAME_FLAGS := -Wl,-install_name,$(DESTDIR_LIB_DIR)/$(LIBVIEWER_SONAME)
  697. endif
  698.  
  699. PYTHON_MODULE_NAME=pyopenvdb
  700. PYTHON_MODULE := $(PYTHON_MODULE_NAME).so
  701. PYTHON_SONAME := $(PYTHON_MODULE_NAME).so.$(SO_VERSION)
  702. ifndef MBSD
  703. PYTHON_SONAME_FLAGS := -Wl,-soname,$(PYTHON_SONAME)
  704. endif
  705.  
  706. ifeq (no,$(strip $(shared)))
  707. LIBOPENVDB := $(LIBOPENVDB_STATIC)
  708. LIBVIEWER := $(LIBVIEWER_STATIC)
  709. else
  710. LIBOPENVDB := $(LIBOPENVDB_SHARED)
  711. LIBVIEWER := $(LIBVIEWER_SHARED)
  712. LIBOPENVDB_RPATH := -Wl,-rpath,$(DESTDIR_LIB_DIR)
  713. endif # shared
  714.  
  715. DEPEND := dependencies
  716.  
  717. # Get the list of dependencies that are newer than the current target,
  718. # but limit the list to at most three entries.
  719. list_deps = $(if $(wordlist 4,5,$(?F)),$(firstword $(?F)) and others,$(wordlist 1,3,$(?F)))
  720.  
  721. ALL_PRODUCTS := \
  722. $(LIBOPENVDB) \
  723. vdb_test \
  724. vdb_lod \
  725. vdb_print \
  726. vdb_render \
  727. vdb_view \
  728. $(DEPEND) \
  729. $(LIBOPENVDB_SHARED_NAME) \
  730. $(LIBOPENVDB_SONAME) \
  731. $(PYTHON_MODULE) \
  732.  
  733.  
  734. .SUFFIXES: .o .cc
  735.  
  736. .PHONY: all clean depend doc header_test install lib pdfdoc pydoc pytest python test viewerlib
  737.  
  738. .cc.o:
  739. @echo "Building $@ because of $(call list_deps)"
  740. $(CXX) -c $(CXXFLAGS) -fPIC -o $@ $<
  741.  
  742. #all: lib python vdb_lod vdb_print vdb_render vdb_test depend
  743. all: lib python depend
  744.  
  745. $(OBJ_NAMES): %.o: %.cc
  746. @echo "Building $@ because of $(call list_deps)"
  747. $(CXX) -c -DOPENVDB_PRIVATE $(CXXFLAGS) -fPIC -o $@ $<
  748.  
  749. ifneq (no,$(strip $(shared)))
  750.  
  751. # Build shared library
  752. lib: $(LIBOPENVDB_SHARED_NAME) $(LIBOPENVDB_SONAME)
  753.  
  754. $(LIBOPENVDB_SHARED_NAME): $(LIBOPENVDB_SHARED)
  755. ln -f -s $< $@
  756.  
  757. $(LIBOPENVDB_SONAME): $(LIBOPENVDB_SHARED)
  758. ln -f -s $< $@
  759.  
  760. $(LIBOPENVDB_SHARED): $(OBJ_NAMES)
  761. @echo "Building $@ because of $(list_deps)"
  762. $(CXX) $(CXXFLAGS) -shared -o $@ $^ $(LIBS_RPATH) $(LIBOPENVDB_SONAME_FLAGS)
  763.  
  764. else
  765.  
  766. # Build static library
  767. lib: $(LIBOPENVDB)
  768.  
  769. $(LIBOPENVDB_STATIC): $(OBJ_NAMES)
  770. @echo "Building $@ because of $(list_deps)"
  771. $(AR) cr $@ $^
  772.  
  773. endif # shared
  774.  
  775.  
  776. $(DOC_INDEX): doxygen-config $(INCLUDE_NAMES) $(SRC_NAMES) $(DOC_FILES)
  777. @echo "Generating documentation because of $(list_deps)"
  778. echo 'OUTPUT_DIRECTORY=./doc' | cat doxygen-config - | $(DOXYGEN) - $(QUIET)
  779.  
  780. $(DOC_PDF): doxygen-config $(INCLUDE_NAMES) $(SRC_NAMES) $(DOC_FILES)
  781. @echo "Generating documentation because of $(list_deps)"
  782. echo -e 'OUTPUT_DIRECTORY=./doc\nGENERATE_LATEX=YES\nGENERATE_HTML=NO' \
  783. | cat doxygen-config - | $(DOXYGEN) - $(QUIET) \
  784. && cd ./doc/latex && make refman.pdf $(QUIET) \
  785. && echo 'Created doc/latex/refman.pdf'
  786.  
  787. ifneq (,$(strip $(DOXYGEN)))
  788. doc: $(DOC_INDEX)
  789. pdfdoc: $(DOC_PDF)
  790. else
  791. doc:
  792. @echo "$@"': $$DOXYGEN is undefined'
  793. pdfdoc:
  794. @echo "$@"': $$DOXYGEN is undefined'
  795. endif
  796.  
  797. vdb_lod: $(LIBOPENVDB) cmd/openvdb_lod/main.cc
  798. @echo "Building $@ because of $(list_deps)"
  799. $(CXX) $(CXXFLAGS) -o $@ cmd/openvdb_lod/main.cc -I . \
  800. $(LIBOPENVDB_RPATH) -L$(CURDIR) $(LIBOPENVDB) \
  801. $(LIBS_RPATH) $(CONCURRENT_MALLOC_LIB)
  802.  
  803. vdb_print: $(LIBOPENVDB) cmd/openvdb_print/main.cc
  804. @echo "Building $@ because of $(list_deps)"
  805. $(CXX) $(CXXFLAGS) -o $@ cmd/openvdb_print/main.cc -I . \
  806. $(LIBOPENVDB_RPATH) -L$(CURDIR) $(LIBOPENVDB) \
  807. $(LIBS_RPATH) $(CONCURRENT_MALLOC_LIB)
  808.  
  809. vdb_render: $(LIBOPENVDB) cmd/openvdb_render/main.cc
  810. @echo "Building $@ because of $(list_deps)"
  811. $(CXX) $(CXXFLAGS) -o $@ cmd/openvdb_render/main.cc -I . \
  812. -isystem $(EXR_INCL_DIR) -isystem $(ILMBASE_INCL_DIR) \
  813. -Wl,-rpath,$(EXR_LIB_DIR) -L$(EXR_LIB_DIR) $(EXR_LIB) \
  814. -Wl,-rpath,$(ILMBASE_LIB_DIR) -L$(ILMBASE_LIB_DIR) $(ILMBASE_LIB) \
  815. $(LIBOPENVDB_RPATH) -L$(CURDIR) $(LIBOPENVDB) \
  816. $(LIBS_RPATH) $(CONCURRENT_MALLOC_LIB)
  817.  
  818. # Create an openvdb_viewer/ symlink to the viewer/ subdirectory,
  819. # to mirror the DWA directory structure.
  820. openvdb_viewer:
  821. ln -f -s viewer openvdb_viewer
  822.  
  823. ifneq (yes,$(has_glfw))
  824. vdb_view:
  825. @echo "$@"': GLFW is unavailable'
  826. else
  827. $(LIBVIEWER_INCLUDE_NAMES): openvdb_viewer
  828.  
  829. $(LIBVIEWER_OBJ_NAMES): $(LIBVIEWER_INCLUDE_NAMES)
  830. $(LIBVIEWER_OBJ_NAMES): %.o: %.cc
  831. @echo "Building $@ because of $(list_deps)"
  832. $(CXX) -c $(CXXFLAGS) -I . -isystem $(GLFW_INCL_DIR) -DGL_GLEXT_PROTOTYPES=1 -fPIC -o $@ $<
  833.  
  834. vdb_view: $(LIBOPENVDB) $(LIBVIEWER_OBJ_NAMES) cmd/openvdb_view/main.cc
  835. @echo "Building $@ because of $(list_deps)"
  836. $(CXX) $(CXXFLAGS) -o $@ cmd/openvdb_view/main.cc $(LIBVIEWER_OBJ_NAMES) \
  837. -I . $(LIBOPENVDB_RPATH) -L$(CURDIR) $(LIBOPENVDB) \
  838. $(LIBVIEWER_FLAGS) $(LIBS_RPATH) $(BOOST_THREAD_LIB) $(CONCURRENT_MALLOC_LIB) \
  839. -Wl,-rpath,$(GLFW_LIB_DIR) -L$(GLFW_LIB_DIR) $(GLFW_LIB)
  840. endif
  841.  
  842.  
  843. # Build the Python module
  844. $(PYTHON_OBJ_NAMES): $(PYTHON_INCLUDE_NAMES)
  845. $(PYTHON_OBJ_NAMES): %.o: %.cc
  846. @echo "Building $@ because of $(list_deps)"
  847. $(CXX) -c $(CXXFLAGS) -I . $(PYCXXFLAGS) -o $@ $<
  848. $(PYTHON_MODULE): $(LIBOPENVDB) $(PYTHON_OBJ_NAMES)
  849. @echo "Building $@ because of $(list_deps)"
  850. $(CXX) $(CXXFLAGS) $(PYCXXFLAGS) -shared $(PYTHON_SONAME_FLAGS) -o $@ $(PYTHON_OBJ_NAMES) \
  851. -Wl,-rpath,$(PYTHON_LIB_DIR) -L$(PYTHON_LIB_DIR) $(PYTHON_LIB) \
  852. -Wl,-rpath,$(BOOST_PYTHON_LIB_DIR) -L$(BOOST_PYTHON_LIB_DIR) $(BOOST_PYTHON_LIB) \
  853. $(LIBOPENVDB_RPATH) -L$(CURDIR) $(LIBOPENVDB) \
  854. $(LIBS_RPATH) $(CONCURRENT_MALLOC_LIB)
  855.  
  856. ifeq (yes,$(has_python))
  857. ifneq (,$(strip $(EPYDOC)))
  858. pydoc: $(PYTHON_MODULE) $(LIBOPENVDB_SONAME)
  859. @echo "Generating Python module documentation because of $(list_deps)"
  860. pydocdir=doc/html/python; \
  861. mkdir -p $${pydocdir}; \
  862. echo "Created $${pydocdir}"; \
  863. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(CURDIR); \
  864. export PYTHONPATH=${PYTHONPATH}:$(CURDIR); \
  865. $(EPYDOC) --html -o $${pydocdir} $(PYTHON_MODULE_NAME) $(QUIET)
  866. else
  867. pydoc:
  868. @echo "$@"': $$EPYDOC is undefined'
  869. endif
  870.  
  871. pytest: $(PYTHON_MODULE) $(LIBOPENVDB_SONAME)
  872. @echo "Testing Python module $(PYTHON_MODULE)"
  873. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(CURDIR); \
  874. export PYTHONPATH=${PYTHONPATH}:$(CURDIR); \
  875. python$(PYTHON_VERSION) ./python/test/TestOpenVDB.py $(QUIET_TEST)
  876.  
  877. python: $(PYTHON_MODULE)
  878. else
  879. python pytest pydoc:
  880. @echo "$@"': Python is unavailable'
  881. endif
  882.  
  883.  
  884. $(UNITTEST_OBJ_NAMES): %.o: %.cc
  885. @echo "Building $@ because of $(list_deps)"
  886. $(CXX) -c $(CXXFLAGS) -isystem $(CPPUNIT_INCL_DIR) -fPIC -o $@ $<
  887.  
  888. ifneq (,$(strip $(CPPUNIT_INCL_DIR)))
  889. vdb_test: $(LIBOPENVDB) $(UNITTEST_OBJ_NAMES)
  890. @echo "Building $@ because of $(list_deps)"
  891. $(CXX) $(CXXFLAGS) -o $@ $(UNITTEST_OBJ_NAMES) \
  892. $(LIBOPENVDB_RPATH) -L$(CURDIR) $(LIBOPENVDB) \
  893. $(LIBS_RPATH) $(CONCURRENT_MALLOC_LIB) \
  894. -Wl,-rpath,$(CPPUNIT_LIB_DIR) -L$(CPPUNIT_LIB_DIR) $(CPPUNIT_LIB)
  895.  
  896. test: lib vdb_test
  897. @echo "Testing $(LIBOPENVDB_NAME)"
  898. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(CURDIR); ./vdb_test $(QUIET_TEST)
  899. else
  900. vdb_test:
  901. @echo "$@"': $$(CPPUNIT_INCL_DIR) is undefined'
  902. test:
  903. @echo "$@"': $$(CPPUNIT_INCL_DIR) is undefined'
  904. endif
  905.  
  906. install_lib: lib
  907. mkdir -p $(DESTDIR)/include/openvdb
  908. @echo "Created $(DESTDIR)/include/openvdb"
  909. pushd $(DESTDIR)/include/openvdb > /dev/null; \
  910. mkdir -p $(HEADER_SUBDIRS); popd > /dev/null
  911. for f in $(INCLUDE_NAMES); \
  912. do cp -f $$f $(DESTDIR)/include/openvdb/$$f; done
  913. @echo "Copied header files to $(DESTDIR)/include"
  914. @#
  915. mkdir -p $(DESTDIR_LIB_DIR)
  916. @echo "Created $(DESTDIR_LIB_DIR)"
  917. cp -f $(LIBOPENVDB) $(DESTDIR_LIB_DIR)
  918. pushd $(DESTDIR_LIB_DIR) > /dev/null; \
  919. if [ -f $(LIBOPENVDB_SHARED) ]; then \
  920. ln -f -s $(LIBOPENVDB_SHARED) $(LIBOPENVDB_SHARED_NAME); \
  921. ln -f -s $(LIBOPENVDB_SHARED) $(LIBOPENVDB_SONAME); \
  922. fi; \
  923. popd > /dev/null
  924. @echo "Copied libopenvdb to $(DESTDIR_LIB_DIR)"
  925.  
  926. install: install_lib python vdb_lod vdb_print vdb_render vdb_view doc pydoc
  927. if [ -f $(LIBVIEWER) ]; \
  928. then \
  929. mkdir -p $(DESTDIR)/include/openvdb_viewer; \
  930. echo "Created $(DESTDIR)/include/openvdb_viewer"; \
  931. cp -f $(LIBVIEWER_PUBLIC_INCLUDE_NAMES) $(DESTDIR)/include/openvdb_viewer/; \
  932. @echo "Copied vdb_view header files to $(DESTDIR)/include" \
  933. cp -f $(LIBVIEWER) $(DESTDIR_LIB_DIR); \
  934. pushd $(DESTDIR_LIB_DIR) > /dev/null; \
  935. if [ -f $(LIBVIEWER_SHARED) ]; then \
  936. ln -f -s $(LIBVIEWER_SHARED) $(LIBVIEWER_SHARED_NAME); fi; \
  937. popd > /dev/null; \
  938. @echo "Copied libopenvdb_viewer to $(DESTDIR_LIB_DIR)"; \
  939. fi
  940. @#
  941. if [ -f $(PYTHON_MODULE) ]; \
  942. then \
  943. installdir=$(DESTDIR)/python/include/python$(PYTHON_VERSION); \
  944. mkdir -p $${installdir}; \
  945. echo "Created $${installdir}"; \
  946. cp -f $(PYTHON_PUBLIC_INCLUDE_NAMES) $${installdir}/; \
  947. echo "Copied Python header files to $${installdir}"; \
  948. installdir=$(DESTDIR)/python/lib/python$(PYTHON_VERSION); \
  949. mkdir -p $${installdir}; \
  950. echo "Created $${installdir}"; \
  951. cp -f $(PYTHON_MODULE) $${installdir}/; \
  952. pushd $${installdir} > /dev/null; \
  953. ln -f -s $(PYTHON_MODULE) $(PYTHON_SONAME); \
  954. popd > /dev/null; \
  955. echo "Copied Python module to $${installdir}"; \
  956. fi
  957. @#
  958. mkdir -p $(DESTDIR)/bin
  959. @echo "Created $(DESTDIR)/bin/"
  960. cp -f vdb_lod $(DESTDIR)/bin
  961. @echo "Copied vdb_lod to $(DESTDIR)/bin/"
  962. cp -f vdb_print $(DESTDIR)/bin
  963. @echo "Copied vdb_print to $(DESTDIR)/bin/"
  964. cp -f vdb_render $(DESTDIR)/bin
  965. @echo "Copied vdb_render to $(DESTDIR)/bin/"
  966. if [ -f vdb_view ]; \
  967. then \
  968. cp -f vdb_view $(DESTDIR)/bin; \
  969. echo "Copied vdb_view to $(DESTDIR)/bin/"; \
  970. fi
  971. @#
  972. if [ -d doc/html ]; \
  973. then \
  974. mkdir -p $(DESTDIR)/share/doc/openvdb; \
  975. echo "Created $(DESTDIR)/share/doc/openvdb/"; \
  976. cp -r -f doc/html $(DESTDIR)/share/doc/openvdb; \
  977. echo "Copied documentation to $(DESTDIR)/share/doc/openvdb/"; \
  978. fi
  979.  
  980. # TODO: This accumulates all source file dependencies into a single file
  981. # containing a rule for each *.o file. Consider generating a separate
  982. # dependency file for each *.o file instead.
  983. $(DEPEND): $(ALL_INCLUDE_FILES) $(ALL_SRC_FILES) openvdb_viewer
  984. @echo "Generating dependencies because of $(list_deps)"
  985. $(RM) $(DEPEND)
  986. for f in $(SRC_NAMES) $(CMD_SRC_NAMES); \
  987. do $(CXX) $(CXXFLAGS) -O0 \
  988. -MM $$f -MT `echo $$f | sed 's%\.[^.]*%.o%'` >> $(DEPEND); \
  989. done
  990. if [ -d "$(CPPUNIT_INCL_DIR)" ]; \
  991. then \
  992. for f in $(UNITTEST_SRC_NAMES); \
  993. do $(CXX) $(CXXFLAGS) -O0 \
  994. -MM $$f -MT `echo $$f | sed 's%\.[^.]*%.o%'` \
  995. -isystem $(CPPUNIT_INCL_DIR) >> $(DEPEND); \
  996. done; \
  997. fi
  998.  
  999. depend: $(DEPEND)
  1000.  
  1001. # Compile an implicit translation unit for each header to identify any indirect includes
  1002. HEADER_TEST_CXXFLAGS := $(CXXFLAGS)
  1003. HEADER_TEST_FILES := $(addprefix header_test-,$(INCLUDE_NAMES) $(CMD_INCLUDE_NAMES))
  1004. ifeq (yes,$(has_cppunit))
  1005. HEADER_TEST_FILES += $(addprefix header_test-,$(UNITTEST_INCLUDE_NAMES))
  1006. HEADER_TEST_CXXFLAGS += -isystem $(CPPUNIT_INCL_DIR)
  1007. endif
  1008. ifeq (yes,$(has_glfw))
  1009. HEADER_TEST_FILES += $(addprefix header_test-,$(LIBVIEWER_INCLUDE_NAMES))
  1010. HEADER_TEST_CXXFLAGS += -isystem $(GLFW_INCL_DIR) -DGL_GLEXT_PROTOTYPES=1
  1011. endif
  1012. ifeq (yes,$(has_python))
  1013. HEADER_TEST_FILES += $(addprefix header_test-,$(PYTHON_INCLUDE_NAMES))
  1014. HEADER_TEST_CXXFLAGS += $(PYCXXFLAGS)
  1015. endif
  1016. $(HEADER_TEST_FILES): header_test-%:
  1017. echo "#include \"$*\"" | $(CXX) -c -x c++ $(HEADER_TEST_CXXFLAGS) -fPIC -o /dev/null -
  1018. echo_header_test:
  1019. @echo "Checking for missing or indirectly included headers"
  1020. header_test: echo_header_test $(HEADER_TEST_FILES)
  1021.  
  1022. clean:
  1023. $(RM) $(OBJ_NAMES) $(ALL_PRODUCTS) $(DEPEND)
  1024. $(RM) $(LIBOPENVDB_STATIC)
  1025. $(RM) $(LIBOPENVDB_SHARED)
  1026. $(RM) $(LIBVIEWER_OBJ_NAMES)
  1027. $(RM) $(PYTHON_OBJ_NAMES)
  1028. $(RM) $(UNITTEST_OBJ_NAMES)
  1029. $(RM) -r ./doc/html ./doc/latex
  1030.  
  1031. ifneq (,$(strip $(wildcard $(DEPEND))))
  1032. include $(DEPEND)
  1033. endif
  1034.  
  1035. # Copyright (c) 2012-2018 DreamWorks Animation LLC
  1036. # All rights reserved. This software is distributed under the
  1037. # Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement