[corlib] ExecutionContext and other contexts from reference sources. Fixes #28793...
[mono.git] / mcs / class / Mono.Options / Makefile
index 64fbefa18f8cfc69b69df928c262f4bac2fd36b1..beee719c77f79c11e661f5b6f74856321a674e55 100644 (file)
@@ -7,8 +7,9 @@ LIBRARY_PACKAGE = none
 
 NO_INSTALL = yes
 
-LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll
-TEST_MCS_FLAGS = /r:Mono.Posix.dll /r:System.dll
+LIB_REFS = System
+LIB_MCS_FLAGS = /r:$(corlib)
+TEST_MCS_FLAGS = /r:Mono.Posix.dll /r:System.dll /r:System.Core.dll
 
 mono_sourcelibs_DIR  = $(DESTDIR)$(mono_libdir)/mono-source-libs
 mono_options_DATA = Mono.Options/Options.cs
@@ -30,3 +31,48 @@ fixup-docs:
        for f in `find Documentation/en -name \*.xml` ; do \
                sed -i 's/NDesk.Options/Mono.Options/g' $$f ; \
        done
+
+DOC_EXAMPLES_OUTPUT = \
+       Documentation/en/examples/bundling.txt \
+       Documentation/en/examples/context.txt \
+       Documentation/en/examples/greet.txt \
+       Documentation/en/examples/localization.txt \
+       Documentation/en/examples/subclass.txt
+
+$(the_libdir)/.doc-stamp: $(DOC_EXAMPLES_OUTPUT) 
+
+Documentation/en/examples/Mono.Options.dll: $(the_lib)
+       cp $^ $@
+       -cp $^.mdb $@.mdb
+
+%.exe: %.cs Documentation/en/examples/Mono.Options.dll
+       $(CSCOMPILE) -debug+ -r:Mono.Posix.dll -r:System.Core.dll -lib:Documentation/en/examples -r:Mono.Options.dll -out:$@ $<
+
+Documentation/en/examples/locale/es/LC_MESSAGES/localization.mo: Documentation/en/examples/localization-es.po
+       msgfmt $< -o $@
+
+Documentation/en/examples/localization.exe: Documentation/en/examples/locale/es/LC_MESSAGES/localization.mo
+
+%.txt: %.in %.exe
+       -rm $@
+       exec 3<$< ; \
+       while read line 0<&3 ; do \
+               if test -n "$$line" ; then \
+                       echo "$$ $$line" | sed 's#Documentation/en/examples/##' >> $@ ; \
+                       sh -c "$$line" >> $@ 2>&1 ; \
+               else \
+                       echo "" >> $@ ; \
+               fi ; \
+       done ; \
+       exec 3>&-;
+
+EXTRA_DISTFILES = \
+       $(wildcard Documentation/en/examples/*.cs) \
+       $(wildcard Documentation/en/examples/*.in) \
+       $(wildcard Documentation/en/examples/*.po) \
+       $(wildcard Documentation/en/examples/*.txt) \
+       Documentation/en/examples/locale/es/LC_MESSAGES/localization.mo
+
+CLEAN_FILES = \
+       Documentation/en/examples/Mono.Options.dll* \
+       Documentation/en/examples/*.exe*