2001-11-11 Ravi Pratap <ravi@ximian.com>
[mono.git] / mcs / mcs / makefile
1 ROOT=/cygdrive/$(subst \,/,$(subst :\,/,$(SYSTEMROOT)))
2 CSC=$(ROOT)/microsoft.net/framework/v1.0.2914/csc.exe
3 CSCFLAGS=/nologo /debug+ /debug:full  /optimize
4
5 VERSION=0.13
6
7 COMMON_SOURCES = cs-parser.cs cs-tokenizer.cs tree.cs location.cs
8
9 COMPILER_SOURCES = \
10         assign.cs                       \
11         driver.cs $(COMMON_SOURCES)     \
12         class.cs                        \
13         delegate.cs                     \
14         attribute.cs                    \
15         codegen.cs                      \
16         constant.cs                     \
17         decl.cs                         \
18         enum.cs                         \
19         ecore.cs                        \
20         expression.cs                   \
21         gen-treedump.cs                 \
22         genericparser.cs                \
23         interface.cs                    \
24         literal.cs                      \
25         modifiers.cs                    \
26         namespace.cs                    \
27         parameter.cs                    \
28         report.cs                       \
29         rootcontext.cs                  \
30         statement.cs                    \
31         statementCollection.cs          \
32         support.cs                      \
33         typemanager.cs
34
35 TEST_TOKENIZER_SOURCES = test-token.cs $(COMMON_SOURCES)
36
37 all: cs-parser.cs
38         $(CSC) $(CSCFLAGS) /target:exe /r:System.dll /out:mcs.exe $(COMPILER_SOURCES)
39
40 windows: all
41
42 linux: all
43
44 opt:
45         $(CSC) /optimize+ /target:exe /r:System.dll /out:mcs.exe $(COMPILER_SOURCES)
46
47 old: test-tokenizer.exe
48 test-tokenizer.exe: $(TEST_TOKENIZER_SOURCES)
49         $(CSC) /target:exe /out:test-tokenizer.exe $(TEST_TOKENIZER_SOURCES)
50
51 bison:
52         perl -pe 's/\015//' < cs-parser.jay > x.y
53         bison --debug --verbose x.y
54
55 cs-parser.cs: cs-parser.jay
56         ../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay > cs-parser.cs
57
58 pn:
59         ../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay | grep -v '#line' > cs-parser.cs
60
61 statementCollection.cs: X-Collection.cs
62         sed -e "s/@CONTAINEE@/Statement/g" -e "s/@arrayname@/statements/g" < X-Collection.cs > statementCollection.cs
63
64 parameterCollection.cs: X-Collection.cs
65         sed -e "s/@CONTAINEE@/Parameter/g" -e "s/@arrayname@/parameters/g" < X-Collection.cs > parameterCollection.cs
66
67 DIST_FILES=$(COMPILER_SOURCES) cs-parser.jay makefile ChangeLog 
68
69 dist:
70         rm -rf /tmp/mcs-$(VERSION)
71         mkdir /tmp/mcs-$(VERSION)
72         mkdir /tmp/mcs-$(VERSION)/errors
73         mkdir /tmp/mcs-$(VERSION)/tests
74         mkdir /tmp/mcs-$(VERSION)/docs
75         cp -a $(DIST_FILES) /tmp/mcs-$(VERSION)
76         cp errors/*.cs errors/*.txt /tmp/mcs-$(VERSION)/errors
77         cp tests/*.cs /tmp/mcs-$(VERSION)/tests
78         cp docs/*.txt /tmp/mcs-$(VERSION)/docs
79         (cd /tmp; tar czvf mcs-$(VERSION).tar.gz mcs-$(VERSION))
80
81 try:
82         -mkdir try-dir
83         for i in $(COMPILER_SOURCES); do \
84                 ./compiler -t tree $$i > try-dir/$$i; \
85         done
86
87 clean:
88         rm -f mcs.exe cs-parser.cs y.output mcs.pdb *~ .*~ mb-parser.cs mcs.log
89
90 MBAS_SOURCES = mb-parser.cs mb-tokenizer.cs
91
92 mbas: cs-parser.cs MonoBASIC.Parser.cs
93         $(CSC) $(CSCFLAGS) /target:exe /r:System.dll /out:mcs.exe $(COMPILER_SOURCES) $(MBAS_SOURCES)
94
95 mb-parser.cs: mb-parser.jay
96         ../jay/jay -ctv < ../jay/skeleton.cs mb-parser.jay > mb-parser.cs
97