Makefile 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. thisdir := .
  2. SUBDIRS := build jay mcs class nunit20 ilasm tools tests errors docs
  3. basic_SUBDIRS := build jay mcs class
  4. net_1_1_bootstrap_SUBDIRS := build jay mcs class ilasm tools
  5. net_2_0_bootstrap_SUBDIRS := build jay mcs class ilasm tools
  6. net_2_0_SUBDIRS := build jay mcs class nunit20 ilasm tools tests errors
  7. net_2_1_bootstrap_SUBDIRS := build mcs class
  8. net_2_1_raw_SUBDIRS := build mcs class tools
  9. net_2_1_SUBDIRS := tools tests errors
  10. net_3_5_SUBDIRS := build class
  11. # List of test subdirs that should pass 100%
  12. centum_tests := \
  13. class/corlib \
  14. class/System \
  15. class/System.XML \
  16. class/Commons.Xml.Relaxng \
  17. class/Cscompmgd \
  18. class/Microsoft.JScript \
  19. class/Mono.Posix \
  20. class/Mono.Security \
  21. class/System.Design \
  22. class/System.DirectoryServices \
  23. class/System.Drawing \
  24. class/System.Messaging \
  25. class/System.Runtime.Remoting \
  26. class/System.Runtime.Serialization.Formatters.Soap \
  27. class/System.Security \
  28. class/System.ServiceProcess \
  29. class/System.Web \
  30. class/System.Web.Services \
  31. tests \
  32. errors
  33. default_centum_tests := \
  34. $(centum_tests) \
  35. class/System.Data
  36. net_2_0_centum_tests := \
  37. $(centum_tests) \
  38. class/System.Core \
  39. class/System.Configuration \
  40. class/System.Data.DataSetExtensions \
  41. class/System.Xml.Linq \
  42. class/System.Transactions \
  43. class/Microsoft.Build.Framework \
  44. class/Microsoft.Build.Utilities \
  45. class/Microsoft.Build.Engine \
  46. class/Mono.C5
  47. # class/System.Web.Extensions
  48. # class/Microsoft.Build.Tasks
  49. # note that System.Xml.Linq is here to prevent this from being empty
  50. net_3_5_centum_tests := \
  51. class/System.Xml.Linq
  52. ifdef ONLY_CENTUM_TESTS
  53. TEST_SUBDIRS := $($(PROFILE)_centum_tests)
  54. endif
  55. ifdef TEST_SUBDIRS
  56. $(PROFILE)_SUBDIRS := $(TEST_SUBDIRS)
  57. endif
  58. include build/rules.make
  59. all-recursive $(STD_TARGETS:=-recursive): dir-check platform-check profile-check
  60. .PHONY: all-local $(STD_TARGETS:=-local)
  61. all-local $(STD_TARGETS:=-local):
  62. @:
  63. dir-check:
  64. @if [ "$(NO_DIR_CHECK)" = "" -a "$(PROFILE)" != "basic" ]; then echo "Running make from the mcs directory is not supported. Run make from the parent directory (if using a tarball), or from the directory where the runtime is checked out (if using an SVN checkout)."; exit 1; fi
  65. # fun specialty targets
  66. PROFILES = default net_2_0 net_3_5
  67. .PHONY: all-profiles $(STD_TARGETS:=-profiles)
  68. all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--%
  69. @:
  70. profiles-do--%:
  71. $(MAKE) $(PROFILES:%=profile-do--%--$*)
  72. # The % below looks like profile-name--target-name
  73. profile-do--%:
  74. $(MAKE) PROFILE=$(subst --, ,$*)
  75. # We don't want to run the tests in parallel. We want behaviour like -k.
  76. profiles-do--run-test:
  77. ret=:; $(foreach p,$(PROFILES), { $(MAKE) PROFILE=$(p) run-test || ret=false; }; ) $$ret
  78. # Orchestrate the bootstrap here.
  79. _boot_ = all clean install
  80. $(_boot_:%=profile-do--net_3_5--%): profile-do--net_3_5--%: profile-do--net_2_0--%
  81. $(_boot_:%=profile-do--net_2_1--%): profile-do--net_2_1--%: profile-do--net_2_1_raw--%
  82. $(_boot_:%=profile-do--net_2_1_raw--%): profile-do--net_2_1_raw--%: profile-do--net_2_1_bootstrap--%
  83. $(_boot_:%=profile-do--net_2_1_bootstrap--%): profile-do--net_2_1_bootstrap--%: profile-do--net_2_0--%
  84. $(_boot_:%=profile-do--net_2_0--%): profile-do--net_2_0--%: profile-do--net_2_0_bootstrap--%
  85. $(_boot_:%=profile-do--net_2_0_bootstrap--%): profile-do--net_2_0_bootstrap--%: profile-do--default--%
  86. $(_boot_:%=profile-do--default--%): profile-do--default--%: profile-do--net_1_1_bootstrap--%
  87. $(_boot_:%=profile-do--net_1_1_bootstrap--%): profile-do--net_1_1_bootstrap--%: profile-do--basic--%
  88. testcorlib:
  89. @cd class/corlib && $(MAKE) test run-test
  90. compiler-tests:
  91. $(MAKE) TEST_SUBDIRS="tests errors" run-test-profiles
  92. test-installed-compiler:
  93. $(MAKE) TEST_SUBDIRS="tests errors" PROFILE=default TEST_RUNTIME=mono MCS=mcs run-test
  94. $(MAKE) TEST_SUBDIRS="tests errors" PROFILE=net_2_0 TEST_RUNTIME=mono MCS=gmcs run-test
  95. package := mcs-$(VERSION)
  96. DISTFILES = \
  97. AUTHORS \
  98. ChangeLog \
  99. COPYING \
  100. COPYING.LIB \
  101. INSTALL.txt \
  102. LICENSE \
  103. LICENSE.GPL \
  104. LICENSE.LGPL \
  105. LICENSE.MPL \
  106. Makefile \
  107. mkinstalldirs \
  108. MIT.X11 \
  109. MonoIcon.png \
  110. README \
  111. ScalableMonoIcon.svg \
  112. winexe.in \
  113. nunit.key
  114. dist-local: dist-default
  115. dist-pre:
  116. rm -rf $(package)
  117. mkdir $(package)
  118. dist-tarball: dist-pre
  119. $(MAKE) distdir='$(package)' dist-recursive
  120. tar cvjf $(package).tar.bz2 $(package)
  121. dist: dist-tarball
  122. rm -rf $(package)
  123. # the egrep -v is kind of a hack (to get rid of the makefrags)
  124. # but otherwise we have to make dist then make clean which
  125. # is sort of not kosher. And it breaks with DIST_ONLY_SUBDIRS.
  126. #
  127. # We need to set prefix on make so class/System/Makefile can find
  128. # the installed System.Xml to build properly
  129. distcheck: dist-tarball
  130. rm -rf InstallTest Distcheck-MCS ; \
  131. mkdir InstallTest ; \
  132. destdir=`cd InstallTest && pwd` ; \
  133. mv $(package) Distcheck-MCS ; \
  134. (cd Distcheck-MCS && \
  135. $(MAKE) prefix=$(prefix) && $(MAKE) test && $(MAKE) install DESTDIR="$$destdir" && \
  136. $(MAKE) clean && $(MAKE) dist || exit 1) || exit 1 ; \
  137. mv Distcheck-MCS $(package) ; \
  138. tar tjf $(package)/$(package).tar.bz2 |sed -e 's,/$$,,' |sort >distdist.list ; \
  139. rm $(package)/$(package).tar.bz2 ; \
  140. tar tjf $(package).tar.bz2 |sed -e 's,/$$,,' |sort >before.list ; \
  141. find $(package) |egrep -v '(makefrag|response)' |sed -e 's,/$$,,' |sort >after.list ; \
  142. cmp before.list after.list || exit 1 ; \
  143. cmp before.list distdist.list || exit 1 ; \
  144. rm -f before.list after.list distdist.list ; \
  145. rm -rf $(package) InstallTest
  146. monocharge:
  147. chargedir=monocharge-`date -u +%Y%m%d` ; \
  148. mkdir "$$chargedir" ; \
  149. DESTDIR=`cd "$$chargedir" && pwd` ; \
  150. $(MAKE) install DESTDIR="$$DESTDIR" || exit 1 ; \
  151. tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
  152. rm -rf "$$chargedir"
  153. # A bare-bones monocharge.
  154. monocharge-lite:
  155. chargedir=monocharge-lite-`date -u +%Y%m%d` ; \
  156. mkdir "$$chargedir" ; \
  157. DESTDIR=`cd "$$chargedir" && pwd` ; \
  158. $(MAKE) -C mcs install DESTDIR="$$DESTDIR" || exit 1; \
  159. $(MAKE) -C class/corlib install DESTDIR="$$DESTDIR" || exit 1; \
  160. $(MAKE) -C class/System install DESTDIR="$$DESTDIR" || exit 1; \
  161. $(MAKE) -C class/System.XML install DESTDIR="$$DESTDIR" || exit 1; \
  162. $(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
  163. tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
  164. rm -rf "$$chargedir"