Makefile.am 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. ACLOCAL_AMFLAGS = -I m4
  2. AM_CFLAGS = $(WERROR_CFLAGS)
  3. MONOTOUCH_SUBDIRS = $(libgc_dir) mono
  4. # Some tools might not build when cross-compiling
  5. if CROSS_COMPILING
  6. tools_dir =
  7. else
  8. tools_dir = tools
  9. endif
  10. if ENABLE_MSVC
  11. build_with_msvc = msvc
  12. build_without_msvc =
  13. else
  14. build_with_msvc =
  15. build_without_msvc = msvc
  16. endif
  17. if ENABLE_NETCORE
  18. update_submodules =
  19. SUBDIRS = mk llvm mono runtime netcore
  20. else
  21. update_submodules = update_submodules
  22. SUBDIRS = $(build_with_msvc) mk po $(libgc_dir) llvm mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) $(build_without_msvc) $(docs_dir) acceptance-tests
  23. endif
  24. # Keep in sync with SUBDIRS
  25. DIST_SUBDIRS = $(build_with_msvc) m4 mk po $(libgc_dir) llvm mono ikvm-native support data runtime scripts man samples tools $(build_without_msvc) docs acceptance-tests netcore
  26. all: $(update_submodules)
  27. update_submodules:
  28. @cd $(srcdir) && scripts/update_submodules.sh
  29. .PHONY: update_submodules
  30. EXTRA_DIST= \
  31. README.md \
  32. LICENSE \
  33. autogen.sh \
  34. mkinstalldirs \
  35. mono-uninstalled.pc.in \
  36. winconfig.h \
  37. code_of_conduct.md \
  38. external \
  39. mcs/class/referencesource
  40. DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
  41. # Distribute the 'mcs' tree too
  42. GIT_DIR ?= $(srcdir)/.git
  43. dist-hook:
  44. test -d $(distdir)/mcs || mkdir $(distdir)/mcs
  45. d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
  46. rm -rf `find $(top_distdir)/external -path '*\.git'`
  47. rm -rf `find $(top_distdir)/external -path '*\.libs'`
  48. rm -rf `find $(top_distdir)/external -path '*\.deps'`
  49. rm -f `find $(top_distdir)/external -path '*\.o'`
  50. rm -f `find $(top_distdir)/external -path '*\.so'`
  51. rm -f `find $(top_distdir)/external -path '*\.lo'`
  52. rm -f `find $(top_distdir)/external -path '*\.Plo'`
  53. rm -f `find $(top_distdir)/external -name '\.dirstamp'`
  54. rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
  55. rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*' -not -path '*/helix-binaries/*'`
  56. rm -rf "$(top_distdir)/external/linker/test"
  57. pkgconfigdir = $(libdir)/pkgconfig
  58. noinst_DATA = mono-uninstalled.pc
  59. DISTCLEANFILES= mono-uninstalled.pc
  60. # building with monolite
  61. .PHONY: get-monolite-latest
  62. get-monolite-latest:
  63. $(MAKE) -C $(mcs_topdir)/class get-monolite-latest
  64. if BITCODE
  65. BITCODE_CHECK=yes
  66. endif
  67. if DEFAULT_TESTS
  68. CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-default.sh
  69. else
  70. CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
  71. endif
  72. .PHONY: check-ci
  73. check-ci:
  74. MONO_LLVMONLY=$(BITCODE_CHECK) $(CI_TEST_SCRIPT)
  75. .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
  76. validate: do-build-mono-mcs
  77. $(MAKE) mcs-do-tests
  78. do-build-mono-mcs: mcs-do-clean
  79. $(MAKE) all
  80. mcs-do-clean:
  81. cd runtime && $(MAKE) clean-local
  82. cd mono/tests && $(MAKE) clean
  83. mcs-do-tests:
  84. cd runtime && $(MAKE) check-local
  85. cd mono/tests && $(MAKE) check
  86. .PHONY: compiler-tests mcs-do-compiler-tests
  87. compiler-tests:
  88. $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
  89. mcs-do-compiler-tests:
  90. $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
  91. .PHONY: bootstrap-world
  92. bootstrap-world: compiler-tests
  93. $(MAKE) install
  94. if INSTALL_MONOTOUCH
  95. monotouch-do-build: config.h
  96. @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
  97. case "x$$subdir" in \
  98. xmono ) target="monotouch-do-build";; \
  99. * ) target="all";; \
  100. esac; \
  101. echo "Making $$target in $$subdir"; \
  102. (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
  103. done;
  104. (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-build)
  105. monotouch-do-clean:
  106. @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
  107. case "x$$subdir" in \
  108. xmono ) target="monotouch-do-clean";; \
  109. * ) target="clean";; \
  110. esac; \
  111. echo "Making $$target in $$subdir"; \
  112. (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
  113. done;
  114. (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-clean)
  115. endif
  116. update-csproj:
  117. -rm msvc/scripts/order
  118. -rm msvc/scripts/order.xml
  119. -rm -rf msvc/scripts/inputs
  120. -mkdir msvc/scripts/inputs
  121. (cd runtime; $(MAKE) V=1 extra_targets=csproj-local)
  122. package-inputs:
  123. echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
  124. echo '<root>' >> msvc/scripts/order.xml
  125. for i in `cat msvc/scripts/order`; do \
  126. set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
  127. cat msvc/scripts/inputs/$$2.input | sed -e 's/\\\\/\\/g' -e 's/\\/\\\\/g' | \
  128. (echo " <project dir=\"$$1\" library=\"$$2\">"; \
  129. read boot; echo " <boot>$$boot</boot>"; \
  130. read flags; echo " <flags>$$flags</flags>"; \
  131. read sources;echo " <sources>$$sources</sources>"; \
  132. read output; echo " <output>$$output</output>"; \
  133. read built; echo " <built_sources>`echo $$built | sed 's/\\\/\\\\/g'`</built_sources>"; \
  134. read libou; echo " <library_output>$$libou</library_output>"; \
  135. read fx_ver; echo " <fx_version>$$fx_ver</fx_version>"; \
  136. read profile; echo " <profile>$$profile</profile>"; \
  137. read resxt; echo " <resources>$$resxt</resources>"; \
  138. read resp; echo " <response>$$resp</response>"; \
  139. echo " </project>") >> msvc/scripts/order.xml; \
  140. done
  141. echo "</root>" >> msvc/scripts/order.xml
  142. # Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
  143. update-llvm-version:
  144. if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
  145. REV=`$(LLVM_DIR)/bin/llvm-config --version` && sed -e "s,expected_llvm_version=.*,expected_llvm_version=\"$$REV\"," < configure.ac > tmp && mv tmp configure.ac && echo "Version set to $$REV."
  146. update-solution-files:
  147. cd msvc/scripts && $(MAKE) genproj.exe || exit $$?;
  148. $(MAKE) update-csproj
  149. $(MAKE) package-inputs
  150. (cd msvc/scripts; mono --debug genproj.exe $(GENPROJ_ARGS))
  151. update-solution-files-with-tests:
  152. $(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files