Makefile.am 7.6 KB

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