Makefile.am 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. # hack to prevent 'check' from depending on 'all'
  2. AUTOMAKE_OPTIONS = cygnus
  3. tmpinst = _tmpinst
  4. noinst_SCRIPTS = mono-wrapper monodis-wrapper
  5. etctmp = etc
  6. 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
  7. etc/mono/1.0/machine.config: $(top_srcdir)/data/net_1_1/machine.config
  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. $(symlinks):
  13. cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
  14. SUPPORT_FILES = $(symlinks) mono-wrapper etc/mono/config
  15. if INSTALL_2_0
  16. if INSTALL_2_1
  17. build_profiles = default net_2_0 net_3_5 net_2_1
  18. else
  19. build_profiles = default net_2_0 net_3_5
  20. endif
  21. else
  22. build_profiles = default
  23. endif
  24. if BUILD_MCS
  25. # The write check is to foil 'make distcheck'
  26. all-local: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  27. if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
  28. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' CC='$(CC)' all-profiles
  29. # override automake
  30. install: install-exec install-data
  31. # override automake
  32. install-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  33. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles
  34. # override automake
  35. install-data:
  36. @:
  37. # override automake
  38. uninstall:
  39. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles
  40. ## mono --wapi=semdel will probably not delete the semaphore if someone is crazy enough to do a 'make -j distclean' :-)
  41. clean-local:
  42. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' clean-profiles
  43. -./mono-wrapper --wapi=semdel
  44. -rm -fr $(etctmp) $(tmpinst) .wapi
  45. endif BUILD_MCS
  46. TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/bin/ilasm $(tmpinst)/bin/gmcs
  47. # now a misnomer, but it'll go away soon enough.
  48. if ENABLE_NUNIT_TESTS
  49. test_select =
  50. else
  51. test_select = ONLY_CENTUM_TESTS=yes
  52. endif
  53. mcs-do-test-profiles:
  54. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' test-profiles
  55. mcs-do-run-test-profiles: test-support-files
  56. cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' run-test-profiles
  57. if PLATFORM_WIN32
  58. cur_dir_cmd = cygpath -w -a .
  59. PLATFORM_PATH_SEPARATOR = ;
  60. else
  61. cur_dir_cmd = pwd
  62. PLATFORM_PATH_SEPARATOR = :
  63. endif
  64. # Compile all assemblies with the verifier turned on. Code must be valid but not verifiable.
  65. # TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode.
  66. # Skip net 2.1 assemblies for now because of visibility problems
  67. mcs-compileall: mono-wrapper etc/mono/config
  68. save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
  69. for profile in $(build_profiles); do \
  70. if [ "net_2_1" = "$$profile" ]; then \
  71. break; \
  72. fi; \
  73. if [ "net_3_5" = "$$profile" ]; then \
  74. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  75. else \
  76. MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
  77. fi; \
  78. export MONO_PATH; \
  79. for i in $(mcs_topdir)/class/lib/$$profile/*.{dll,exe}; do \
  80. if [ ! -f $$i ] ; then \
  81. continue ; \
  82. fi ; \
  83. if ./mono-wrapper --compile-all --security=validil --verify-all $$i; then \
  84. echo $$i verified OK; \
  85. else \
  86. echo $$i verification failed; ok=false; \
  87. fi; done; done; \
  88. $$ok
  89. check-local: mcs-compileall mcs-do-test-profiles
  90. $(MAKE) $(test_select) mcs-do-run-test-profiles
  91. CLEANFILES = etc/mono/config
  92. # depend on $(symlinks) to ensure 'etc/mono' directory exists
  93. etc/mono/config: ../data/config Makefile $(symlinks)
  94. d=`cd ../support && pwd`; \
  95. sed 's,target="libMonoPosixHelper[^"]*",target="'$$d/libMonoPosixHelper.la'",' ../data/config > $@t
  96. if test -z "$(libgdiplus_loc)"; then :; else \
  97. sed 's,<configuration>,& <dllmap dll="gdiplus.dll" target="$(libgdiplus_loc)" />,' $@t > $@tt; \
  98. mv -f $@tt $@t; fi
  99. mv -f $@t $@
  100. $(tmpinst)/bin/mono: mono-wrapper etc/mono/config
  101. $(mkinstalldirs) $(tmpinst)/bin
  102. cp mono-wrapper $@
  103. $(tmpinst)/bin/mcs: $(tmpinst)/bin/mono Makefile
  104. echo '#! /bin/sh' > $@ ; \
  105. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  106. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/default/mcs.exe"'" "$$@"' >> $@ ; \
  107. chmod +x $@
  108. $(tmpinst)/bin/gmcs: $(tmpinst)/bin/mono Makefile
  109. echo '#! /bin/sh' > $@ ; \
  110. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  111. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/net_2_0/gmcs.exe"'" "$$@"' >> $@ ; \
  112. chmod +x $@
  113. $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
  114. echo '#! /bin/sh' > $@ ; \
  115. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  116. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/ilasm/ilasm.exe"'" "$$@"' >> $@ ; \
  117. chmod +x $@
  118. test-support-files: $(TEST_SUPPORT_FILES)
  119. @:
  120. # the 'cygnus' option also disables the default 'distdir:' target, which we _do_ want
  121. MYDISTFILES = $(DIST_COMMON)
  122. distdir: $(MYDISTFILES)
  123. rm -fr $(distdir)
  124. mkdir $(distdir)
  125. test -z '$(MYDISTFILES)' || for file in ''$(MYDISTFILES); do \
  126. cp -p $$file $(distdir) ; done
  127. find $(distdir) -type f -exec chmod a+r {} ';'