Makefile 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #############################################################################
  2. #
  3. # MODULE: GRASS Compilation
  4. # AUTHOR(S): Original author unknown - probably CERL
  5. # Justin Hickey - Thailand - jhickey AT hpcc.nectec.or.th
  6. # Markus Neteler - Germany - neteler AT itc.it
  7. # Andreas Lange - Germany - Andreas.Lange AT Rhein-Main.de
  8. # Radim Blazek - Italy - blazek AT itc.it
  9. # PURPOSE: It provides the commands necessary to compile, install,
  10. # clean, and uninstall GRASS
  11. # See INSTALL file for explanations.
  12. # COPYRIGHT: (C) 2002-2012 by the GRASS Development Team
  13. #
  14. # This program is free software under the GNU General Public
  15. # License (>=v2). Read the file COPYING that comes with GRASS
  16. # for details.
  17. #
  18. #############################################################################
  19. MODULE_TOPDIR = .
  20. include $(MODULE_TOPDIR)/include/Make/Dir.make
  21. include $(MODULE_TOPDIR)/include/Make/Compile.make
  22. DATE := $(shell date '+%d_%m_%Y')
  23. DIRS = \
  24. demolocation \
  25. utils \
  26. include \
  27. lib \
  28. python \
  29. db \
  30. display \
  31. general \
  32. raster \
  33. raster3d \
  34. vector \
  35. misc \
  36. imagery \
  37. ps \
  38. scripts \
  39. temporal \
  40. doc \
  41. gui \
  42. visualization \
  43. locale \
  44. man \
  45. macosx \
  46. mswindows
  47. SUBDIRS = $(DIRS)
  48. FILES = AUTHORS CHANGES CITING COPYING GPL.TXT INSTALL REQUIREMENTS.html contributors.csv contributors_extra.csv translators.csv
  49. FILES_DST = $(patsubst %,$(ARCH_DISTDIR)/%,$(FILES))
  50. default:
  51. @echo "GRASS GIS $(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR).$(GRASS_VERSION_RELEASE) $(GRASS_VERSION_GIT) compilation log" \
  52. > $(ERRORLOG)
  53. @echo "--------------------------------------------------" >> $(ERRORLOG)
  54. @echo "Started compilation: `date`" >> $(ERRORLOG)
  55. @echo "--" >> $(ERRORLOG)
  56. @echo "Errors in:" >> $(ERRORLOG)
  57. -$(CHMOD) 755 install-sh
  58. $(MAKE) subdirs
  59. $(MAKE) $(FILES_DST)
  60. $(MAKE) manifests
  61. @if [ `wc -l < "$(ERRORLOG)"` -gt 5 ] ; then \
  62. echo "--" >> $(ERRORLOG) ; \
  63. echo "In case of errors please change into the directory with error and run 'make'." >> $(ERRORLOG) ; \
  64. echo "If you get multiple errors, you need to deal with them in the order they" >> $(ERRORLOG) ; \
  65. echo "appear in the error log. If you get an error building a library, you will" >> $(ERRORLOG) ; \
  66. echo "also get errors from anything which uses the library." >> $(ERRORLOG) ; \
  67. else \
  68. echo "No errors detected." >> $(ERRORLOG) ; \
  69. fi
  70. @echo "--" >> $(ERRORLOG)
  71. @echo "Finished compilation: `date`" >> $(ERRORLOG)
  72. @cat $(ERRORLOG)
  73. @if [ `wc -l < "$(ERRORLOG)"` -gt 8 ] ; then false ; else true ; fi
  74. manifests:
  75. ifeq ($(MANIFEST),external)
  76. find $(ARCH_DISTDIR) -type f -name '*.exe' | \
  77. while read file ; do \
  78. $(MAKE) "$$file".manifest ; \
  79. done
  80. endif
  81. $(ARCH_DISTDIR)/%: %
  82. $(INSTALL_DATA) $< $@
  83. LIBDIRS = \
  84. lib/external/shapelib \
  85. lib/datetime \
  86. lib/gis \
  87. lib/linkm \
  88. lib/db \
  89. lib/vector \
  90. db/drivers \
  91. python
  92. # Compile libraries only
  93. libs:
  94. $(MAKE) -C include
  95. $(MAKE) subdirs SUBDIRS=$(LIBDIRS)
  96. $(MAKE) $(FILES_DST)
  97. cleandistdirs:
  98. -rm -rf $(ARCH_DISTDIR)
  99. -rm -rf $(ARCH_BINDIR)
  100. # Clean out the strings extracted from scripts for translation
  101. cleanscriptstrings:
  102. rm -f locale/scriptstrings/*.c 2>/dev/null
  103. clean: cleandistdirs cleanscriptstrings cleandocs
  104. libsclean: cleandistdirs
  105. $(MAKE) clean-recursive SUBDIRS=$(LIBDIRS)
  106. distclean: clean
  107. -rm -f config.cache config.log config.status config.status.$(ARCH) 2>/dev/null
  108. -rm -f ChangeLog ChangeLog.bak $(ERRORLOG) grass.pc
  109. -rm -f include/grass/config.h include/grass/version.h
  110. -rm -f include/Make/Platform.make include/Make/Doxyfile_arch_html include/Make/Doxyfile_arch_latex 2>/dev/null
  111. include $(MODULE_TOPDIR)/include/Make/Install.make
  112. include $(MODULE_TOPDIR)/include/Make/Docs.make
  113. include $(MODULE_TOPDIR)/include/Make/Doxygen.make
  114. include $(MODULE_TOPDIR)/include/Make/Sphinx.make
  115. DOXNAME=grass
  116. .PHONY: default libs
  117. .PHONY: cleandistdirs cleanscriptstrings clean libsclean distclean