2001-10-12 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         expression.cs                   \
20         gen-treedump.cs                 \
21         genericparser.cs                \
22         interface.cs                    \
23         literal.cs                      \
24         location.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         -rm compiler.exe
40         -rm mcs.pdb
41
42 windows: all
43
44 linux: all
45
46 opt:
47         $(CSC) /optimize+ /target:exe /r:System.dll /out:mcs.exe $(COMPILER_SOURCES)
48
49 old: test-tokenizer.exe
50 test-tokenizer.exe: $(TEST_TOKENIZER_SOURCES)
51         $(CSC) /target:exe /out:test-tokenizer.exe $(TEST_TOKENIZER_SOURCES)
52
53 bison:
54         perl -pe 's/\015//' < cs-parser.jay > x.y
55         bison --debug --verbose x.y
56
57 cs-parser.cs: cs-parser.jay
58         ../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay > cs-parser.cs
59
60 pn:
61         ../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay | grep -v '#line' > cs-parser.cs
62
63 statementCollection.cs: X-Collection.cs
64         sed -e "s/@CONTAINEE@/Statement/g" -e "s/@arrayname@/statements/g" < X-Collection.cs > statementCollection.cs
65
66 parameterCollection.cs: X-Collection.cs
67         sed -e "s/@CONTAINEE@/Parameter/g" -e "s/@arrayname@/parameters/g" < X-Collection.cs > parameterCollection.cs
68
69 DIST_FILES=$(COMPILER_SOURCES) cs-parser.jay makefile ChangeLog 
70
71 dist:
72         rm -rf /tmp/mcs-$(VERSION)
73         mkdir /tmp/mcs-$(VERSION)
74         mkdir /tmp/mcs-$(VERSION)/errors
75         mkdir /tmp/mcs-$(VERSION)/tests
76         mkdir /tmp/mcs-$(VERSION)/docs
77         cp -a $(DIST_FILES) /tmp/mcs-$(VERSION)
78         cp errors/*.cs errors/*.txt /tmp/mcs-$(VERSION)/errors
79         cp tests/*.cs /tmp/mcs-$(VERSION)/tests
80         cp docs/*.txt /tmp/mcs-$(VERSION)/docs
81         (cd /tmp; tar czvf mcs-$(VERSION).tar.gz mcs-$(VERSION))
82
83 try:
84         -mkdir try-dir
85         for i in $(COMPILER_SOURCES); do \
86                 ./compiler -t tree $$i > try-dir/$$i; \
87         done
88
89 clean:
90         rm -f mcs.exe cs-parser.cs y.output mcs.pdb *~ .*~ mb-parser.cs mcs.log
91
92 MBAS_SOURCES = mb-parser.cs mb-tokenizer.cs
93
94 mbas: cs-parser.cs MonoBASIC.Parser.cs
95         $(CSC) $(CSCFLAGS) /target:exe /r:System.dll /out:mcs.exe $(COMPILER_SOURCES) $(MBAS_SOURCES)
96
97 mb-parser.cs: mb-parser.jay
98         ../jay/jay -ctv < ../jay/skeleton.cs mb-parser.jay > mb-parser.cs
99