Makefile 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. thisdir := .
  2. SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs packages
  3. # Resgen is corlib specific tool
  4. basic_SUBDIRS := build jay class
  5. build_SUBDIRS := build class class/aot-compiler tools ilasm
  6. monodroid_SUBDIRS := build class
  7. monodroid_tools_SUBDIRS := build class tools
  8. monotouch_SUBDIRS := build class
  9. monotouch_watch_SUBDIRS := build class
  10. monotouch_tv_SUBDIRS := build class
  11. monotouch_runtime_SUBDIRS := build class
  12. monotouch_watch_runtime_SUBDIRS := build class
  13. monotouch_tv_runtime_SUBDIRS := build class
  14. xammac_SUBDIRS := build class
  15. testing_aot_hybrid_SUBDIRS := build class
  16. testing_aot_full_SUBDIRS := build class
  17. binary_reference_assemblies_SUBDIRS := build class
  18. net_4_x_SUBDIRS := build class nunit24 ilasm tools tests errors docs mcs class/aot-compiler packages
  19. xammac_net_4_5_SUBDIRS := build class
  20. xbuild_12_SUBDIRS := build class tools/xbuild
  21. xbuild_14_SUBDIRS := build class tools/xbuild
  22. winaot_SUBDIRS := build class
  23. orbis_SUBDIRS := build class
  24. unreal_SUBDIRS := build class
  25. include build/rules.make
  26. all-recursive $(STD_TARGETS:=-recursive): dir-check platform-check profile-check
  27. .PHONY: all-local $(STD_TARGETS:=-local)
  28. all-local $(STD_TARGETS:=-local):
  29. @:
  30. dir-check:
  31. @if [ "$(NO_DIR_CHECK)" = "" -a "$(PROFILE)" != "basic" ]; then $(MAKE) -C ../runtime; fi
  32. # fun specialty targets
  33. PROFILES = net_4_x binary_reference_assemblies xbuild_12 xbuild_14
  34. .PHONY: all-profiles $(STD_TARGETS:=-profiles)
  35. all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--%
  36. @:
  37. profiles-do--%:
  38. $(MAKE) $(PROFILES:%=profile-do--%--$*)
  39. # The % below looks like profile-name--target-name
  40. profile-do--%:
  41. $(MAKE) PROFILE=$(subst --, ,$*)
  42. # xbuild_12 and xbuild_14 will try to install the same files, so they need
  43. # to be ordered
  44. profile-do--xbuild_14--install: profile-do--xbuild_12--install
  45. # We don't want to run the tests in parallel. We want behaviour like -k.
  46. profiles-do--run-test:
  47. ret=:; $(foreach p,$(PROFILES), { $(MAKE) PROFILE=$(p) run-test || ret=false; }; ) $$ret
  48. # Orchestrate the bootstrap here.
  49. _boot_ = all clean install
  50. $(_boot_:%=profile-do--xbuild_14--%): profile-do--xbuild_14--%: profile-do--net_4_x--%
  51. $(_boot_:%=profile-do--xbuild_12--%): profile-do--xbuild_12--%: profile-do--net_4_x--%
  52. $(_boot_:%=profile-do--binary_reference_assemblies--%): profile-do--binary_reference_assemblies--%: profile-do--build--%
  53. $(_boot_:%=profile-do--net_4_x--%): profile-do--net_4_x--%: profile-do--build--%
  54. $(_boot_:%=profile-do--monodroid--%): profile-do--monodroid--%: profile-do--build--%
  55. $(_boot_:%=profile-do--monodroid_tools--%): profile-do--monodroid_tools--%: profile-do--build--%
  56. $(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%: profile-do--build--%
  57. $(_boot_:%=profile-do--monotouch_watch--%): profile-do--monotouch_watch--%: profile-do--build--%
  58. $(_boot_:%=profile-do--monotouch_tv--%): profile-do--monotouch_tv--%: profile-do--build--%
  59. $(_boot_:%=profile-do--monotouch_runtime--%): profile-do--monotouch_runtime--%: profile-do--build--%
  60. $(_boot_:%=profile-do--monotouch_watch_runtime--%): profile-do--monotouch_watch_runtime--%: profile-do--build--%
  61. $(_boot_:%=profile-do--monotouch_tv_runtime--%): profile-do--monotouch_tv_runtime--%: profile-do--build--%
  62. $(_boot_:%=profile-do--xammac--%): profile-do--xammac--%: profile-do--build--%
  63. $(_boot_:%=profile-do--xammac_net_4_5--%): profile-do--xammac_net_4_5--%: profile-do--build--%
  64. $(_boot_:%=profile-do--testing_aot_hybrid--%): profile-do--testing_aot_hybrid--%: profile-do--build--%
  65. $(_boot_:%=profile-do--testing_aot_full--%): profile-do--testing_aot_full--%: profile-do--build--%
  66. $(_boot_:%=profile-do--winaot--%): profile-do--winaot--%: profile-do--build--%
  67. $(_boot_:%=profile-do--orbis--%): profile-do--orbis--%: profile-do--build--%
  68. $(_boot_:%=profile-do--unreal--%): profile-do--unreal--%: profile-do--build--%
  69. $(_boot_:%=profile-do--build--%): profile-do--build--%: profile-do--basic--%
  70. testcorlib:
  71. @cd class/corlib && $(MAKE) test run-test
  72. compiler-tests:
  73. $(MAKE) TEST_SUBDIRS="tests errors" run-test-profiles
  74. package := mcs-$(VERSION)
  75. DISTFILES = \
  76. AUTHORS \
  77. COPYING \
  78. INSTALL.txt \
  79. Makefile \
  80. mkinstalldirs \
  81. MonoIcon.png \
  82. README \
  83. ScalableMonoIcon.svg
  84. dist-local: dist-default
  85. csproj-local:
  86. dist-pre:
  87. rm -rf $(package)
  88. mkdir $(package)
  89. dist-tarball: dist-pre
  90. $(MAKE) distdir='$(package)' dist-recursive
  91. tar cvjf $(package).tar.bz2 $(package)
  92. dist: dist-tarball
  93. rm -rf $(package)
  94. # the egrep -v is kind of a hack (to get rid of the makefrags)
  95. # but otherwise we have to make dist then make clean which
  96. # is sort of not kosher. And it breaks with DIST_ONLY_SUBDIRS.
  97. #
  98. # We need to set prefix on make so class/System/Makefile can find
  99. # the installed System.Xml to build properly
  100. distcheck: dist-tarball
  101. rm -rf InstallTest Distcheck-MCS ; \
  102. mkdir InstallTest ; \
  103. destdir=`cd InstallTest && pwd` ; \
  104. mv $(package) Distcheck-MCS ; \
  105. (cd Distcheck-MCS && \
  106. $(MAKE) prefix=$(prefix) && $(MAKE) test && $(MAKE) install DESTDIR="$$destdir" && \
  107. $(MAKE) clean && $(MAKE) dist || exit 1) || exit 1 ; \
  108. mv Distcheck-MCS $(package) ; \
  109. tar tjf $(package)/$(package).tar.bz2 |sed -e 's,/$$,,' |sort >distdist.list ; \
  110. rm $(package)/$(package).tar.bz2 ; \
  111. tar tjf $(package).tar.bz2 |sed -e 's,/$$,,' |sort >before.list ; \
  112. find $(package) |egrep -v '(makefrag|response)' |sed -e 's,/$$,,' |sort >after.list ; \
  113. cmp before.list after.list || exit 1 ; \
  114. cmp before.list distdist.list || exit 1 ; \
  115. rm -f before.list after.list distdist.list ; \
  116. rm -rf $(package) InstallTest
  117. # Targets for creating API diffs of the framework
  118. MONO_API_SNAPSHOT_PATH := $(topdir)../external/api-snapshot/
  119. GENAPI := $(MONO_API_SNAPSHOT_PATH)tools/genapi/GenAPI.exe
  120. MONO_API_SNAPSHOT_PROFILE_PATH := $(MONO_API_SNAPSHOT_PATH)profiles/$(PROFILE)/
  121. MONO_API_ASSEMBLIES_IGNORED := $(addprefix $(topdir)class/lib/$(PROFILE)/, Mono.CSharp.dll SystemWebTestShim.dll standalone-runner-support.dll nunit.core.dll nunit.core.extensions.dll nunit.core.interfaces.dll nunit.framework.dll nunit.framework.extensions.dll nunit.mocks.dll nunit.util.dll nunit-console-runner.dll nunitlite.dll Mono.Profiler.Log.dll)
  122. MONO_API_ASSEMBLIES := $(filter-out $(MONO_API_ASSEMBLIES_IGNORED), $(wildcard $(topdir)class/lib/$(PROFILE)/*.dll)) $(wildcard $(topdir)class/lib/$(PROFILE)/Facades/*.dll)
  123. MONO_API_ASSEMBLIES_CS := $(MONO_API_ASSEMBLIES:$(topdir)class/lib/$(PROFILE)/%.dll=$(MONO_API_SNAPSHOT_PROFILE_PATH)%.cs)
  124. $(MONO_API_SNAPSHOT_PROFILE_PATH)%.cs: $(topdir)class/lib/$(PROFILE)/%.dll $(GENAPI) $(MONO_API_SNAPSHOT_PATH)profiles/license-header.txt
  125. @mkdir -p $(dir $@)
  126. $(Q) MONO_PATH=$(topdir)class/lib/$(BUILD_TOOLS_PROFILE) $(RUNTIME) $(GENAPI) -libPath:$(topdir)class/lib/$(PROFILE),$(topdir)class/lib/$(PROFILE)/Facades -out:$(dir $@) -headerFile:$(MONO_API_SNAPSHOT_PATH)profiles/license-header.txt -assemblyAttributes -typeForwardedTo -assemblyVersion -assembly:$< || echo "Couldn't process assembly." > $@
  127. mono-api-current: $(MONO_API_ASSEMBLIES_CS)
  128. mono-api-current-clean:
  129. $(Q) rm -rf "$(MONO_API_SNAPSHOT_PROFILE_PATH)"
  130. mono-api-diff:
  131. @echo "Regenerating API snapshot..."
  132. $(Q) $(MAKE) mono-api-current-clean PROFILE=net_4_x
  133. $(Q) $(MAKE) mono-api-current-clean PROFILE=monotouch
  134. $(Q) $(MAKE) mono-api-current-clean PROFILE=monodroid
  135. $(Q) $(MAKE) mono-api-current PROFILE=net_4_x
  136. $(Q) $(MAKE) mono-api-current PROFILE=monotouch
  137. $(Q) $(MAKE) mono-api-current PROFILE=monodroid
  138. @echo "Checking public API differences..."
  139. $(Q) cd $(MONO_API_SNAPSHOT_PATH); git add -A .
  140. $(Q) cd $(MONO_API_SNAPSHOT_PATH); git diff --no-renames HEAD > $(abspath $(topdir))/temp.patch
  141. @mkdir -p apidiff
  142. $(Q) sed -e "/@diffdata@/r temp.patch" -e "/@diffdata@/d" -e "s/@title@/Public API Diff/g" -e "s/@description@/If the changes are intentional, run <code>make -C mcs mono-api-diff<\/code> locally and commit changes in external\/api-snapshot./g" diff.html.in > apidiff/index.html
  143. $(Q) if [ -s temp.patch ]; then echo "Error: Found public API differences, see mcs/apidiff/index.html. If the changes are intentional, please go to external/api-snapshot and commit them."; rm -f temp.patch; exit 1; else echo "No differences found."; rm -f temp.patch; fi