Makefile.am 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. ACLOCAL_AMFLAGS = -I m4
  2. AM_CFLAGS = $(WERROR_CFLAGS)
  3. MONOTOUCH_SUBDIRS = $(libgc_dir) eglib/src 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. SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) msvc $(docs_dir) acceptance-tests llvm
  11. # Keep in sync with SUBDIRS
  12. DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs acceptance-tests llvm
  13. all: update_submodules
  14. SUBMODULE_ERROR='Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date'
  15. update_submodules:
  16. @$(srcdir)/scripts/update_submodules
  17. .PHONY: update_submodules
  18. EXTRA_DIST= \
  19. README.md \
  20. LICENSE \
  21. autogen.sh \
  22. mkinstalldirs \
  23. mono-uninstalled.pc.in \
  24. winconfig.h \
  25. code_of_conduct.md \
  26. external \
  27. mcs/class/referencesource
  28. DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
  29. # Distribute the 'mcs' tree too
  30. GIT_DIR ?= $(srcdir)/.git
  31. dist-hook:
  32. test -d $(distdir)/mcs || mkdir $(distdir)/mcs
  33. d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
  34. rm -rf `find $(top_distdir)/external -path '*\.git'`
  35. rm -f `find $(top_distdir)/external -path '*\.exe'`
  36. rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*'`
  37. cp mcs/class/lib/basic/System.Configuration.dll mcs/class/lib/monolite/
  38. cp mcs/class/lib/basic/System.Security.dll mcs/class/lib/monolite/
  39. # Disable this for now because it is very slow and causes wrench to timeout:
  40. # test ! -d $(GIT_DIR) || ./scripts/commits-to-changelog.py --root=$(distdir) last-commit-with-compulsory-changelog-entry
  41. pkgconfigdir = $(libdir)/pkgconfig
  42. noinst_DATA = mono-uninstalled.pc
  43. DISTCLEANFILES= mono-uninstalled.pc
  44. # building with monolite
  45. mcslib = $(mcs_topdir)/class/lib
  46. monolite = $(mcslib)/monolite
  47. mono_corlib_version = $(shell sed -n "s/\#define MONO_CORLIB_VERSION //p" $(srcdir)/mono/metadata/appdomain.c)
  48. monolite_url = http://download.mono-project.com/monolite/monolite-$(mono_corlib_version)-latest.tar.gz
  49. .PHONY: get-monolite-latest
  50. get-monolite-latest:
  51. -rm -fr $(mcslib)/monolite-*
  52. -mkdir -p $(mcslib)
  53. test ! -d $(monolite) || test ! -d $(monolite).old || rm -fr $(monolite).old
  54. test ! -d $(monolite) || mv -f $(monolite) $(monolite).old
  55. cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
  56. cd $(mcslib) && mv -f monolite-* monolite
  57. if BITCODE
  58. BITCODE_CHECK=yes
  59. endif
  60. .PHONY: check-ci
  61. check-ci:
  62. MONO_LLVMONLY=$(BITCODE_CHECK) $(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
  63. .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
  64. validate: do-build-mono-mcs
  65. $(MAKE) mcs-do-tests
  66. do-build-mono-mcs: mcs-do-clean
  67. $(MAKE) all
  68. mcs-do-clean:
  69. cd runtime && $(MAKE) clean-local
  70. cd mono/tests && $(MAKE) clean
  71. mcs-do-tests:
  72. cd runtime && $(MAKE) check-local
  73. cd mono/tests && $(MAKE) check
  74. .PHONY: compiler-tests mcs-do-compiler-tests
  75. compiler-tests:
  76. $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
  77. mcs-do-compiler-tests:
  78. $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
  79. .PHONY: bootstrap-world
  80. bootstrap-world: compiler-tests
  81. $(MAKE) install
  82. if INSTALL_MONOTOUCH
  83. monotouch-do-build: config.h
  84. @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
  85. case "x$$subdir" in \
  86. xmono ) target="monotouch-do-build";; \
  87. * ) target="all";; \
  88. esac; \
  89. echo "Making $$target in $$subdir"; \
  90. (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
  91. done;
  92. (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-build)
  93. monotouch-do-clean:
  94. @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
  95. case "x$$subdir" in \
  96. xmono ) target="monotouch-do-clean";; \
  97. * ) target="clean";; \
  98. esac; \
  99. echo "Making $$target in $$subdir"; \
  100. (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
  101. done;
  102. (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-clean)
  103. endif
  104. win32getdeps:
  105. wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
  106. wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip
  107. wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip
  108. wget http://www.go-mono.com/archive/libiconv-1.7.zip
  109. wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip
  110. wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
  111. unzip -n -d / pkgconfig-0.11-20020310.zip
  112. unzip -n -d / glib-2.0.4-20020703.zip
  113. unzip -n -d / glib-dev-2.0.4-20020703.zip
  114. unzip -n -d / libiconv-1.7.zip
  115. unzip -n -d / libiconv-dev-1.7.zip
  116. unzip -n -d / libintl-0.10.40-20020101.zip
  117. win32setup:
  118. makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi
  119. update-csproj:
  120. -rm msvc/scripts/order
  121. -rm msvc/scripts/order.xml
  122. -rm -rf msvc/scripts/inputs
  123. -mkdir msvc/scripts/inputs
  124. (cd runtime; make V=1 extra_targets=csproj-local)
  125. package-inputs:
  126. echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
  127. echo '<root>' >> msvc/scripts/order.xml
  128. for i in `cat msvc/scripts/order`; do \
  129. set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
  130. cat msvc/scripts/inputs/$$2.input | sed -e 's/\\\\/\\/g' -e 's/\\/\\\\/g' | \
  131. (echo " <project dir=\"$$1\" library=\"$$2\">"; \
  132. read boot; echo " <boot>$$boot</boot>"; \
  133. read flags; echo " <flags>$$flags</flags>"; \
  134. read output; echo " <output>$$output</output>"; \
  135. read built; echo " <built_sources>`echo $$built | sed 's/\\\/\\\\/g'`</built_sources>"; \
  136. read libou; echo " <library_output>$$libou</library_output>"; \
  137. read fx_ver; echo " <fx_version>$$fx_ver</fx_version>"; \
  138. read profile; echo " <profile>$$profile</profile>"; \
  139. read resxt; echo " <resources>$$resxt</resources>"; \
  140. read resp; echo " <response>$$resp</response>"; \
  141. echo " </project>") >> msvc/scripts/order.xml; \
  142. done
  143. echo "</root>" >> msvc/scripts/order.xml
  144. # Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
  145. update-llvm-version:
  146. if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
  147. 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."
  148. update-solution-files:
  149. make update-csproj
  150. make package-inputs
  151. (cd msvc/scripts; make genproj.exe; mono genproj.exe)