java.home properties bug fixed
[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/10/30
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 = cc
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 sysdep/offsets.h
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         cd mm; make clean
112
113 tar:
114         rm -f cacao.tgz cacao.tar
115         tar -cvf cacao.tar Makefile */Makefile README COPYRIGHT tst/*.java \
116             doc/*.doc html/*.html *.[ch] comp/*.[ch] ncomp/*.[ch] alpha/*.doc alpha/*.[ch] \
117             nat/*.[ch] toolbox/*.[ch] threads/*.[ch] # sparc/*.[ch]
118         ls -l cacao.tar
119         gzip -9 cacao.tar
120         mv cacao.tar.gz cacao.tgz
121         ls -l cacao.tgz
122
123 dist:
124         rm -rf cacao-$(VERSION_STRING).tar.gz cacao-$(VERSION_STRING);
125         ( mkdir cacao-$(VERSION_STRING); \
126 #         tar -cf cacao-$(VERSION_STRING).tar -T FILES; \
127           tar -cvf cacao-$(VERSION_STRING).tar Makefile */Makefile README COPYRIGHT \
128             tst/*.java doc/*.doc html/*.html *.[ch] comp/*.[ch] ncomp/*.[ch] \
129             alpha/*.doc alpha/*.[ch] nat/*.[ch] toolbox/*.[ch] threads/*.[ch]; \
130           cd cacao-$(VERSION_STRING); \
131           tar -xf ../cacao-$(VERSION_STRING).tar; \
132           cd ..; \
133           rm cacao-$(VERSION_STRING).tar; \
134           tar -cvf cacao-$(VERSION_STRING).tar cacao-$(VERSION_STRING); \
135           rm -rf cacao-$(VERSION_STRING); )
136         gzip -9 cacao-$(VERSION_STRING).tar
137         ls -l cacao-$(VERSION_STRING).tar.gz
138
139 ########################## supported architectures #############################
140
141 config-alpha:
142         rm -f sysdep
143         ln -s alpha sysdep
144         rm -f threads/sysdep
145         ln -s ../sysdep threads/sysdep
146         make clean
147
148 config-sparc:
149         rm -f sysdep
150         ln -s sparc sysdep
151         rm -f threads/sysdep
152         ln -s ../sysdep threads/sysdep
153         make clean
154
155
156
157 ##################### generation of NATIVE - header files ######################
158
159 sysdep/offsets.h nativetypes.hh nativetable.hh : cacaoh
160         ./cacaoh java.lang.Object \
161        java.lang.String \
162        java.lang.Class \
163        java.lang.ClassLoader \
164        java.lang.Compiler \
165        java.lang.Double \
166        java.lang.Float \
167        java.lang.Math \
168        java.lang.Runtime \
169        java.lang.SecurityManager \
170        java.lang.System \
171        java.lang.Thread \
172        java.lang.ThreadGroup \
173        java.lang.Throwable \
174 \
175        java.io.File \
176        java.io.FileDescriptor \
177        java.io.FileInputStream \
178        java.io.FileOutputStream \
179        java.io.PrintStream \
180        java.io.RandomAccessFile \
181 \
182        java.util.Properties \
183        java.util.Date
184        
185