2001-09-27 Miguel de Icaza <miguel@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  
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         modifiers.cs                    \
25         namespace.cs                    \
26         parameter.cs                    \
27         report.cs                       \
28         rootcontext.cs                  \
29         statement.cs                    \
30         statementCollection.cs          \
31         support.cs                      \
32         typemanager.cs
33
34 TEST_TOKENIZER_SOURCES = test-token.cs $(COMMON_SOURCES)
35
36 all: cs-parser.cs
37         $(CSC) $(CSCFLAGS) /target:exe /r:System.dll /out:compiler.exe $(COMPILER_SOURCES)
38
39 windows: all
40
41 linux: all
42
43 opt:
44         $(CSC) /optimize+ /target:exe /r:System.dll /out:compiler.exe $(COMPILER_SOURCES)
45
46 old: test-tokenizer.exe
47 test-tokenizer.exe: $(TEST_TOKENIZER_SOURCES)
48         $(CSC) /target:exe /out:test-tokenizer.exe $(TEST_TOKENIZER_SOURCES)
49
50 bison:
51         perl -pe 's/\015//' < cs-parser.jay > x.y
52         bison --debug --verbose x.y
53
54 cs-parser.cs: cs-parser.jay
55         ../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay > cs-parser.cs
56
57 pn:
58         ../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay | grep -v '#line' > cs-parser.cs
59
60 statementCollection.cs: X-Collection.cs
61         sed -e "s/@CONTAINEE@/Statement/g" -e "s/@arrayname@/statements/g" < X-Collection.cs > statementCollection.cs
62
63 parameterCollection.cs: X-Collection.cs
64         sed -e "s/@CONTAINEE@/Parameter/g" -e "s/@arrayname@/parameters/g" < X-Collection.cs > parameterCollection.cs
65
66 DIST_FILES=$(COMPILER_SOURCES) cs-parser.jay makefile ChangeLog 
67
68 dist:
69         rm -rf /tmp/mcs-$(VERSION)
70         mkdir /tmp/mcs-$(VERSION)
71         mkdir /tmp/mcs-$(VERSION)/errors
72         mkdir /tmp/mcs-$(VERSION)/tests
73         mkdir /tmp/mcs-$(VERSION)/docs
74         cp -a $(DIST_FILES) /tmp/mcs-$(VERSION)
75         cp errors/*.cs errors/*.txt /tmp/mcs-$(VERSION)/errors
76         cp tests/*.cs /tmp/mcs-$(VERSION)/tests
77         cp docs/*.txt /tmp/mcs-$(VERSION)/docs
78         (cd /tmp; tar czvf mcs-$(VERSION).tar.gz mcs-$(VERSION))
79
80 try:
81         -mkdir try-dir
82         for i in $(COMPILER_SOURCES); do \
83                 ./compiler -t tree $$i > try-dir/$$i; \
84         done
85
86 clean:
87         rm -f compiler.exe cs-parser.cs y.output compiler.pdb *~ .*~