[csproj] Update project files
[mono-project.git] / Makefile.am
blob561dcfe436663dc1151c2fa0c485bc190c335f97
1 ACLOCAL_AMFLAGS = -I m4
3 AM_CFLAGS = $(WERROR_CFLAGS)
5 MONOTOUCH_SUBDIRS = $(libgc_dir) mono
7 # Some tools might not build when cross-compiling
8 if CROSS_COMPILING
9 tools_dir =
10 else
11 tools_dir = tools
12 endif
14 if ENABLE_MSVC
15 build_with_msvc = msvc
16 build_without_msvc =
17 else
18 build_with_msvc =
19 build_without_msvc = msvc
20 endif
22 SUBDIRS = $(build_with_msvc) mk po $(libgc_dir) llvm mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) $(build_without_msvc) $(docs_dir) acceptance-tests
23 # Keep in sync with SUBDIRS
24 DIST_SUBDIRS = $(build_with_msvc) m4 mk po $(libgc_dir) llvm mono ikvm-native support data runtime scripts man samples tools $(build_without_msvc) docs acceptance-tests
26 all: update_submodules
28 SUBMODULE_ERROR='Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date'
29 update_submodules:
30         @$(srcdir)/scripts/update_submodules.sh
32 .PHONY: update_submodules
34 EXTRA_DIST= \
35         README.md               \
36         LICENSE                 \
37         autogen.sh              \
38         mkinstalldirs           \
39         mono-uninstalled.pc.in  \
40         winconfig.h             \
41         code_of_conduct.md      \
42         external                \
43         mcs/class/referencesource
45 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
47 # Distribute the 'mcs' tree too
48 GIT_DIR ?= $(srcdir)/.git
49 dist-hook:
50         test -d $(distdir)/mcs || mkdir $(distdir)/mcs
51         d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
52         rm -rf `find $(top_distdir)/external -path '*\.git'`
53         rm -rf `find $(top_distdir)/external -path '*\.libs'`
54         rm -rf `find $(top_distdir)/external -path '*\.deps'`
55         rm -f `find $(top_distdir)/external -path '*\.o'`
56         rm -f `find $(top_distdir)/external -path '*\.so'`
57         rm -f `find $(top_distdir)/external -path '*\.lo'`
58         rm -f `find $(top_distdir)/external -path '*\.Plo'`
59         rm -f `find $(top_distdir)/external -name '\.dirstamp'`
60         rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
61         rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*'`
62         rm -rf "$(top_distdir)/external/linker/linker/Tests"
64 pkgconfigdir = $(libdir)/pkgconfig
65 noinst_DATA = mono-uninstalled.pc
66 DISTCLEANFILES= mono-uninstalled.pc
68 # building with monolite
69 .PHONY: get-monolite-latest 
70 get-monolite-latest:
71         $(MAKE) -C $(mcs_topdir)/class get-monolite-latest
73 if BITCODE
74 BITCODE_CHECK=yes
75 endif
77 .PHONY: check-ci
78 check-ci:
79         MONO_LLVMONLY=$(BITCODE_CHECK) $(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
81 .PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
82 validate: do-build-mono-mcs
83         $(MAKE) mcs-do-tests
84 do-build-mono-mcs: mcs-do-clean
85         $(MAKE) all
86 mcs-do-clean:
87         cd runtime && $(MAKE) clean-local
88         cd mono/tests && $(MAKE) clean
89 mcs-do-tests:
90         cd runtime && $(MAKE) check-local
91         cd mono/tests && $(MAKE) check
93 .PHONY: compiler-tests mcs-do-compiler-tests
94 compiler-tests:
95         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
96 mcs-do-compiler-tests:
97         $(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
99 .PHONY: bootstrap-world
100 bootstrap-world: compiler-tests
101         $(MAKE) install
103 if INSTALL_MONOTOUCH
104 monotouch-do-build: config.h
105         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
106           case "x$$subdir" in \
107                 xmono ) target="monotouch-do-build";; \
108                 * ) target="all";; \
109           esac; \
110           echo "Making $$target in $$subdir"; \
111           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
112         done;
113         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-build)
115 monotouch-do-clean:
116         @list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
117           case "x$$subdir" in \
118                 xmono ) target="monotouch-do-clean";; \
119                 * ) target="clean";; \
120           esac; \
121           echo "Making $$target in $$subdir"; \
122           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
123         done;
124         (cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-clean)
126 endif
128 update-csproj:
129         -rm msvc/scripts/order 
130         -rm msvc/scripts/order.xml
131         -rm -rf msvc/scripts/inputs
132         -mkdir msvc/scripts/inputs
133         (cd runtime; $(MAKE) V=1 extra_targets=csproj-local)
135 package-inputs:
136         echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
137         echo '<root>' >> msvc/scripts/order.xml
138         for i in `cat msvc/scripts/order`; do \
139                 set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
140                 cat msvc/scripts/inputs/$$2.input | sed -e 's/\\\\/\\/g' -e 's/\\/\\\\/g' | \
141                 (echo "    <project dir=\"$$1\" library=\"$$2\">"; \
142                  read boot;   echo "      <boot>$$boot</boot>"; \
143                  read flags;  echo "      <flags>$$flags</flags>"; \
144                  read sources;echo "      <sources>$$sources</sources>"; \
145                  read output; echo "      <output>$$output</output>"; \
146                  read built;  echo "      <built_sources>`echo $$built | sed 's/\\\/\\\\/g'`</built_sources>"; \
147                  read libou;  echo "      <library_output>$$libou</library_output>"; \
148                  read fx_ver; echo "      <fx_version>$$fx_ver</fx_version>"; \
149                  read profile; echo "      <profile>$$profile</profile>"; \
150                  read resxt;  echo "      <resources>$$resxt</resources>"; \
151                  read resp;   echo "      <response>$$resp</response>"; \
152                  echo "    </project>") >> msvc/scripts/order.xml; \
153         done
154         echo "</root>" >> msvc/scripts/order.xml
156 # Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
157 update-llvm-version:
158         if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
159         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."
162 update-solution-files:
163         cd msvc/scripts && $(MAKE) genproj.exe || exit $$?;
164         $(MAKE) update-csproj
165         $(MAKE) package-inputs
166         (cd msvc/scripts; mono --debug genproj.exe $(GENPROJ_ARGS))
168 update-solution-files-with-tests:
169         $(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files