Makefile.am 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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_0
  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. if ONLY_MONOTOUCH
  22. build_profiles = monotouch
  23. else
  24. build_profiles =
  25. if INSTALL_2_0
  26. build_profiles += net_2_0 net_3_5
  27. al_profile = net_2_0
  28. endif
  29. if INSTALL_4_0
  30. build_profiles += net_4_0
  31. al_profile = net_4_0
  32. endif
  33. if INSTALL_4_5
  34. build_profiles += net_4_5
  35. al_profile = net_4_5
  36. endif
  37. if INSTALL_MONODROID
  38. build_profiles += monodroid
  39. endif
  40. if INSTALL_MONOTOUCH
  41. build_profiles += monotouch monotouch_runtime
  42. endif
  43. test_profiles = $(build_profiles)
  44. endif
  45. if BUILD_MCS
  46. MAKE_FLAGS=$(if $(V),,--no-print-directory -s)
  47. # The write check is to foil 'make distcheck'
  48. all-local: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  49. if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
  50. cd $(mcs_topdir) && $(MAKE) $(MAKE_FLAGS) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' CC='$(CC)' all-profiles
  51. # override automake
  52. install: install-exec install-data
  53. # override automake
  54. install-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  55. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles
  56. # override automake
  57. install-data:
  58. @:
  59. # override automake
  60. uninstall:
  61. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles
  62. ## mono --wapi=semdel will probably not delete the semaphore if someone is crazy enough to do a 'make -j distclean' :-)
  63. clean-local:
  64. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' clean-profiles
  65. -./mono-wrapper --wapi=semdel
  66. -rm -fr $(etctmp) $(tmpinst) .wapi
  67. endif BUILD_MCS
  68. TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/mcs $(tmpinst)/bin/gmcs $(tmpinst)/bin/dmcs $(tmpinst)/bin/al2 $(tmpinst)/bin/al
  69. # now a misnomer, but it'll go away soon enough.
  70. if ENABLE_NUNIT_TESTS
  71. test_select =
  72. else
  73. test_select = ONLY_CENTUM_TESTS=yes
  74. endif
  75. mcs-do-test-profiles:
  76. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' test-profiles
  77. mcs-do-run-test-profiles: test-support-files
  78. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-test-profiles
  79. if HOST_WIN32
  80. if CROSS_COMPILING
  81. cur_dir_cmd = pwd
  82. PLATFORM_PATH_SEPARATOR = :
  83. else
  84. cur_dir_cmd = cygpath -w -a .
  85. PLATFORM_PATH_SEPARATOR = ;
  86. endif
  87. else
  88. cur_dir_cmd = pwd
  89. PLATFORM_PATH_SEPARATOR = :
  90. endif
  91. # Compile all assemblies with the verifier turned on. Code must be valid but not verifiable.
  92. # TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode.
  93. # Skip net 4.0 assemblies because the contain metadata only
  94. mcs-compileall: mono-wrapper etc/mono/config
  95. save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
  96. for profile in $(test_profiles); do \
  97. if [ "net_4_0" = "$$profile" ]; then \
  98. continue; \
  99. fi; \
  100. if [ "net_3_5" = "$$profile" ]; then \
  101. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  102. else \
  103. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  104. fi; \
  105. export MONO_PATH; \
  106. for i in $(mcs_topdir)/class/lib/$$profile/*.{dll,exe}; do \
  107. if [ ! -f $$i ] ; then \
  108. continue ; \
  109. fi ; \
  110. if ./mono-wrapper --compile-all --verify-all --security=verifiable $$i; then \
  111. echo $$i verified OK; \
  112. else \
  113. echo $$i verification failed; ok=false; \
  114. fi; done; done; \
  115. $$ok
  116. if NACL_CODEGEN
  117. check-local:
  118. else
  119. check-local: mcs-compileall mcs-do-test-profiles
  120. $(MAKE) $(test_select) mcs-do-run-test-profiles
  121. endif
  122. # Compile all mcs tests
  123. test: mcs-do-test-profiles
  124. CLEANFILES = etc/mono/config
  125. # depend on $(symlinks) to ensure 'etc/mono' directory exists
  126. etc/mono/config: ../data/config Makefile $(symlinks)
  127. d=`cd ../support && pwd`; \
  128. sed 's,target="libMonoPosixHelper[^"]*",target="'$$d/libMonoPosixHelper.la'",' ../data/config > $@t
  129. if test -z "$(libgdiplus_loc)"; then :; else \
  130. sed 's,<configuration>,& <dllmap dll="gdiplus.dll" target="$(libgdiplus_loc)" os="!windows"/>,' $@t > $@tt; \
  131. mv -f $@tt $@t; fi
  132. mv -f $@t $@
  133. $(tmpinst)/bin/mono: mono-wrapper etc/mono/config
  134. $(mkinstalldirs) $(tmpinst)/bin
  135. cp mono-wrapper $@
  136. $(tmpinst)/bin/mcs: $(tmpinst)/bin/mono Makefile
  137. echo '#! /bin/sh' > $@ ; \
  138. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  139. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/build/mcs.exe"'" "$$@"' >> $@ ; \
  140. chmod +x $@
  141. $(tmpinst)/bin/gmcs: $(tmpinst)/bin/mono Makefile
  142. echo '#! /bin/sh' > $@ ; \
  143. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  144. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/build/mcs.exe -sdk:2"'" "$$@"' >> $@ ; \
  145. chmod +x $@
  146. $(tmpinst)/bin/dmcs: $(tmpinst)/bin/mono Makefile
  147. echo '#! /bin/sh' > $@ ; \
  148. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  149. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/build/mcs.exe -sdk:4"'" "$$@"' >> $@ ; \
  150. chmod +x $@
  151. $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
  152. echo '#! /bin/sh' > $@ ; \
  153. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  154. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/ilasm/ilasm.exe"'" "$$@"' >> $@ ; \
  155. chmod +x $@
  156. $(tmpinst)/bin/al2: $(tmpinst)/bin/mono Makefile
  157. echo '#! /bin/sh' > $@ ; \
  158. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  159. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/net_2_0/al.exe"'" "$$@"' >> $@ ; \
  160. chmod +x $@
  161. $(tmpinst)/bin/al: $(tmpinst)/bin/mono Makefile
  162. echo '#! /bin/sh' > $@ ; \
  163. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  164. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(al_profile)/al.exe"'" "$$@"' >> $@ ; \
  165. chmod +x $@
  166. test-support-files: $(TEST_SUPPORT_FILES)
  167. @:
  168. # the 'cygnus' option also disables the default 'distdir:' target, which we _do_ want
  169. MYDISTFILES = $(DIST_COMMON)
  170. distdir: $(MYDISTFILES)
  171. rm -fr $(distdir)
  172. mkdir $(distdir)
  173. test -z '$(MYDISTFILES)' || for file in ''$(MYDISTFILES); do \
  174. cp -p $$file $(distdir) ; done
  175. find $(distdir) -type f -exec chmod a+r {} ';'