[build] Change the way how mcs references are passed to compiler to always use full...
[mono.git] / mcs / class / Mono.Options / Makefile
1 thisdir = class/Mono.Options
2 SUBDIRS = 
3 include ../../build/rules.make
4
5 LIBRARY = Mono.Options.dll
6 LIBRARY_PACKAGE = none
7
8 NO_INSTALL = yes
9
10 LIB_REFS = System
11 LIB_MCS_FLAGS =
12 TEST_MCS_FLAGS =
13 TEST_LIB_REFS = Mono.Posix System System.Core
14
15 mono_sourcelibs_DIR  = $(DESTDIR)$(mono_libdir)/mono-source-libs
16 mono_options_DATA = Mono.Options/Options.cs
17
18 include ../../build/library.make
19
20 install-local: install-source
21
22 uninstall-local: uninstall-source
23
24 install-source:
25         -$(MKINSTALLDIRS) $(mono_sourcelibs_DIR)
26         $(INSTALL) -m 644 $(mono_options_DATA) $(mono_sourcelibs_DIR)
27
28 uninstall-source:
29         -rm -f $(mono_options_DIR)/Options.cs
30
31 fixup-docs:
32         for f in `find Documentation/en -name \*.xml` ; do \
33                 sed -i 's/NDesk.Options/Mono.Options/g' $$f ; \
34         done
35
36 DOC_EXAMPLES_OUTPUT = \
37         Documentation/en/examples/bundling.txt \
38         Documentation/en/examples/context.txt \
39         Documentation/en/examples/greet.txt \
40         Documentation/en/examples/localization.txt \
41         Documentation/en/examples/subclass.txt
42
43 $(the_libdir)/.doc-stamp: $(DOC_EXAMPLES_OUTPUT) 
44
45 Documentation/en/examples/Mono.Options.dll: $(the_lib)
46         cp $^ $@
47         -cp $^.mdb $@.mdb
48
49 %.exe: %.cs Documentation/en/examples/Mono.Options.dll
50         $(CSCOMPILE) -debug+ -r:Mono.Posix.dll -r:System.Core.dll -lib:Documentation/en/examples -r:Mono.Options.dll -out:$@ $<
51
52 Documentation/en/examples/locale/es/LC_MESSAGES/localization.mo: Documentation/en/examples/localization-es.po
53         msgfmt $< -o $@
54
55 Documentation/en/examples/localization.exe: Documentation/en/examples/locale/es/LC_MESSAGES/localization.mo
56
57 %.txt: %.in %.exe
58         -rm $@
59         exec 3<$< ; \
60         while read line 0<&3 ; do \
61                 if test -n "$$line" ; then \
62                         echo "$$ $$line" | sed 's#Documentation/en/examples/##' >> $@ ; \
63                         sh -c "$$line" >> $@ 2>&1 ; \
64                 else \
65                         echo "" >> $@ ; \
66                 fi ; \
67         done ; \
68         exec 3>&-;
69
70 EXTRA_DISTFILES = \
71         $(wildcard Documentation/en/examples/*.cs) \
72         $(wildcard Documentation/en/examples/*.in) \
73         $(wildcard Documentation/en/examples/*.po) \
74         $(wildcard Documentation/en/examples/*.txt) \
75         Documentation/en/examples/locale/es/LC_MESSAGES/localization.mo
76
77 CLEAN_FILES = \
78         Documentation/en/examples/Mono.Options.dll* \
79         Documentation/en/examples/*.exe*