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 70 1998-11-16 16:49:18Z schani $
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)
51 CFLAGS = -g -ieee $(THREAD_CFLAGS)
52 #CFLAGS = -O3 -ieee $(THREAD_CFLAGS)
55 # IRIX 6.5 MIPSPro 7.2.1
57 #CFLAGS = -g $(THREAD_CFLAGS) -DMAP_ANONYMOUS=0 -woff 1048,1110,1164,1515
58 #CFLAGS = -O2 -OPT:Olimit=0 $(THREAD_CFLAGS) -DMAP_ANONYMOUS=0
59 #LFLAGS = -lm -lelfutil
61 OBJ = main.o tables.o loader.o compiler.o jit.o builtin.o asmpart.o \
62 toolbox/toolbox.a native.o $(THREAD_OBJ) mm/mm.o
63 OBJH = headers.o tables.o loader.o builtin.o toolbox/toolbox.a $(THREAD_OBJ) \
67 $(CC) $(CFLAGS) -o cacao $(OBJ) $(LFLAGS)
69 $(CC) $(CFLAGS) -o cacaoh $(OBJH) $(LFLAGS)
71 main.o: main.c global.h tables.h loader.h jit.h compiler.h \
72 asmpart.h builtin.h native.h
74 headers.o: headers.c global.h tables.h loader.h
76 loader.o: loader.c global.h loader.h tables.h native.h asmpart.h
78 compiler.o: builtin.h compiler.h global.h loader.h tables.h native.h \
79 asmpart.h compiler.c comp/*.c sysdep/gen.c sysdep/disass.c
81 jit.o: builtin.h jit.h global.h loader.h tables.h native.h asmpart.h \
82 jit/jitdef.h jit/*.c sysdep/ngen.h sysdep/ngen.c sysdep/disass.c
84 builtin.o: builtin.c global.h loader.h builtin.h tables.h sysdep/native-math.h
86 native.o: native.c global.h tables.h native.h asmpart.h builtin.h \
87 nativetypes.hh nativetable.hh nat/*.c
89 tables.o: tables.c global.h tables.h
91 global.h: sysdep/types.h toolbox/*.h
94 toolbox/toolbox.a: toolbox/*.c toolbox/*.h
95 cd toolbox; $(MAKE) toolbox.a "CFLAGS=$(CFLAGS)" "CC=$(CC)"
97 ifeq ($(USE_THREADS),YES)
98 threads/threads.a: threads/*.c threads/*.h sysdep/threads.h
99 cd threads; $(MAKE) threads.a "USE_THREADS=$(USE_THREADS)" "CFLAGS=$(CFLAGS)" "CC=$(CC)"
102 mm/mm.o: mm/*.[ch] mm/Makefile
103 cd mm; $(MAKE) mm.o "USE_THREADS=$(USE_THREADS)" "CFLAGS=$(CFLAGS)" "CC=$(CC)"
105 asmpart.o: sysdep/asmpart.c sysdep/offsets.h
107 $(CC) -E sysdep/asmpart.c > asmpart.s
108 $(CC) -c -o asmpart.o asmpart.s
112 ########################### support targets ####################################
115 rm -f *.o cacao cacaoh cacao.tgz nativetable.hh nativetypes.hh \
117 cd toolbox; $(MAKE) clean
118 cd threads; $(MAKE) clean
122 ### DISTRIBUTION TARGETS ###
124 DISTRIBUTION_FILES = \
144 rm -f cacao.tgz cacao.tar
145 tar -cvf cacao.tar $(DISTRIBUTION_FILES)
148 mv cacao.tar.gz cacao.tgz
152 rm -rf cacao-$(VERSION_STRING).tar.gz cacao-$(VERSION_STRING);
153 ( mkdir cacao-$(VERSION_STRING); \
154 tar -cvf cacao-$(VERSION_STRING).tar $(DISTRIBUTION_FILES); \
155 cd cacao-$(VERSION_STRING); \
156 tar -xf ../cacao-$(VERSION_STRING).tar; \
158 rm cacao-$(VERSION_STRING).tar; \
159 tar -cvf cacao-$(VERSION_STRING).tar cacao-$(VERSION_STRING); \
160 rm -rf cacao-$(VERSION_STRING); )
161 gzip -9 cacao-$(VERSION_STRING).tar
162 ls -l cacao-$(VERSION_STRING).tar.gz
164 ########################## supported architectures #############################
170 ln -s ../sysdep threads/sysdep
177 ln -s ../sysdep threads/sysdep
184 ln -s ../sysdep threads/sysdep
188 ##################### generation of NATIVE - header files ######################
190 sysdep/offsets.h nativetypes.hh nativetable.hh : cacaoh
191 ./cacaoh java.lang.Object \
194 java.lang.ClassLoader \
200 java.lang.SecurityManager \
203 java.lang.ThreadGroup \
204 java.lang.Throwable \
207 java.io.FileDescriptor \
208 java.io.FileInputStream \
209 java.io.FileOutputStream \
210 java.io.PrintStream \
211 java.io.RandomAccessFile \
213 java.util.Properties \