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