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