3 # The rules for building our class libraries.
5 # The NO_TEST stuff is not too pleasant but whatcha
8 # All the dep files now land in the same directory so we
9 # munge in the library name to keep the files from clashing.
11 sourcefile
= $(LIBRARY
).sources
13 # If the directory contains the per profile include file, generate list file.
14 PROFILE_sources
:= $(wildcard $(PROFILE
)_
$(LIBRARY
).sources
)
16 PROFILE_excludes
= $(wildcard $(PROFILE
)_
$(LIBRARY
).exclude.sources
)
17 sourcefile
= $(depsdir
)/$(PROFILE
)_
$(LIBRARY
).sources
18 library_CLEAN_FILES
+= $(sourcefile
)
20 # Note, gensources.sh can create a $(sourcefile).makefrag if it sees any '#include's
21 # We don't include it in the dependencies since it isn't always created
22 $(sourcefile
): $(PROFILE_sources
) $(PROFILE_excludes
) $(topdir
)/build
/gensources.sh
23 @echo Creating the per profile list
$@ ...
24 $(SHELL
) $(topdir
)/build
/gensources.sh
$@
$(PROFILE_sources
) $(PROFILE_excludes
)
27 PLATFORM_excludes
:= $(wildcard $(LIBRARY
).
$(PLATFORM
)-excludes
)
29 ifndef PLATFORM_excludes
30 ifeq (cat
,$(PLATFORM_CHANGE_SEPARATOR_CMD
))
31 response
= $(sourcefile
)
36 response
= $(depsdir
)/$(PROFILE
)_
$(LIBRARY
).response
37 library_CLEAN_FILES
+= $(response
)
41 LIBRARY_NAME
= $(LIBRARY
)
50 the_libdir
= $(topdir
)/class
/$(lib_dir
)/$(PROFILE
)/
51 ifdef LIBRARY_NEEDS_POSTPROCESSING
52 build_libdir
= fixup
/$(PROFILE
)/
54 ifdef LIBRARY_USE_INTERMEDIATE_FILE
55 build_libdir
= $(the_libdir
)tmp
/
57 build_libdir
= $(the_libdir
)
61 the_lib
= $(the_libdir
)$(LIBRARY_NAME
)
62 build_lib
= $(build_libdir
)$(LIBRARY_NAME
)
63 library_CLEAN_FILES
+= $(the_lib
) $(the_lib
).so
$(the_lib
).mdb
$(the_lib
:.dll
=.pdb
)
64 library_CLEAN_FILES
+= $(build_lib
) $(build_lib
).so
$(build_lib
).mdb
$(build_lib
:.dll
=.pdb
)
66 ifdef NO_SIGN_ASSEMBLY
70 sn
= $(topdir
)/class
/lib
/$(BUILD_TOOLS_PROFILE
)/sn.exe
71 SN
= $(Q
) MONO_PATH
="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME
) $(RUNTIME_FLAGS
) $(sn
)
76 ifeq ($(PLATFORM
), win32
)
77 GACDIR
= `cygpath -w $(mono_libdir)`
78 GACROOT
= `cygpath -w $(DESTDIR)$(mono_libdir)`
79 test_flags
+= -d
:WINDOWS
81 GACDIR
= $(mono_libdir
)
82 GACROOT
= $(DESTDIR
)$(mono_libdir
)
86 all-local
: $(the_lib
) $(extra_targets
)
89 ifeq ($(LIBRARY_COMPILE
),$(BOOT_COMPILE
))
95 csproj-local
: csproj-library csproj-test
98 config_file
=`basename $(LIBRARY) .dll`-$(PROFILE
).input
; \
99 echo
$(thisdir
):$$config_file >> $(topdir
)/..
/msvc
/scripts
/order
; \
102 echo
$(USE_MCS_FLAGS
) $(LIBRARY_FLAGS
) $(LIB_MCS_FLAGS
); \
103 echo
$(LIBRARY_NAME
); \
104 echo
$(BUILT_SOURCES_cmdline
); \
106 echo
$(FRAMEWORK_VERSION
); \
107 echo
$(response
)) > $(topdir
)/..
/msvc
/scripts
/inputs
/$$config_file
111 install-local
: all-local
112 test-local
: all-local
116 install-local uninstall-local
:
121 aot_lib
= $(the_lib
)$(PLATFORM_AOT_SUFFIX
)
122 aot_libname
= $(LIBRARY_NAME
)$(PLATFORM_AOT_SUFFIX
)
124 ifdef LIBRARY_INSTALL_DIR
126 $(MKINSTALLDIRS
) $(DESTDIR
)$(LIBRARY_INSTALL_DIR
)
127 $(INSTALL_LIB
) $(the_lib
) $(DESTDIR
)$(LIBRARY_INSTALL_DIR
)/$(LIBRARY_NAME
)
128 test ! -f
$(the_lib
).mdb ||
$(INSTALL_LIB
) $(the_lib
).mdb
$(DESTDIR
)$(LIBRARY_INSTALL_DIR
)/$(LIBRARY_NAME
).mdb
129 ifdef PLATFORM_AOT_SUFFIX
130 test ! -f
$(aot_lib
) ||
$(INSTALL_LIB
) $(aot_lib
) $(DESTDIR
)$(LIBRARY_INSTALL_DIR
)
134 -rm -f
$(DESTDIR
)$(LIBRARY_INSTALL_DIR
)/$(LIBRARY_NAME
) $(DESTDIR
)$(LIBRARY_INSTALL_DIR
)/$(LIBRARY_NAME
).mdb
138 # If RUNTIME_HAS_CONSISTENT_GACDIR is set, it implies that the internal GACDIR
139 # of the runtime is the same as the GACDIR we want. So, we don't need to pass it
140 # to gacutil. Note that the GACDIR we want may not be the same as the value of
141 # GACDIR set above, since the user could have overridden the value of $(prefix).
143 # This makes a difference only when we're building from the mono/ tree, since we
144 # have to ensure that the internal GACDIR of the in-tree runtime matches where we
147 ifndef RUNTIME_HAS_CONSISTENT_GACDIR
148 gacdir_flag
= /gacdir
$(GACDIR
)
151 ifndef LIBRARY_PACKAGE
153 LIBRARY_PACKAGE
= compat-
$(FRAMEWORK_VERSION
)
155 LIBRARY_PACKAGE
= $(FRAMEWORK_VERSION
)
159 ifneq (none
, $(LIBRARY_PACKAGE
))
160 package_flag
= /package
$(LIBRARY_PACKAGE
)
163 install-local
: $(gacutil
)
164 $(GACUTIL
) /i
$(the_lib
) /f
$(gacdir_flag
) /root
$(GACROOT
) $(package_flag
)
166 uninstall-local
: $(gacutil
)
167 -$(GACUTIL
) /u
$(LIBRARY_NAME
:.dll
=) $(gacdir_flag
) /root
$(GACROOT
) $(package_flag
)
169 endif # LIBRARY_INSTALL_DIR
173 -rm -f
$(tests_CLEAN_FILES
) $(library_CLEAN_FILES
) $(CLEAN_FILES
)
175 test-local run-test-local run-test-ondotnet-local
:
178 DISTFILES
= $(wildcard *$(LIBRARY
)*.sources
) $(EXTRA_DISTFILES
)
180 ASSEMBLY
= $(LIBRARY
)
182 the_assembly
= $(the_lib
)
183 include $(topdir
)/build
/tests.make
186 DISTFILES
+= $(test_sourcefile
)
189 config_file
=`basename $(LIBRARY) .dll`-tests-
$(PROFILE
).input
; \
190 echo
$(thisdir
):$$config_file >> $(topdir
)/..
/msvc
/scripts
/order
; \
193 echo
$(USE_MCS_FLAGS
) -r
:$(the_assembly
) $(TEST_MCS_FLAGS
); \
195 echo
$(BUILT_SOURCES_cmdline
); \
197 echo
$(FRAMEWORK_VERSION
); \
198 echo
$(test_response
)) > $(topdir
)/..
/msvc
/scripts
/inputs
/$$config_file
202 # make dist will collect files in .sources files from all profiles
203 dist-local
: dist-default
205 for f in
`$(topdir)/tools/removecomments.sh $(wildcard *$(LIBRARY).sources)` $(TEST_FILES
) ; do \
208 *) dest
=`dirname "$$f"` ; \
209 case
$$subs in
*" $$dest "*) : ;; *) subs
=" $$dest$$subs" ; $(MKINSTALLDIRS
) $(distdir
)/$$dest ;; esac
; \
210 cp
-p
"$$f" $(distdir
)/$$dest || exit
1 ;; \
212 for d in .
$$subs ; do \
213 case
$$d in .
) : ;; *) test ! -f
$$d/ChangeLog || cp
-p
$$d/ChangeLog
$(distdir
)/$$d ;; esac
; done
215 ifdef LIBRARY_NEEDS_POSTPROCESSING
216 dist-local
: dist-fixup
217 FIXUP_PROFILES
= default net_2_0
219 $(MKINSTALLDIRS
) $(distdir
)/fixup
$(FIXUP_PROFILES
:%=$(distdir
)/fixup
/%)
222 ifndef LIBRARY_COMPILE
223 LIBRARY_COMPILE
= $(CSCOMPILE
)
227 LIBRARY_SNK
= $(topdir
)/class
/mono.snk
231 library_CLEAN_FILES
+= $(BUILT_SOURCES
)
232 ifeq (cat
, $(PLATFORM_CHANGE_SEPARATOR_CMD
))
233 BUILT_SOURCES_cmdline
= $(BUILT_SOURCES
)
235 BUILT_SOURCES_cmdline
= `echo $(BUILT_SOURCES) | $(PLATFORM_CHANGE_SEPARATOR_CMD)`
241 $(the_lib
): $(the_libdir
)/.stamp
243 $(build_lib
): $(response
) $(sn
) $(BUILT_SOURCES
) $(build_libdir
:=/.stamp
)
244 $(LIBRARY_COMPILE
) $(LIBRARY_FLAGS
) $(LIB_MCS_FLAGS
) -target
:library
-out
:$@
$(BUILT_SOURCES_cmdline
) @
$(response
)
245 $(SN
) $(SNFLAGS
) -R
$@
$(LIBRARY_SNK
)
247 ifdef LIBRARY_USE_INTERMEDIATE_FILE
248 $(the_lib
): $(build_lib
)
249 $(Q
) cp
$(build_lib
) $@
250 $(SN
) $(SNFLAGS
) -v
$@
251 $(Q
) test ! -f
$(build_lib
).mdb || mv
$(build_lib
).mdb
$@.mdb
252 $(Q
) test ! -f
$(build_lib
:.dll
=.pdb
) || mv
$(build_lib
:.dll
=.pdb
) $(the_lib
:.dll
=.pdb
)
255 library_CLEAN_FILES
+= $(PROFILE
)_aot.log
257 ifdef PLATFORM_AOT_SUFFIX
258 Q_AOT
=$(if
$(V
),,@echo
"AOT [$(PROFILE)] $(notdir $(@))";)
259 $(the_lib
)$(PLATFORM_AOT_SUFFIX
): $(the_lib
)
260 $(Q_AOT
) MONO_PATH
='$(the_libdir)' > $(PROFILE
)_aot.log
2>&1 $(RUNTIME
) --aot
=bind-to-runtime-version
--debug
$(the_lib
)
264 ifneq (,$(filter $(AOT_IN_PROFILES
), $(PROFILE
)))
266 all-local
: $(the_lib
)$(PLATFORM_AOT_SUFFIX
)
271 makefrag
= $(depsdir
)/$(PROFILE
)_
$(LIBRARY
).makefrag
272 library_CLEAN_FILES
+= $(makefrag
)
273 $(makefrag
): $(sourcefile
)
274 # @echo Creating $@ ...
275 @sed
's,^,$(build_lib): ,' $< >$@
276 @if
test ! -f
$(sourcefile
).makefrag
; then
:; else \
277 cat
$(sourcefile
).makefrag
>> $@
; \
278 echo
'$@: $(sourcefile).makefrag' >> $@
; \
279 echo
'$(sourcefile).makefrag:' >> $@
; fi
281 ifneq ($(response
),$(sourcefile
))
283 ifdef PLATFORM_excludes
284 $(response
): $(sourcefile
) $(PLATFORM_excludes
)
285 @echo Filtering
$(sourcefile
) to
$@ ...
286 @
sort $(sourcefile
) $(PLATFORM_excludes
) | uniq
-u |
$(PLATFORM_CHANGE_SEPARATOR_CMD
) >$@
288 $(response
): $(sourcefile
)
289 @echo Converting
$(sourcefile
) to
$@ ...
290 @cat
$(sourcefile
) |
$(PLATFORM_CHANGE_SEPARATOR_CMD
) >$@
297 # for now, don't give any /lib flags or set MONO_PATH, since we
298 # give a full path to the assembly.
300 ## Include corcompare stuff
301 include $(topdir
)/build
/corcompare.make
303 all-local
: $(makefrag
) $(test_makefrag
) $(btest_makefrag
)
304 ifneq ($(response
),$(sourcefile
))
305 $(response
): $(topdir
)/build
/library.make
$(depsdir
)/.stamp
307 $(makefrag
) $(test_response
) $(test_makefrag
) $(btest_response
) $(btest_makefrag
): $(topdir
)/build
/library.make
$(depsdir
)/.stamp
309 ## Documentation stuff
311 Q_MDOC_UP
=$(if
$(V
),,@echo
"MDOC-UP [$(PROFILE)] $(notdir $(@))";)
312 # net_2_0 is needed because monodoc is only compiled in that profile
313 MDOC_UP
=$(Q_MDOC_UP
) \
314 MONO_PATH
="$(topdir)/class/lib/$(DEFAULT_PROFILE)$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME
) $(topdir
)/tools
/mdoc
/mdoc.exe \
315 update
--delete
-o Documentation
/en
$(the_lib
)
317 doc-update-local
: $(the_libdir
)/.doc-stamp
319 $(the_libdir
)/.doc-stamp
: $(the_lib
)
321 @echo
"doc-stamp" > $@