Makefile.am 4.7 KB

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