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