Makefile.am 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 etc/mono/browscap.ini
  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. $(symlinks):
  12. cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
  13. SUPPORT_FILES = $(symlinks) mono-wrapper etc/mono/config
  14. if INSTALL_2_0
  15. if INSTALL_2_1
  16. build_profiles = default net_2_0 net_2_1
  17. else
  18. build_profiles = default net_2_0
  19. endif
  20. else
  21. build_profiles = default
  22. endif
  23. if BUILD_MCS
  24. # The write check is to foil 'make distcheck'
  25. all-local: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  26. if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
  27. cd $(mcs_topdir) && $(MAKE) PROFILES='$(build_profiles)' CC='$(CC)' all-profiles
  28. # override automake
  29. install: install-exec install-data
  30. # override automake
  31. install-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
  32. cd $(mcs_topdir) && $(MAKE) PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles
  33. # override automake
  34. install-data:
  35. @:
  36. # override automake
  37. uninstall:
  38. cd $(mcs_topdir) && $(MAKE) PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles
  39. ## semdel-wrapper will probably not delete the semaphore if someone is crazy enough to do a 'make -j distclean' :-)
  40. clean-local:
  41. cd $(mcs_topdir) && $(MAKE) PROFILES='$(build_profiles)' clean-profiles
  42. -./semdel-wrapper
  43. -rm -fr $(etctmp) $(tmpinst) .wapi
  44. endif BUILD_MCS
  45. TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/bin/ilasm $(tmpinst)/bin/gmcs
  46. # now a misnomer, but it'll go away soon enough.
  47. if ENABLE_NUNIT_TESTS
  48. test_select =
  49. else
  50. test_select = ONLY_CENTUM_TESTS=yes
  51. endif
  52. mcs-do-test-profiles:
  53. cd $(mcs_topdir) && $(MAKE) PROFILES='$(build_profiles)' test-profiles
  54. mcs-do-run-test-profiles: test-support-files
  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. $(mkinstalldirs) $(tmpinst)/bin
  88. cp mono-wrapper $@
  89. $(tmpinst)/bin/mcs: $(tmpinst)/bin/mono Makefile
  90. echo '#! /bin/sh' > $@ ; \
  91. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  92. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/default/mcs.exe"'" "$$@"' >> $@ ; \
  93. chmod +x $@
  94. $(tmpinst)/bin/gmcs: $(tmpinst)/bin/mono Makefile
  95. echo '#! /bin/sh' > $@ ; \
  96. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  97. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/gmcs/gmcs.exe"'" "$$@"' >> $@ ; \
  98. chmod +x $@
  99. $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
  100. echo '#! /bin/sh' > $@ ; \
  101. r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
  102. echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/ilasm/ilasm.exe"'" "$$@"' >> $@ ; \
  103. chmod +x $@
  104. test-support-files: $(TEST_SUPPORT_FILES)
  105. @:
  106. # the 'cygnus' option also disables the default 'distdir:' target, which we _do_ want
  107. MYDISTFILES = $(DIST_COMMON)
  108. distdir: $(MYDISTFILES)
  109. rm -fr $(distdir)
  110. mkdir $(distdir)
  111. test -z '$(MYDISTFILES)' || for file in ''$(MYDISTFILES); do \
  112. cp -p $$file $(distdir) ; done
  113. find $(distdir) -type f -exec chmod a+r {} ';'