New test + update
[mono.git] / runtime / Makefile.am
1 # hack to prevent 'check' from depending on 'all'
2 AUTOMAKE_OPTIONS = cygnus
3
4 tmpinst = _tmpinst
5
6 noinst_SCRIPTS = mono-wrapper monodis-wrapper
7
8 etctmp = etc
9 symlinks = etc/mono/1.0/machine.config etc/mono/2.0/machine.config etc/mono/2.0/web.config etc/mono/browscap.ini
10
11 etc/mono/1.0/machine.config: $(top_srcdir)/data/net_1_1/machine.config
12 etc/mono/2.0/machine.config: $(top_srcdir)/data/net_2_0/machine.config
13 etc/mono/2.0/web.config: $(top_srcdir)/data/net_2_0/web.config
14 etc/mono/browscap.ini: $(top_srcdir)/data/browscap.ini
15
16 $(symlinks):
17         cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
18
19 SUPPORT_FILES = $(symlinks) mono-wrapper etc/mono/config
20
21 if INSTALL_2_0
22 if INSTALL_2_1
23 build_profiles = default net_2_0 net_3_5 net_2_1
24 else
25 build_profiles = default net_2_0 net_3_5
26 endif
27 else
28 build_profiles = default
29 endif
30
31 if BUILD_MCS
32
33 # The write check is to foil 'make distcheck'
34 all-local: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
35         if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi
36         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' CC='$(CC)' all-profiles
37
38 # override automake
39 install: install-exec install-data
40
41 # override automake
42 install-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES)
43         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles
44
45 # override automake
46 install-data:
47         @:
48
49 # override automake
50 uninstall:
51         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles
52
53 ## mono --wapi=semdel will probably not delete the semaphore if someone is crazy enough to do a 'make -j distclean' :-)
54 clean-local:
55         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' clean-profiles
56         -./mono-wrapper --wapi=semdel
57         -rm -fr $(etctmp) $(tmpinst) .wapi
58
59 endif BUILD_MCS
60
61 TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/bin/ilasm $(tmpinst)/bin/gmcs
62
63 # now a misnomer, but it'll go away soon enough.
64 if ENABLE_NUNIT_TESTS
65 test_select =
66 else
67 test_select = ONLY_CENTUM_TESTS=yes
68 endif
69
70 mcs-do-test-profiles:
71         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' test-profiles
72
73 mcs-do-run-test-profiles: test-support-files
74         cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' run-test-profiles
75
76 if PLATFORM_WIN32
77 cur_dir_cmd = cygpath -w -a .
78 PLATFORM_PATH_SEPARATOR = ;
79 else
80 cur_dir_cmd = pwd
81 PLATFORM_PATH_SEPARATOR = :
82 endif
83
84 # Use --compile-all as a poor man's PEVerify to detect invalid IL
85 mcs-compileall: mono-wrapper etc/mono/config
86         save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
87         for profile in $(build_profiles); do \
88           if [ "net_3_5" = "$$profile" ]; then \
89                   MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
90           else \
91                   MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \
92           fi; \
93           export MONO_PATH; \
94           for i in $(mcs_topdir)/class/lib/$$profile/*.{dll,exe}; do \
95                 if [ ! -f $$i ] ; then \
96                         continue ; \
97                 fi ;  \
98             if ./mono-wrapper --compile-all $$i; then \
99               echo $$i verified OK; \
100             else \
101               echo $$i verification failed; ok=false; \
102             fi; done; done; \
103         $$ok
104
105 check-local: mcs-compileall mcs-do-test-profiles
106         $(MAKE) $(test_select) mcs-do-run-test-profiles
107
108 CLEANFILES = etc/mono/config
109
110 # depend on $(symlinks) to ensure 'etc/mono' directory exists
111 etc/mono/config: ../data/config Makefile $(symlinks)
112         d=`cd ../support && pwd`; \
113         sed 's,target="libMonoPosixHelper[^"]*",target="'$$d/libMonoPosixHelper.la'",' ../data/config > $@t
114         if test -z "$(libgdiplus_loc)"; then :; else \
115           sed 's,<configuration>,& <dllmap dll="gdiplus.dll" target="$(libgdiplus_loc)" />,' $@t > $@tt; \
116           mv -f $@tt $@t; fi
117         mv -f $@t $@
118
119 $(tmpinst)/bin/mono: mono-wrapper etc/mono/config
120         $(mkinstalldirs) $(tmpinst)/bin
121         cp mono-wrapper $@
122
123 $(tmpinst)/bin/mcs: $(tmpinst)/bin/mono Makefile
124         echo '#! /bin/sh' > $@ ; \
125         r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
126         echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/default/mcs.exe"'" "$$@"' >> $@ ; \
127         chmod +x $@
128
129 $(tmpinst)/bin/gmcs: $(tmpinst)/bin/mono Makefile
130         echo '#! /bin/sh' > $@ ; \
131         r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
132         echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/net_2_0/gmcs.exe"'" "$$@"' >> $@ ; \
133         chmod +x $@
134
135 $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
136         echo '#! /bin/sh' > $@ ; \
137         r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
138         echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/ilasm/ilasm.exe"'" "$$@"' >> $@ ; \
139         chmod +x $@
140
141 test-support-files: $(TEST_SUPPORT_FILES)
142         @:
143
144 # the 'cygnus' option also disables the default 'distdir:' target, which we _do_ want
145 MYDISTFILES = $(DIST_COMMON)
146 distdir: $(MYDISTFILES)
147         rm -fr $(distdir)
148         mkdir $(distdir)
149         test -z '$(MYDISTFILES)' || for file in ''$(MYDISTFILES); do \
150           cp -p $$file $(distdir) ; done
151         find $(distdir) -type f -exec chmod a+r {} ';'