Makefile.am 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. tmpinst = _tmpinst
  2. noinst_SCRIPTS = mono-wrapper monodis-wrapper
  3. etctmp = etc
  4. symlinks = etc/mono/1.0/machine.config etc/mono/2.0/machine.config etc/mono/2.0/web.config etc/mono/browscap.ini etc/mono/2.0/Browsers/Compat.browser
  5. if INSTALL_4_x
  6. symlinks += etc/mono/4.0/machine.config etc/mono/4.0/web.config etc/mono/4.5/web.config etc/mono/4.5/machine.config etc/mono/4.0/Browsers/Compat.browser etc/mono/4.5/Browsers/Compat.browser
  7. endif
  8. etc/mono/2.0/machine.config: $(top_srcdir)/data/net_2_0/machine.config
  9. etc/mono/2.0/web.config: $(top_srcdir)/data/net_2_0/web.config
  10. etc/mono/browscap.ini: $(top_srcdir)/data/browscap.ini
  11. etc/mono/2.0/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
  12. etc/mono/4.0/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
  13. etc/mono/4.5/Browsers/Compat.browser: $(top_srcdir)/data/Browsers/Compat.browser
  14. etc/mono/4.0/machine.config: $(top_srcdir)/data/net_4_0/machine.config
  15. etc/mono/4.0/web.config: $(top_srcdir)/data/net_4_0/web.config
  16. etc/mono/4.5/machine.config: $(top_srcdir)/data/net_4_5/machine.config
  17. etc/mono/4.5/web.config: $(top_srcdir)/data/net_4_5/web.config
  18. $(symlinks):
  19. cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
  20. SUPPORT_FILES = $(symlinks) mono-wrapper etc/mono/config
  21. build_profiles =
  22. if INSTALL_4_x
  23. build_profiles += binary_reference_assemblies net_4_x xbuild_12 xbuild_14
  24. al_profile = net_4_x
  25. endif
  26. if INSTALL_MONODROID
  27. build_profiles += monodroid
  28. endif
  29. if INSTALL_MONOTOUCH
  30. build_profiles += monotouch monotouch_runtime
  31. endif
  32. if INSTALL_MONOTOUCH_WATCH
  33. build_profiles += monotouch_watch monotouch_watch_runtime
  34. endif
  35. if INSTALL_MONOTOUCH_TV
  36. build_profiles += monotouch_tv monotouch_tv_runtime
  37. endif
  38. if INSTALL_XAMMAC
  39. build_profiles += xammac xammac_net_4_5
  40. endif
  41. test_profiles = $(build_profiles)
  42. if BUILD_MCS
  43. MAKE_FLAGS=$(if $(V),,--no-print-directory -s)
  44. # The write check is to foil 'make distcheck'
  45. all-local: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  46. if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
  47. cd $(mcs_topdir) && $(MAKE) $(MAKE_FLAGS) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' CC='$(CC)' all-profiles
  48. # override automake
  49. install: install-exec install-data
  50. # override automake
  51. install-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  52. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles
  53. # override automake
  54. install-data:
  55. @:
  56. # override automake
  57. uninstall:
  58. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles
  59. clean-local:
  60. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' clean-profiles
  61. -rm -fr $(etctmp) $(tmpinst)
  62. endif BUILD_MCS
  63. TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/mcs $(tmpinst)/bin/dmcs $(tmpinst)/bin/al2 $(tmpinst)/bin/al
  64. mcs-do-test-profiles:
  65. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' test-profiles
  66. mcs-do-run-test-profiles: test-support-files
  67. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-test-profiles
  68. if HOST_WIN32
  69. if CROSS_COMPILING
  70. cur_dir_cmd = pwd
  71. PLATFORM_PATH_SEPARATOR = :
  72. else
  73. cur_dir_cmd = cygpath -w -a .
  74. PLATFORM_PATH_SEPARATOR = ;
  75. endif
  76. else
  77. cur_dir_cmd = pwd
  78. PLATFORM_PATH_SEPARATOR = :
  79. endif
  80. # Compile all assemblies with the verifier turned on. Code must be valid but not verifiable.
  81. # TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode.
  82. # Skip binary_reference_assemblies because they contain metadata only
  83. mcs-compileall: mono-wrapper etc/mono/config
  84. save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
  85. for profile in $(test_profiles); do \
  86. if [ "binary_reference_assemblies" = "$$profile" ]; then \
  87. continue; \
  88. fi; \
  89. if [ "xbuild_12" = "$$profile" ]; then \
  90. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_x$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  91. elif [ "xbuild_14" = "$$profile" ]; then \
  92. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_x$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  93. else \
  94. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  95. fi; \
  96. export MONO_PATH; \
  97. for i in $(mcs_topdir)/class/lib/$$profile/*.{dll,exe}; do \
  98. if [ ! -f $$i ] ; then \
  99. continue ; \
  100. fi ; \
  101. if ./mono-wrapper --compile-all --verify-all --security=verifiable $$i; then \
  102. echo $$i verified OK; \
  103. else \
  104. echo $$i verification failed; ok=false; \
  105. fi; done; done; \
  106. $$ok
  107. if NACL_CODEGEN
  108. check-local:
  109. else
  110. check-local: mcs-compileall mcs-do-test-profiles
  111. $(MAKE) mcs-do-run-test-profiles
  112. endif
  113. # Compile all mcs tests
  114. test: mcs-do-test-profiles
  115. CLEANFILES = etc/mono/config
  116. # depend on $(symlinks) to ensure 'etc/mono' directory exists
  117. etc/mono/config: ../data/config Makefile $(symlinks)
  118. d=`cd ../support && pwd`; \
  119. sed 's,target="$$mono_libdir/libMonoPosixHelper$(libsuffix)",target="'$$d'/libMonoPosixHelper.la",' ../data/config > $@t
  120. if test -z "$(libgdiplus_loc)"; then :; else \
  121. sed 's,target="$(libgdiplus_install_loc)",target="$(libgdiplus_loc)",' $@t > $@tt; \
  122. mv -f $@tt $@t; fi
  123. mv -f $@t $@
  124. $(tmpinst)/bin/mono: mono-wrapper etc/mono/config
  125. $(mkinstalldirs) $(tmpinst)/bin
  126. cp mono-wrapper $@
  127. $(tmpinst)/bin/mcs: $(tmpinst)/bin/mono Makefile
  128. echo '#! /bin/sh' > $@ ; \
  129. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  130. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/build/mcs.exe"'" "$$@"' >> $@ ; \
  131. chmod +x $@
  132. $(tmpinst)/bin/dmcs: $(tmpinst)/bin/mono Makefile
  133. echo '#! /bin/sh' > $@ ; \
  134. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  135. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/build/mcs.exe -sdk:4"'" "$$@"' >> $@ ; \
  136. chmod +x $@
  137. $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
  138. echo '#! /bin/sh' > $@ ; \
  139. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  140. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/ilasm/ilasm.exe"'" "$$@"' >> $@ ; \
  141. chmod +x $@
  142. $(tmpinst)/bin/al2: $(tmpinst)/bin/mono Makefile
  143. echo '#! /bin/sh' > $@ ; \
  144. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  145. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/net_2_0/al.exe"'" "$$@"' >> $@ ; \
  146. chmod +x $@
  147. $(tmpinst)/bin/al: $(tmpinst)/bin/mono Makefile
  148. echo '#! /bin/sh' > $@ ; \
  149. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  150. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(al_profile)/al.exe"'" "$$@"' >> $@ ; \
  151. chmod +x $@
  152. test-support-files: $(TEST_SUPPORT_FILES)
  153. @:
  154. # the 'cygnus' option also disables the default 'distdir:' target, which we _do_ want
  155. MYDISTFILES = $(DIST_COMMON)
  156. distdir: $(MYDISTFILES)
  157. rm -fr $(distdir)
  158. mkdir $(distdir)
  159. test -z '$(MYDISTFILES)' || for file in ''$(MYDISTFILES); do \
  160. cp -p $$file $(distdir) ; done
  161. find $(distdir) -type f -exec chmod a+r {} ';'