Merge pull request #1857 from slluis/fix-assembly-resolver
[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             mkinstalldirs \
40             mono-uninstalled.pc.in \
41             winconfig.h \
42             external
43
44 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
45
46 # Distribute the 'mcs' tree too
47 GIT_DIR ?= $(srcdir)/.git
48 dist-hook:
49         test -d $(distdir)/mcs || mkdir $(distdir)/mcs
50         d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
51         rm -rf `find $(top_distdir)/external -path '*\.git'`
52         rm -f `find $(top_distdir)/external -path '*\.exe'`
53         rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*'`
54         cp mcs/class/lib/basic/System.Configuration.dll mcs/class/lib/monolite/
55         cp mcs/class/lib/basic/System.Security.dll mcs/class/lib/monolite/
56 # Disable this for now because it is very slow and causes wrench to timeout:
57 #       test ! -d $(GIT_DIR) || ./scripts/commits-to-changelog.py --root=$(distdir) last-commit-with-compulsory-changelog-entry
58
59 pkgconfigdir = $(libdir)/pkgconfig
60 noinst_DATA = mono-uninstalled.pc
61 DISTCLEANFILES= mono-uninstalled.pc
62
63 # building with monolite
64 mcslib = $(mcs_topdir)/class/lib
65 monolite = $(mcslib)/monolite
66 mono_corlib_version = $(shell sed -n "s/\#define MONO_CORLIB_VERSION //p" $(srcdir)/mono/metadata/appdomain.c)
67 monolite_url = http://storage.bos.xamarin.com/mono-dist-master/latest/monolite-$(mono_corlib_version)-latest.tar.gz
68 .PHONY: get-monolite-latest 
69 get-monolite-latest:
70         -rm -fr $(mcslib)/monolite-*
71         -mkdir -p $(mcslib)
72         test ! -d $(monolite) || test ! -d $(monolite).old || rm -fr $(monolite).old
73         test ! -d $(monolite) || mv -f $(monolite) $(monolite).old
74         cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
75         cd $(mcslib) && mv -f monolite-* monolite
76
77 .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
78 validate: do-build-mono-mcs
79         $(MAKE) mcs-do-tests
80 do-build-mono-mcs: mcs-do-clean
81         $(MAKE) all
82 mcs-do-clean:
83         cd runtime && $(MAKE) clean-local
84         cd mono/tests && $(MAKE) clean
85 mcs-do-tests:
86         cd runtime && $(MAKE) check-local
87         cd mono/tests && $(MAKE) check
88
89 .PHONY: compiler-tests mcs-do-compiler-tests
90 compiler-tests:
91         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
92 mcs-do-compiler-tests:
93         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
94
95 .PHONY: bootstrap-world
96 bootstrap-world: compiler-tests
97         $(MAKE) install
98
99 if INSTALL_MONOTOUCH
100 monotouch-do-build: config.h
101         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
102           case "x$$subdir" in \
103                 xmono ) target="monotouch-do-build";; \
104                 * ) target="all";; \
105           esac; \
106           echo "Making $$target in $$subdir"; \
107           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
108         done;
109         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-build)
110
111 monotouch-do-clean:
112         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
113           case "x$$subdir" in \
114                 xmono ) target="monotouch-do-clean";; \
115                 * ) target="clean";; \
116           esac; \
117           echo "Making $$target in $$subdir"; \
118           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
119         done;
120         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-clean)
121
122 endif
123
124 win32getdeps:
125         wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
126         wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip 
127         wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip 
128         wget http://www.go-mono.com/archive/libiconv-1.7.zip 
129         wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip 
130         wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
131         unzip -n -d / pkgconfig-0.11-20020310.zip
132         unzip -n -d / glib-2.0.4-20020703.zip
133         unzip -n -d / glib-dev-2.0.4-20020703.zip
134         unzip -n -d / libiconv-1.7.zip
135         unzip -n -d / libiconv-dev-1.7.zip
136         unzip -n -d / libintl-0.10.40-20020101.zip
137
138 win32setup:
139         makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi
140
141 update-csproj:
142         -rm msvc/scripts/order 
143         -rm msvc/scripts/order.xml
144         -rm -rf msvc/scripts/inputs
145         -mkdir msvc/scripts/inputs
146         (cd runtime; make V=1 extra_targets=csproj-local)
147
148 package-inputs:
149         echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
150         echo '<root>' >> msvc/scripts/order.xml
151         for i in `cat msvc/scripts/order`; do \
152                 set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
153                 cat msvc/scripts/inputs/$$2.input | sed -e 's/\\\\/\\/g' -e 's/\\/\\\\/g' | \
154                 (echo "    <project dir=\"$$1\" library=\"$$2\">"; \
155                  read boot;   echo "      <boot>$$boot</boot>"; \
156                  read flags;  echo "      <flags>$$flags</flags>"; \
157                  read output; echo "      <output>$$output</output>"; \
158                  read built;  echo "      <built_sources>`echo $$built | sed 's/\\\/\\\\/g'`</built_sources>"; \
159                  read libou;  echo "      <library_output>$$libou</library_output>"; \
160                  read fx_ver; echo "      <fx_version>$$fx_ver</fx_version>"; \
161                  read profile; echo "      <profile>$$profile</profile>"; \
162                  read resp;   echo "      <response>$$resp</response>"; \
163                  echo "    </project>") >> msvc/scripts/order.xml; \
164         done
165         echo "</root>" >> msvc/scripts/order.xml
166
167 # Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
168 update-llvm-version:
169         if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
170         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."
171
172