Makefile 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. BUILDMODE=release
  2. QTSDK=
  3. BUILDPATH=./build/${BUILDMODE}
  4. LIBRARY_PATH=${BUILDPATH}/system:${BUILDPATH}/basics:${BUILDPATH}/definition:${BUILDPATH}/render/software:${BUILDPATH}/render/preview:${BUILDPATH}/render/opengl:${BUILDPATH}/tests/googletest
  5. BUILD_SPEC=linux-g++
  6. PATH:=${QTSDK}/bin:${PATH}
  7. all:build
  8. format:
  9. find src \( \( -name '*.cpp' -or -name '*.h' \) -and \! -path '*/googletest/*' \) -exec clang-format -i \{\} \;
  10. dirs:
  11. mkdir -p ${BUILDPATH}
  12. makefiles:dirs
  13. ifeq (${BUILDMODE}, release)
  14. @+cd ${BUILDPATH} && qmake ../../src/paysages.pro -r -spec $(BUILD_SPEC)
  15. else
  16. @+cd ${BUILDPATH} && qmake ../../src/paysages.pro -r -spec $(BUILD_SPEC) CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug
  17. endif
  18. build:makefiles
  19. @+cd ${BUILDPATH} && $(MAKE)
  20. clean:makefiles
  21. @+cd ${BUILDPATH} && $(MAKE) clean
  22. ifeq (${BUILDMODE}, release)
  23. make BUILDMODE=debug clean
  24. endif
  25. docs:
  26. doxygen Doxyfile
  27. debug:
  28. +make BUILDMODE=debug all
  29. release:
  30. +make BUILDMODE=release all
  31. testscheck:
  32. +make RUNNER='valgrind --leak-check=full' BUILDMODE=debug tests
  33. tests:build
  34. ifdef TESTCASE
  35. LD_LIBRARY_PATH=$(LIBRARY_PATH) ${RUNNER} ${BUILDPATH}/tests/paysages-tests $(ARGS) --gtest_filter=$(TESTCASE).*
  36. else
  37. LD_LIBRARY_PATH=$(LIBRARY_PATH) ${RUNNER} ${BUILDPATH}/tests/paysages-tests $(ARGS)
  38. endif
  39. run:build
  40. LD_LIBRARY_PATH=$(LIBRARY_PATH) ${RUNNER} ${BUILDPATH}/interface/modeler/paysages-modeler $(ARGS)
  41. run_cli:build
  42. LD_LIBRARY_PATH=$(LIBRARY_PATH) ${RUNNER} ${BUILDPATH}/interface/commandline/paysages-cli $(ARGS)
  43. profile:build
  44. LD_LIBRARY_PATH=${LIBRARY_PATH} perf record -g ${BUILDPATH}/interface/modeler/paysages-modeler $(ARGS)
  45. perf report -g
  46. profile_cli:build
  47. LD_LIBRARY_PATH=${LIBRARY_PATH} perf record -g ${BUILDPATH}/interface/commandline/paysages-cli $(ARGS)
  48. perf report -g
  49. gltrace:build
  50. rm -f *.trace
  51. LD_PRELOAD="$(wildcard /usr/lib/x86_64-linux-gnu/apitrace/wrappers/glxtrace.so /usr/local/lib/x86_64-linux-gnu/apitrace/wrappers/glxtrace.so)" LD_LIBRARY_PATH=$(LIBRARY_PATH) ${BUILDPATH}/interface/modeler/paysages-modeler $(ARGS)
  52. qapitrace paysages-modeler.trace
  53. package:build
  54. rm -rf paysages3d-linux
  55. rm -f paysages3d-linux.tar.bz2
  56. mkdir paysages3d-linux
  57. mkdir paysages3d-linux/lib
  58. cp $(BUILDPATH)/system/libpaysages_system.so* paysages3d-linux/lib/
  59. cp $(BUILDPATH)/basics/libpaysages_basics.so* paysages3d-linux/lib/
  60. cp $(BUILDPATH)/definition/libpaysages_definition.so* paysages3d-linux/lib/
  61. cp $(BUILDPATH)/render/software/libpaysages_render_software.so* paysages3d-linux/lib/
  62. cp $(BUILDPATH)/render/preview/libpaysages_render_preview.so* paysages3d-linux/lib/
  63. cp $(BUILDPATH)/render/opengl/libpaysages_render_opengl.so* paysages3d-linux/lib/
  64. cp $(BUILDPATH)/interface/modeler/paysages-modeler paysages3d-linux/lib/
  65. chmod +x paysages3d-linux/lib/paysages-modeler
  66. cp -r data paysages3d-linux/
  67. cp dist/paysages3d.sh paysages3d-linux/
  68. chmod +x paysages3d-linux/paysages3d.sh
  69. cp dist/collectlib.sh paysages3d-linux/
  70. chmod +x paysages3d-linux/collectlib.sh
  71. cd paysages3d-linux && ./collectlib.sh && rm collectlib.sh && cd -
  72. tar -cjvvf paysages3d-linux.tar.bz2 paysages3d-linux/
  73. .PHONY:all clean release build