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: $Id: Makefile.pre-automake 115 1999-01-20 01:52:45Z phil $
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
47 #CFLAGS = -g -mieee -Wall $(THREAD_CFLAGS) $(ARCHFLAGS)
48 #CFLAGS = -mieee -O3 -Wall $(THREAD_CFLAGS) $(ARCHFLAGS)
53 CFLAGS = -g -ieee $(THREAD_CFLAGS) $(ARCHFLAGS)
54 #CFLAGS = -O6 -g -pg -ieee $(THREAD_CFLAGS) $(ARCHFLAGS)
55 #CFLAGS = -O2 -g -ieee -fno-inline $(THREAD_CFLAGS) $(ARCHFLAGS)
56 #CFLAGS = -O6 -ieee $(THREAD_CFLAGS) $(ARCHFLAGS)
57 #CFLAGS = -O3 -ieee $(THREAD_CFLAGS) $(ARCHFLAGS)
60 # IRIX 6.5 MIPSPro 7.2.1
62 #ARCHFLAGS = -DDONT_MMAP
63 #CFLAGS = -g $(THREAD_CFLAGS) -DMAP_ANONYMOUS=0 -woff 1048,1110,1164,1515 $(ARCHFLAGS)
64 #CFLAGS = -O2 -OPT:Olimit=0 $(THREAD_CFLAGS) -DMAP_ANONYMOUS=0 $(ARCHFLAGS)
65 #LFLAGS = -lm -lelfutil
67 OBJ = main.o tables.o loader.o compiler.o jit.o builtin.o asmpart.o \
68 toolbox/toolbox.a native.o $(THREAD_OBJ) mm/mm.o
69 OBJH = headers.o tables.o loader.o builtin.o toolbox/toolbox.a $(THREAD_OBJ) \
73 $(CC) $(CFLAGS) -o cacao $(OBJ) $(LFLAGS)
75 $(CC) $(CFLAGS) -o cacaoh $(OBJH) $(LFLAGS)
77 main.o: main.c global.h tables.h loader.h jit.h compiler.h \
78 asmpart.h builtin.h native.h
80 headers.o: headers.c global.h tables.h loader.h
82 loader.o: loader.c global.h loader.h tables.h native.h asmpart.h
84 compiler.o: builtin.h compiler.h global.h loader.h tables.h native.h \
85 asmpart.h compiler.c comp/*.c sysdep/gen.c sysdep/disass.c
87 jit.o: builtin.h jit.h global.h loader.h tables.h native.h asmpart.h \
88 jit/jitdef.h jit/*.c sysdep/ngen.h sysdep/ngen.c sysdep/disass.c
90 builtin.o: builtin.c global.h loader.h builtin.h tables.h sysdep/native-math.h
92 native.o: native.c global.h tables.h native.h asmpart.h builtin.h \
93 nativetypes.hh nativetable.hh nat/*.c
95 tables.o: tables.c global.h tables.h
97 global.h: sysdep/types.h toolbox/*.h
100 toolbox/toolbox.a: toolbox/*.c toolbox/*.h
101 cd toolbox; $(MAKE) toolbox.a "CFLAGS=$(CFLAGS)" "CC=$(CC)"
103 ifeq ($(USE_THREADS),YES)
104 threads/threads.a: threads/*.c threads/*.h sysdep/threads.h
105 cd threads; $(MAKE) threads.a "USE_THREADS=$(USE_THREADS)" "CFLAGS=$(CFLAGS)" "CC=$(CC)"
108 mm/mm.o: mm/*.[ch] mm/Makefile
109 cd mm; $(MAKE) mm.o "USE_THREADS=$(USE_THREADS)" "CFLAGS=$(CFLAGS)" "CC=$(CC)"
111 asmpart.o: sysdep/asmpart.c sysdep/offsets.h
113 $(CC) -E sysdep/asmpart.c > asmpart.s
114 $(CC) -c -o asmpart.o asmpart.s
118 ########################### support targets ####################################
121 rm -f *.o cacao cacaoh cacao.tgz nativetable.hh nativetypes.hh \
123 cd toolbox; $(MAKE) clean
124 cd threads; $(MAKE) clean
128 ### DISTRIBUTION TARGETS ###
130 DISTRIBUTION_FILES = \
150 rm -f cacao.tgz cacao.tar
151 tar -cvf cacao.tar $(DISTRIBUTION_FILES)
154 mv cacao.tar.gz cacao.tgz
158 rm -rf cacao-$(VERSION_STRING).tar.gz cacao-$(VERSION_STRING);
159 ( mkdir cacao-$(VERSION_STRING); \
160 tar -cvf cacao-$(VERSION_STRING).tar $(DISTRIBUTION_FILES); \
161 cd cacao-$(VERSION_STRING); \
162 tar -xf ../cacao-$(VERSION_STRING).tar; \
164 rm cacao-$(VERSION_STRING).tar; \
165 tar -cvf cacao-$(VERSION_STRING).tar cacao-$(VERSION_STRING); \
166 rm -rf cacao-$(VERSION_STRING); )
167 gzip -9 cacao-$(VERSION_STRING).tar
168 ls -l cacao-$(VERSION_STRING).tar.gz
170 ########################## supported architectures #############################
176 ln -s ../sysdep threads/sysdep
183 ln -s ../sysdep threads/sysdep
190 ln -s ../sysdep threads/sysdep
194 ##################### generation of NATIVE - header files ######################
196 sysdep/offsets.h nativetypes.hh nativetable.hh : cacaoh
197 ./cacaoh java.lang.Object \
200 java.lang.ClassLoader \
206 java.lang.SecurityManager \
209 java.lang.ThreadGroup \
210 java.lang.Throwable \
213 java.io.FileDescriptor \
214 java.io.FileInputStream \
215 java.io.FileOutputStream \
216 java.io.PrintStream \
217 java.io.RandomAccessFile \
219 java.util.Properties \