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: 1997/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 ################################################################################
25 ##################### generation of the excutable ##############################
27 # Enabling/disabling thread support
31 ifeq ($(USE_THREADS),YES)
32 THREAD_OBJ = threads/threads.a
33 THREAD_CFLAGS = -DUSE_THREADS -DEXTERNAL_OVERFLOW -DDONT_FREE_FIRST
40 #CFLAGS = -g -mieee -Wall $(THREAD_CFLAGS)
41 CFLAGS = -mieee -O3 -Wall $(THREAD_CFLAGS)
44 #CFLAGS = -g3 -ieee $(THREAD_CFLAGS)
45 #CFLAGS = -O3 -ieee $(THREAD_CFLAGS)
47 OBJ = main.o tables.o loader.o compiler.o newcomp.o builtin.o asmpart.o \
48 toolbox/toolbox.a native.o $(THREAD_OBJ)
49 OBJH = headers.o tables.o loader.o builtin.o toolbox/toolbox.a $(THREAD_OBJ)
52 $(CC) $(CFLAGS) -o cacao $(OBJ) -lm
54 $(CC) $(CFLAGS) -o cacaoh $(OBJH) -lm
56 main.o: main.c global.h tables.h compiler.h ncomp/ncomp.h loader.h \
57 asmpart.h builtin.h native.h
59 headers.o: headers.c global.h tables.h loader.h
61 loader.o: loader.c global.h loader.h tables.h native.h asmpart.h
63 compiler.o: builtin.h compiler.h global.h loader.h tables.h native.h \
64 asmpart.h compiler.c comp/*.c sysdep/gen.c sysdep/disass.c
66 newcomp.o: builtin.h ncomp/ncomp.h global.h loader.h tables.h native.h \
67 asmpart.h ncomp/ncompdef.h ncomp/*.c sysdep/ngen.h sysdep/ngen.c sysdep/disass.c
69 builtin.o: builtin.c global.h loader.h builtin.h tables.h sysdep/native-math.h
71 native.o: native.c global.h tables.h native.h asmpart.h builtin.h \
72 nativetypes.hh nativetable.hh nat/*.c
74 tables.o: tables.c global.h tables.h
76 global.h: sysdep/types.h toolbox/*.h
79 toolbox/toolbox.a: toolbox/*.c toolbox/*.h
80 cd toolbox; make toolbox.a "CFLAGS=$(CFLAGS)" "CC=$(CC)"
82 ifeq ($(USE_THREADS),YES)
83 threads/threads.a: threads/*.c threads/*.h sysdep/threads.h
84 cd threads; make threads.a "USE_THREADS=$(USE_THREADS)" "CFLAGS=$(CFLAGS)" "CC=$(CC)"
87 asmpart.o: sysdep/asmpart.c
89 $(CC) -E sysdep/asmpart.c > asmpart.s
90 $(CC) -c -o asmpart.o asmpart.s
94 ########################### support targets ####################################
97 rm -f *.o cacao cacaoh cacao.tgz nativetable.hh nativetypes.hh \
99 cd toolbox; make clean
100 cd threads; make clean
103 rm -f cacao.tgz cacao.tar
104 tar -cvf cacao.tar Makefile */Makefile README COPYRIGHT tst/*.java \
105 doc/*.doc html/*.html *.[ch] comp/*.[ch] ncomp/*.[ch] alpha/*.doc alpha/*.[ch] \
106 nat/*.[ch] toolbox/*.[ch] threads/*.[ch] # sparc/*.[ch]
109 mv cacao.tar.gz cacao.tgz
113 ########################## supported architectures #############################
119 ln -s ../sysdep threads/sysdep
126 ln -s ../sysdep threads/sysdep
131 ##################### generation of NATIVE - header files ######################
133 nativetypes.hh nativetable.hh : cacaoh
134 ./cacaoh java.lang.Object \
137 java.lang.ClassLoader \
143 java.lang.SecurityManager \
146 java.lang.ThreadGroup \
147 java.lang.Throwable \
150 java.io.FileDescriptor \
151 java.io.FileInputStream \
152 java.io.FileOutputStream \
153 java.io.PrintStream \
154 java.io.RandomAccessFile \
156 java.util.Properties \