Merge pull request #216 from ilkerde/master
[mono.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2
3 MOONLIGHT_SUBDIRS = $(libgc_dir) eglib/src mono
4
5 if CROSS_COMPILING
6 SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) data runtime scripts man samples msvc $(docs_dir)
7 # Keep in sync with SUBDIRS
8 ## 'tools' is not normally built
9 DIST_SUBDIRS = m4 po libgc eglib mono ikvm-native data runtime scripts man samples tools msvc docs
10 else
11 if ONLY_MOONLIGHT
12 SUBDIRS = $(MOONLIGHT_SUBDIRS) runtime
13 else
14 SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir)
15 # Keep in sync with SUBDIRS
16 ## 'tools' is not normally built
17 DIST_SUBDIRS = m4 po libgc eglib mono ikvm-native support data runtime scripts man samples tools msvc docs
18 endif
19 endif
20
21 all: update_submodules
22
23 SUBMODULE_ERROR='Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date'
24 update_submodules:
25         @./scripts/update_submodules
26
27 .PHONY: update_submodules
28
29 EXTRA_DIST= \
30             LICENSE \
31             autogen.sh \
32             build-mingw32.sh \
33             mkinstalldirs \
34             mono-uninstalled.pc.in \
35             winconfig.h \
36             mono-core.spec \
37             external
38
39 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
40
41 # Distribute the 'mcs' tree too
42 GIT_DIR ?= $(srcdir)/.git
43 dist-hook:
44         test -d $(distdir)/mcs || mkdir $(distdir)/mcs
45         d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
46 # Disable this for now because it is very slow and causes wrench to timeout:
47 #       test ! -d $(GIT_DIR) || ./scripts/commits-to-changelog.py --root=$(distdir) last-commit-with-compulsory-changelog-entry
48
49 pkgconfigdir = $(libdir)/pkgconfig
50 noinst_DATA = mono-uninstalled.pc
51 DISTCLEANFILES= mono-uninstalled.pc
52
53 # building with monolite
54 mcslib = $(mcs_topdir)/class/lib
55 monolite = $(mcslib)/monolite
56 mono_corlib_version = $(shell sed -n "s/\#define MONO_CORLIB_VERSION //p" $(srcdir)/mono/metadata/appdomain.c)
57 monolite_url = http://mono.ximian.com/daily/monolite-$(mono_corlib_version)-latest.tar.gz
58 .PHONY: get-monolite-latest 
59 get-monolite-latest:
60         -rm -fr $(mcslib)/monolite-*
61         -mkdir -p $(mcslib)
62         test ! -d $(monolite) || test ! -d $(monolite).old || rm -fr $(monolite).old
63         test ! -d $(monolite) || mv -f $(monolite) $(monolite).old
64         cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
65         cd $(mcslib) && mv -f monolite-* monolite
66
67 .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
68 validate: do-build-mono-mcs
69         $(MAKE) mcs-do-tests
70 do-build-mono-mcs: mcs-do-clean
71         $(MAKE) all
72 mcs-do-clean:
73         cd runtime && $(MAKE) clean-local
74         cd mono/tests && $(MAKE) clean
75 mcs-do-tests:
76         cd runtime && $(MAKE) check-local
77         cd mono/tests && $(MAKE) check
78
79 .PHONY: compiler-tests mcs-do-compiler-tests
80 compiler-tests:
81         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
82 mcs-do-compiler-tests:
83         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
84
85 .PHONY: bootstrap-world
86 bootstrap-world: compiler-tests
87         $(MAKE) install
88
89 if MOONLIGHT
90 moon-do-build: config.h
91         @list='$(MOONLIGHT_SUBDIRS)'; for subdir in $$list; do \
92           case "x$$subdir" in \
93                 xmono ) target="moon-do-build";; \
94                 * ) target="all";; \
95           esac; \
96           echo "Making $$target in $$subdir"; \
97           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
98         done;
99         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) moon-do-build)
100
101 moon-do-clean:
102         @list='$(MOONLIGHT_SUBDIRS)'; for subdir in $$list; do \
103           case "x$$subdir" in \
104                 xmono ) target="moon-do-clean";; \
105                 * ) target="clean";; \
106           esac; \
107           echo "Making $$target in $$subdir"; \
108           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
109         done;
110         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) moon-do-clean)
111
112 endif
113
114 win32getdeps:
115         wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
116         wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip 
117         wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip 
118         wget http://www.go-mono.com/archive/libiconv-1.7.zip 
119         wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip 
120         wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
121         unzip -n -d / pkgconfig-0.11-20020310.zip
122         unzip -n -d / glib-2.0.4-20020703.zip
123         unzip -n -d / glib-dev-2.0.4-20020703.zip
124         unzip -n -d / libiconv-1.7.zip
125         unzip -n -d / libiconv-dev-1.7.zip
126         unzip -n -d / libintl-0.10.40-20020101.zip
127
128 win32setup:
129         makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi
130
131 patch-quiet:
132         find mono -name Makefile -exec scripts/patch-quiet.sh {} \;
133         find libgc -name Makefile -exec scripts/patch-quiet.sh {} \;
134
135 update-csproj:
136         -rm msvc/scripts/order 
137         -mkdir msvc/scripts/inputs
138         (cd runtime; make V=1 extra_targets=csproj-local)
139
140 package-inputs:
141         echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
142         echo '<root>' >> msvc/scripts/order.xml
143         for i in `cat msvc/scripts/order`; do \
144                 set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
145                 cat msvc/scripts/inputs/$$2.input | \
146                 (echo "    <project dir=\"$$1\" library=\"$$2\">"; \
147                  read boot;   echo "      <boot>$$boot</boot>"; \
148                  read mcs;    echo "      <mcs>$$mcs</mcs>"; \
149                  read flags;  echo "      <flags>$$flags</flags>"; \
150                  read output; echo "      <output>$$output</output>"; \
151                  read built;  echo "      <built_sources>$$built</built_sources>"; \
152                  read libou;  echo "      <library_output>$$libou</library_output>"; \
153                  read fx_ver; echo "      <fx_version>$$fx_ver</fx_version>"; \
154                  read resp;   echo "      <response>$$resp</response>"; \
155                 echo "    </project>") >> msvc/scripts/order.xml; \
156         done
157         echo "</root>" >> msvc/scripts/order.xml