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