Run time type check with relative numbering added. Checkcast and Instanceof
[cacao.git] / Makefile
1 ################################################################################
2 #                    Makefile for the JavaVM - compiler CACAO                  #
3 ################################################################################
4 #
5 # Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
6 #
7 # See file COPYRIGHT for information on usage and disclaimer of warranties
8 #
9 # Authors: Reinhard Grafl      EMAIL: cacao@complang.tuwien.ac.at
10 #          Andreas  Krall      EMAIL: cacao@complang.tuwien.ac.at
11 #
12 # Last Change: 1998/09/27
13 #
14 #
15 # ATTENTION: This version of the makefile only works with gmake.
16 #            This Makefile not only generates object files, but also additional
17 #            files needed during compilation:
18 #                nativetypes.hh
19 #                nativetables.hh
20 #            All object files and the *.hh can be deleted savely. They will be
21 #            generated automatically.
22 #
23 ################################################################################
24
25 VERSION_MAJOR = 0
26 VERSION_MINOR = 30
27 VERSION_POSTFIX = 
28
29 VERSION_STRING=$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POSTFIX)
30
31 ##################### generation of the excutable ##############################
32
33 # Enabling/disabling thread support
34 USE_THREADS = YES
35 #USE_THREADS = NO
36
37 ifeq ($(USE_THREADS),YES)
38 THREAD_OBJ = threads/threads.a
39 THREAD_CFLAGS = -DUSE_THREADS -DEXTERNAL_OVERFLOW -DDONT_FREE_FIRST
40 else
41 THREAD_OBJ =
42 THREAD_CFLAGS =
43 endif
44
45 #CC = gcc
46 #CFLAGS = -g -mieee -Wall $(THREAD_CFLAGS)
47 #CFLAGS = -mieee -O3 -Wall $(THREAD_CFLAGS)
48
49 CC = cc
50 #CFLAGS = -g3 -ieee $(THREAD_CFLAGS)
51 CFLAGS = -O3 -ieee $(THREAD_CFLAGS)
52
53 OBJ = main.o tables.o loader.o compiler.o newcomp.o builtin.o asmpart.o \
54         toolbox/toolbox.a native.o $(THREAD_OBJ) mm/mm.o
55 OBJH = headers.o tables.o loader.o builtin.o toolbox/toolbox.a $(THREAD_OBJ) \
56          mm/mm.o
57
58 cacao: $(OBJ)
59         $(CC) $(CFLAGS) -o cacao $(OBJ) -lm
60 cacaoh: $(OBJH)
61         $(CC) $(CFLAGS) -o cacaoh $(OBJH) -lm
62
63 main.o: main.c global.h tables.h compiler.h ncomp/ncomp.h loader.h \
64         asmpart.h builtin.h native.h
65
66 headers.o:  headers.c global.h tables.h loader.h
67
68 loader.o:   loader.c global.h loader.h tables.h native.h asmpart.h
69
70 compiler.o: builtin.h compiler.h global.h loader.h tables.h native.h \
71             asmpart.h compiler.c comp/*.c sysdep/gen.c sysdep/disass.c
72
73 newcomp.o:  builtin.h ncomp/ncomp.h global.h loader.h tables.h native.h \
74             asmpart.h ncomp/ncompdef.h ncomp/*.c sysdep/ngen.h sysdep/ngen.c sysdep/disass.c
75
76 builtin.o: builtin.c global.h loader.h builtin.h tables.h sysdep/native-math.h
77
78 native.o: native.c global.h tables.h native.h asmpart.h builtin.h \
79           nativetypes.hh nativetable.hh nat/*.c
80
81 tables.o: tables.c global.h tables.h
82
83 global.h: sysdep/types.h toolbox/*.h
84         touch global.h
85
86 toolbox/toolbox.a: toolbox/*.c toolbox/*.h
87         cd toolbox; make toolbox.a "CFLAGS=$(CFLAGS)" "CC=$(CC)" 
88
89 ifeq ($(USE_THREADS),YES)
90 threads/threads.a: threads/*.c threads/*.h sysdep/threads.h
91         cd threads; make threads.a "USE_THREADS=$(USE_THREADS)" "CFLAGS=$(CFLAGS)" "CC=$(CC)" 
92 endif
93
94 mm/mm.o: mm/*.[ch] mm/Makefile
95         cd mm; make mm.o "USE_THREADS=$(USE_THREADS)" "CFLAGS=$(CFLAGS)" "CC=$(CC)"
96
97 asmpart.o: sysdep/asmpart.c
98         rm -f asmpart.s
99         $(CC) -E sysdep/asmpart.c > asmpart.s
100         $(CC) -c -o asmpart.o asmpart.s
101         rm -f asmpart.s
102
103
104 ########################### support targets ####################################
105
106 clean:
107         rm -f *.o cacao cacaoh cacao.tgz nativetable.hh nativetypes.hh \
108               core tst/core
109         cd toolbox; make clean
110         cd threads; make clean
111
112 tar:
113         rm -f cacao.tgz cacao.tar
114         tar -cvf cacao.tar Makefile */Makefile README COPYRIGHT tst/*.java \
115             doc/*.doc html/*.html *.[ch] comp/*.[ch] ncomp/*.[ch] alpha/*.doc alpha/*.[ch] \
116             nat/*.[ch] toolbox/*.[ch] threads/*.[ch] # sparc/*.[ch]
117         ls -l cacao.tar
118         gzip -9 cacao.tar
119         mv cacao.tar.gz cacao.tgz
120         ls -l cacao.tgz
121
122 dist:
123         rm -rf cacao-$(VERSION_STRING).tar.gz cacao-$(VERSION_STRING);
124         ( mkdir cacao-$(VERSION_STRING); \
125 #         tar -cf cacao-$(VERSION_STRING).tar -T FILES; \
126           tar -cvf cacao-$(VERSION_STRING).tar Makefile */Makefile README COPYRIGHT \
127             tst/*.java doc/*.doc html/*.html *.[ch] comp/*.[ch] ncomp/*.[ch] \
128             alpha/*.doc alpha/*.[ch] nat/*.[ch] toolbox/*.[ch] threads/*.[ch]; \
129           cd cacao-$(VERSION_STRING); \
130           tar -xf ../cacao-$(VERSION_STRING).tar; \
131           cd ..; \
132           rm cacao-$(VERSION_STRING).tar; \
133           tar -cvf cacao-$(VERSION_STRING).tar cacao-$(VERSION_STRING); \
134           rm -rf cacao-$(VERSION_STRING); )
135         gzip -9 cacao-$(VERSION_STRING).tar
136         ls -l cacao-$(VERSION_STRING).tar.gz
137
138 ########################## supported architectures #############################
139
140 config-alpha:
141         rm -f sysdep
142         ln -s alpha sysdep
143         rm -f threads/sysdep
144         ln -s ../sysdep threads/sysdep
145         make clean
146
147 config-sparc:
148         rm -f sysdep
149         ln -s sparc sysdep
150         rm -f threads/sysdep
151         ln -s ../sysdep threads/sysdep
152         make clean
153
154
155
156 ##################### generation of NATIVE - header files ######################
157
158 nativetypes.hh nativetable.hh : cacaoh
159         ./cacaoh java.lang.Object \
160        java.lang.String \
161        java.lang.Class \
162        java.lang.ClassLoader \
163        java.lang.Compiler \
164        java.lang.Double \
165        java.lang.Float \
166        java.lang.Math \
167        java.lang.Runtime \
168        java.lang.SecurityManager \
169        java.lang.System \
170        java.lang.Thread \
171        java.lang.ThreadGroup \
172        java.lang.Throwable \
173 \
174        java.io.File \
175        java.io.FileDescriptor \
176        java.io.FileInputStream \
177        java.io.FileOutputStream \
178        java.io.PrintStream \
179        java.io.RandomAccessFile \
180 \
181        java.util.Properties \
182        java.util.Date
183        
184