Makefile.am 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. AUTOMAKE_OPTIONS = foreign
  2. ACLOCAL_AMFLAGS = -I .
  3. SUBDIRS = $(libgc_dir) mono $(ikvm_jni_dir) docs data runtime scripts man samples support web
  4. # Keep in sync with SUBDIRS
  5. ## 'tools' is not normally built
  6. DIST_SUBDIRS = libgc mono ikvm-jni docs data runtime scripts man samples support web tools
  7. EXTRA_DIST= mono.pc.in mono.spec.in mint.pc.in
  8. pkgconfigdir = $(libdir)/pkgconfig
  9. if JIT_SUPPORTED
  10. pkgconfig_DATA= mono.pc mint.pc
  11. else
  12. pkgconfig_DATA= mint.pc
  13. endif
  14. DISTCLEANFILES= mono.pc mint.pc
  15. #
  16. # The following targets are used to compile and install
  17. # mono and mcs without running into the out-of-sync
  18. # problems by doing the compilation in the right order.
  19. #
  20. mcs_topdir=$(top_srcdir)/../mcs
  21. .PHONY: bootstrap faststrap fasterstrap bootstrap-clean bootstrap-check get-monolite-latest monolite-bootstrap
  22. .PHONY: tmpinst-dir tmpinst-mcs-basic-build tmpinst-mcs-short-build tmpinst-mcs-full-build tmpinst-monolite
  23. .PHONY: mono-do-runtime-only mcs-do-basic-build mcs-do-short-build mcs-do-full-build mcs-do-clean-profiles mcs-do-run-test
  24. .PHONY: populate-runtime-subdir
  25. if USE_JIT
  26. mono_runtime = mono/mini/mono
  27. else
  28. mono_runtime = mono/interpreter/mint
  29. endif
  30. # Minimal set of directories to build, and files used to run the 'mcs' compiler
  31. MCS_BASIC_DIRS = jay mcs class/corlib class/System
  32. MCS_BASIC_FILES = \
  33. $(mcs_topdir)/mcs/mcs.exe \
  34. $(mcs_topdir)/class/lib/default/mscorlib.dll \
  35. $(mcs_topdir)/class/lib/default/System.dll
  36. # Set of directories and files the 'mcs' compiler can use
  37. ## We build class/System twice to resolve the cyclic dependency of class/System.XML
  38. MCS_DIRS = $(MCS_BASIC_DIRS) class/System.XML class/System class/Mono.CSharp.Debugger
  39. MCS_FILES = $(MCS_BASIC_FILES) \
  40. $(mcs_topdir)/class/lib/default/System.Xml.dll \
  41. $(mcs_topdir)/class/lib/default/Mono.CompilerServices.SymbolWriter.dll
  42. tmpinst = _tmpinst
  43. if PLATFORM_WIN32
  44. populate_profiles = default:net_1_1
  45. # bootstraps using the .NET C# compiler
  46. bootstrap: tmpinst-dir mono-do-runtime-only
  47. $(MAKE) fasterstrap
  48. else
  49. populate_profiles = default:net_1_1 net_2_0:net_2_0
  50. bootstrap: tmpinst-mcs-basic-build mono-do-runtime-only
  51. $(MAKE) tmpinst-mcs-short-build
  52. $(MAKE) fasterstrap
  53. endif
  54. faststrap: tmpinst-mcs-short-build
  55. $(MAKE) mono-do-runtime-only
  56. $(MAKE) fasterstrap
  57. fasterstrap: tmpinst-mcs-full-build
  58. $(MAKE) populate-runtime-subdir
  59. $(MAKE)
  60. bootstrap-clean: clean mcs-do-clean-profiles
  61. bootstrap-check: check mcs-do-run-test
  62. # building with monolite
  63. get-monolite-latest:
  64. wget -O $(srcdir)/../monolite-latest.tar.gz http://www.go-mono.com/daily/monolite-latest.tar.gz
  65. monolite-bootstrap: tmpinst-monolite mono-do-runtime-only
  66. rm -f $(MCS_FILES)
  67. $(MAKE) tmpinst-mcs-short-build
  68. $(MAKE) fasterstrap
  69. bootstrap-world:
  70. $(MAKE) bootstrap-clean
  71. $(MAKE) bootstrap
  72. $(MAKE) install
  73. $(MAKE) mcs-do-compiler-tests
  74. # internal targets
  75. tmpinst-mcs-basic-build: mcs-do-basic-build tmpinst-dir
  76. mv -f $(MCS_BASIC_FILES) $(tmpinst)/lib
  77. tmpinst-mcs-short-build: mcs-do-short-build tmpinst-dir
  78. mv -f $(MCS_FILES) $(tmpinst)/lib
  79. tmpinst-mcs-full-build: mcs-do-full-build tmpinst-dir
  80. cp -f $(MCS_FILES) $(tmpinst)/lib
  81. tmpinst-monolite: tmpinst-dir
  82. -rm -f $(tmpinst)/lib/mcs.exe $(tmpinst)/lib/*.dll
  83. -rm -fr $(tmpinst)/monolite-*
  84. srcdir=`cd $(srcdir) && pwd` && cd $(tmpinst) && ( gzip -d -c $$srcdir/../monolite-latest.tar.gz | tar xf - )
  85. mv -f $(tmpinst)/monolite-*/mcs.exe $(tmpinst)/monolite-*/*.dll $(tmpinst)/lib
  86. rm -fr $(tmpinst)/monolite-*
  87. # Build enough of 'mono' to run the stage1 mcs.exe
  88. mono-do-runtime-only: $(CONFIG_HEADER)
  89. for dir in $(libgc_dir) mono data; do \
  90. (cd $$dir && $(MAKE)) || exit 1 ; \
  91. done
  92. mcs-do-basic-build:
  93. rm -f $(MCS_FILES)
  94. for dir in $(MCS_BASIC_DIRS); do \
  95. (cd $(mcs_topdir)/$$dir && $(MAKE) PROFILE=default NO_SIGN_ASSEMBLY=yes USE_BOOT_COMPILE=yes BOOTSTRAP_MCS="mcs -d:BOOTSTRAP_WITH_OLDLIB") || exit 1 ; \
  96. done
  97. mcs-do-short-build:
  98. tmpinst=`cd $(tmpinst) && pwd` ; \
  99. PATH=$$tmpinst/bin:$$PATH; export PATH ; \
  100. for dir in $(MCS_DIRS); do \
  101. (cd $(mcs_topdir)/$$dir && $(MAKE) PROFILE=default NO_SIGN_ASSEMBLY=yes) || exit 1 ; \
  102. done
  103. mcs-do-full-build:
  104. tmpinst=`cd $(tmpinst) && pwd` ; \
  105. PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
  106. cd $(mcs_topdir) && $(MAKE) all-profiles
  107. mcs-do-clean-profiles:
  108. cd $(mcs_topdir) && $(MAKE) clean-profiles
  109. mcs-do-run-test: tmpinst-dir $(tmpinst)/bin/mbas
  110. tmpinst=`cd $(tmpinst) && pwd` ; \
  111. PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
  112. cd $(mcs_topdir) && $(MAKE) PROFILE=default run-test
  113. mcs-do-compiler-tests:
  114. cd $(mcs_topdir) && $(MAKE) test-compiler
  115. populate-runtime-subdir:
  116. test -n '$(populate_profiles)'
  117. @srcdir=`cd $(srcdir) && pwd`; tmpinst=`pwd`/$(tmpinst) ; \
  118. PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
  119. for profile in $(populate_profiles); do \
  120. ( set fnord `echo $$profile | sed 's,:, ,g'` && \
  121. echo "cd $(mcs_topdir) && $(MAKE) PROGRAM_INSTALL_DIR=$$srcdir/runtime PROFILE=$$2 LIBRARY_INSTALL_DIR=$$srcdir/runtime/$$3 prefix=$$tmpinst/prefix install" && \
  122. cd $(mcs_topdir) && \
  123. $(MAKE) PROGRAM_INSTALL_DIR=$$srcdir/runtime PROFILE=$$2 LIBRARY_INSTALL_DIR=$$srcdir/runtime/$$3 prefix=$$tmpinst/prefix install ) || exit 1 ; \
  124. done
  125. find $(tmpinst)/prefix -type f -path '*/jay*' -exec rm -f '{}' ';'
  126. test -z "`find $(tmpinst)/prefix -type f -print`"
  127. rm -rf $(tmpinst)/prefix
  128. tmpinst-dir:
  129. mkdir -p $(tmpinst) $(tmpinst)/bin $(tmpinst)/lib $(tmpinst)/etc/mono/1.0
  130. $(MAKE) tmpinst-dir-contents
  131. tmpinst-dir-contents: $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/etc/mono/1.0/machine.config
  132. if PLATFORM_WIN32
  133. $(tmpinst)/bin/mono: $(srcdir)/Makefile.am
  134. echo '#! /bin/sh' > $@
  135. echo 'builddir="'`pwd`'"; win_builddir="'`cygpath -w -a .`'"' >> $@
  136. echo 'tmpinst="$$win_builddir\\$(tmpinst)"' >> $@
  137. echo 'if test -z "$$MONO_PATH" ; then MONO_PATH="$$tmpinst\\lib"; else MONO_PATH="$${MONO_PATH};$$tmpinst\\lib" ; fi' >> $@
  138. echo 'MONO_CFG_DIR="$$tmpinst\\etc"' >> $@
  139. echo 'export MONO_PATH MONO_CFG_DIR' >> $@
  140. echo 'exec "$$builddir/libtool" --mode=execute "$$builddir/$(mono_runtime).exe" "$$@"' >> $@
  141. chmod +x $@
  142. else
  143. $(tmpinst)/bin/mono: $(srcdir)/Makefile.am
  144. echo '#! /bin/sh' > $@
  145. echo 'builddir="'`pwd`'"; tmpinst=$$builddir/$(tmpinst)' >> $@
  146. echo 'if test -z "$$MONO_PATH" ; then MONO_PATH=$$tmpinst/lib; else MONO_PATH=$${MONO_PATH}:$$tmpinst/lib ; fi' >> $@
  147. echo 'MONO_CFG_DIR=$$tmpinst/etc' >> $@
  148. echo 'export MONO_PATH MONO_CFG_DIR' >> $@
  149. echo 'exec "$$builddir/libtool" --mode=execute "$$builddir/$(mono_runtime)" --config "$$builddir/data/config" "$$@"' >> $@
  150. chmod +x $@
  151. endif
  152. $(tmpinst)/bin/mcs: $(srcdir)/Makefile.am
  153. (t=`cd $(tmpinst) && pwd`; echo '#! /bin/sh'; echo 'exec "'"$$t/bin/mono"'" "'"$$t/lib/mcs.exe"'" "$$@"') > $@
  154. chmod +x $@
  155. # Used only by 'bootstrap-check' -- so, can safely use runtime/mbas.exe.
  156. $(tmpinst)/bin/mbas: $(srcdir)/Makefile.am
  157. t=`cd $(tmpinst) && pwd`; r=`cd $(srcdir)/runtime && pwd`; \
  158. ( echo '#! /bin/sh'; echo 'exec "'"$$t/bin/mono"'" "'"$$r/mbas.exe"'" "$$@"' ) > $@
  159. chmod +x $@
  160. $(tmpinst)/etc/mono/1.0/machine.config: $(srcdir)/data/net_1_1/machine.config
  161. rm -f $@
  162. srcdir=`cd $(srcdir) && pwd`; cd $(tmpinst)/etc/mono/1.0 && $(LN_S) $$srcdir/data/net_1_1/machine.config machine.config
  163. # Obsolete target -- don't use.
  164. .PHONY: fullbuild
  165. fullbuild: bootstrap
  166. $(MAKE) install
  167. echo "*** 'fullbuild' is an obsolete target. Use 'make bootstrap && make install'."
  168. exit 1
  169. win32getdeps:
  170. wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
  171. wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip
  172. wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip
  173. wget http://www.go-mono.com/archive/libiconv-1.7.zip
  174. wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip
  175. wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
  176. wget http://www.jroith.de/nsis4cygwin.zip
  177. unzip -n -d / pkgconfig-0.11-20020310.zip
  178. unzip -n -d / glib-2.0.4-20020703.zip
  179. unzip -n -d / glib-dev-2.0.4-20020703.zip
  180. unzip -n -d / libiconv-1.7.zip
  181. unzip -n -d / libiconv-dev-1.7.zip
  182. unzip -n -d / libintl-0.10.40-20020101.zip
  183. unzip -n -d / nsis4cygwin.zip
  184. win32setup:
  185. makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi