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 ################################################################################
31 VERSION_STRING=$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POSTFIX)
33 ##################### generation of the excutable ##############################
35 # Enabling/disabling thread support
39 ifeq ($(USE_THREADS),YES)
40 THREAD_OBJ = threads/threads.a
41 THREAD_CFLAGS = -DUSE_THREADS -DEXTERNAL_OVERFLOW -DDONT_FREE_FIRST
48 #CFLAGS = -g -mieee -Wall $(THREAD_CFLAGS)
49 #CFLAGS = -mieee -O3 -Wall $(THREAD_CFLAGS)
52 #CFLAGS = -g -ieee $(THREAD_CFLAGS)
53 CFLAGS = -O3 -ieee $(THREAD_CFLAGS)
55 OBJ = main.o tables.o loader.o compiler.o newcomp.o builtin.o asmpart.o \
56 toolbox/toolbox.a native.o $(THREAD_OBJ) mm/mm.o
57 OBJH = headers.o tables.o loader.o builtin.o toolbox/toolbox.a $(THREAD_OBJ) \
61 $(CC) $(CFLAGS) -o cacao $(OBJ) -lm
63 $(CC) $(CFLAGS) -o cacaoh $(OBJH) -lm
65 main.o: main.c global.h tables.h compiler.h ncomp/ncomp.h loader.h \
66 asmpart.h builtin.h native.h
68 headers.o: headers.c global.h tables.h loader.h
70 loader.o: loader.c global.h loader.h tables.h native.h asmpart.h
72 compiler.o: builtin.h compiler.h global.h loader.h tables.h native.h \
73 asmpart.h compiler.c comp/*.c sysdep/gen.c sysdep/disass.c
75 newcomp.o: builtin.h ncomp/ncomp.h global.h loader.h tables.h native.h \
76 asmpart.h ncomp/ncompdef.h ncomp/*.c sysdep/ngen.h sysdep/ngen.c sysdep/disass.c
78 builtin.o: builtin.c global.h loader.h builtin.h tables.h sysdep/native-math.h
80 native.o: native.c global.h tables.h native.h asmpart.h builtin.h \
81 nativetypes.hh nativetable.hh nat/*.c
83 tables.o: tables.c global.h tables.h
85 global.h: sysdep/types.h toolbox/*.h
88 toolbox/toolbox.a: toolbox/*.c toolbox/*.h
89 cd toolbox; $(MAKE) toolbox.a "CFLAGS=$(CFLAGS)" "CC=$(CC)"
91 ifeq ($(USE_THREADS),YES)
92 threads/threads.a: threads/*.c threads/*.h sysdep/threads.h
93 cd threads; $(MAKE) threads.a "USE_THREADS=$(USE_THREADS)" "CFLAGS=$(CFLAGS)" "CC=$(CC)"
96 mm/mm.o: mm/*.[ch] mm/Makefile
97 cd mm; $(MAKE) mm.o "USE_THREADS=$(USE_THREADS)" "CFLAGS=$(CFLAGS)" "CC=$(CC)"
99 asmpart.o: sysdep/asmpart.c sysdep/offsets.h
101 $(CC) -E sysdep/asmpart.c > asmpart.s
102 $(CC) -c -o asmpart.o asmpart.s
106 ########################### support targets ####################################
109 rm -f *.o cacao cacaoh cacao.tgz nativetable.hh nativetypes.hh \
111 cd toolbox; $(MAKE) clean
112 cd threads; $(MAKE) clean
115 rm -f cacao.tgz cacao.tar
116 tar -cvf cacao.tar Makefile */Makefile README COPYRIGHT tst/*.java \
117 doc/*.doc html/*.html *.[ch] comp/*.[ch] ncomp/*.[ch] alpha/*.doc alpha/*.[ch] \
118 nat/*.[ch] toolbox/*.[ch] threads/*.[ch] # sparc/*.[ch]
121 mv cacao.tar.gz cacao.tgz
125 rm -rf cacao-$(VERSION_STRING).tar.gz cacao-$(VERSION_STRING);
126 ( mkdir cacao-$(VERSION_STRING); \
127 # tar -cf cacao-$(VERSION_STRING).tar -T FILES; \
128 tar -cvf cacao-$(VERSION_STRING).tar Makefile */Makefile README COPYRIGHT \
129 tst/*.java doc/*.doc html/*.html *.[ch] comp/*.[ch] ncomp/*.[ch] \
130 alpha/*.doc alpha/*.[ch] nat/*.[ch] toolbox/*.[ch] threads/*.[ch]; \
131 cd cacao-$(VERSION_STRING); \
132 tar -xf ../cacao-$(VERSION_STRING).tar; \
134 rm cacao-$(VERSION_STRING).tar; \
135 tar -cvf cacao-$(VERSION_STRING).tar cacao-$(VERSION_STRING); \
136 rm -rf cacao-$(VERSION_STRING); )
137 gzip -9 cacao-$(VERSION_STRING).tar
138 ls -l cacao-$(VERSION_STRING).tar.gz
140 ########################## supported architectures #############################
146 ln -s ../sysdep threads/sysdep
153 ln -s ../sysdep threads/sysdep
158 ##################### generation of NATIVE - header files ######################
160 sysdep/offsets.h nativetypes.hh nativetable.hh : cacaoh
161 ./cacaoh java.lang.Object \
164 java.lang.ClassLoader \
170 java.lang.SecurityManager \
173 java.lang.ThreadGroup \
174 java.lang.Throwable \
177 java.io.FileDescriptor \
178 java.io.FileInputStream \
179 java.io.FileOutputStream \
180 java.io.PrintStream \
181 java.io.RandomAccessFile \
183 java.util.Properties \