1 ################################################################################
2 # Makefile for the JavaVM - compiler CACAO #
3 ################################################################################
5 # Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
7 # See file COPYRIGHT for information on usage and disclaimer of warranties
9 # Authors: Reinhard Grafl EMAIL: cacao@complang.tuwien.ac.at
10 # Andreas Krall EMAIL: cacao@complang.tuwien.ac.at
12 # Last Change: 1998/10/30
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:
20 # All object files and the *.hh can be deleted savely. They will be
21 # generated automatically.
23 ################################################################################
29 VERSION_STRING=$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POSTFIX)
31 ##################### generation of the excutable ##############################
33 # Enabling/disabling thread support
37 ifeq ($(USE_THREADS),YES)
38 THREAD_OBJ = threads/threads.a
39 THREAD_CFLAGS = -DUSE_THREADS -DEXTERNAL_OVERFLOW -DDONT_FREE_FIRST
46 #CFLAGS = -g -mieee -Wall $(THREAD_CFLAGS)
47 #CFLAGS = -mieee -O3 -Wall $(THREAD_CFLAGS)
50 #CFLAGS = -g3 -ieee $(THREAD_CFLAGS)
51 CFLAGS = -O3 -ieee $(THREAD_CFLAGS)
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) \
59 $(CC) $(CFLAGS) -o cacao $(OBJ) -lm
61 $(CC) $(CFLAGS) -o cacaoh $(OBJH) -lm
63 main.o: main.c global.h tables.h compiler.h ncomp/ncomp.h loader.h \
64 asmpart.h builtin.h native.h
66 headers.o: headers.c global.h tables.h loader.h
68 loader.o: loader.c global.h loader.h tables.h native.h asmpart.h
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
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
76 builtin.o: builtin.c global.h loader.h builtin.h tables.h sysdep/native-math.h
78 native.o: native.c global.h tables.h native.h asmpart.h builtin.h \
79 nativetypes.hh nativetable.hh nat/*.c
81 tables.o: tables.c global.h tables.h
83 global.h: sysdep/types.h toolbox/*.h
86 toolbox/toolbox.a: toolbox/*.c toolbox/*.h
87 cd toolbox; make toolbox.a "CFLAGS=$(CFLAGS)" "CC=$(CC)"
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)"
94 mm/mm.o: mm/*.[ch] mm/Makefile
95 cd mm; make mm.o "USE_THREADS=$(USE_THREADS)" "CFLAGS=$(CFLAGS)" "CC=$(CC)"
97 asmpart.o: sysdep/asmpart.c sysdep/offsets.h
99 $(CC) -E sysdep/asmpart.c > asmpart.s
100 $(CC) -c -o asmpart.o asmpart.s
104 ########################### support targets ####################################
107 rm -f *.o cacao cacaoh cacao.tgz nativetable.hh nativetypes.hh \
109 cd toolbox; make clean
110 cd threads; make clean
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]
120 mv cacao.tar.gz cacao.tgz
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; \
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
139 ########################## supported architectures #############################
145 ln -s ../sysdep threads/sysdep
152 ln -s ../sysdep threads/sysdep
157 ##################### generation of NATIVE - header files ######################
159 sysdep/offsets.h nativetypes.hh nativetable.hh : cacaoh
160 ./cacaoh java.lang.Object \
163 java.lang.ClassLoader \
169 java.lang.SecurityManager \
172 java.lang.ThreadGroup \
173 java.lang.Throwable \
176 java.io.FileDescriptor \
177 java.io.FileInputStream \
178 java.io.FileOutputStream \
179 java.io.PrintStream \
180 java.io.RandomAccessFile \
182 java.util.Properties \