Makefile.am 5.7 KB

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