530aa036dcf0f710a69c5cb10e040756ea989a4a
[nestedvm.git] / Makefile
1 .SECONDARY:
2
3
4 # What to build
5 #
6
7 # Java sources that are part of the compiler/interpreter
8 java_sources = $(wildcard src/org/ibex/nestedvm/*.java) $(wildcard src/org/ibex/nestedvm/util/*.java)
9
10 # C sources that are part of the compiler/interpreter
11 mips_sources = crt0.c support_aux.c
12 mips_asm_sources = support.s
13
14 mips2java_root = $(shell pwd)
15 build = $(mips2java_root)/build
16 tasks = upstream/tasks
17
18 #
19 # MIPS Settings (don't change these)
20 #
21 flags = -march=mips1
22 MIPS_CC = mips-unknown-elf-gcc
23 MIPS_CXX = mips-unknown-elf-g++
24 MIPS_G77 = mips-unknown-elf-g77
25 MIPS_PC = mips-unknown-elf-gpc
26
27 # Be VERY careful about changing any of these as they can break binary 
28 # compatibility and create hard to find bugs
29 mips_optflags = -O3 -g \
30         -mmemcpy \
31         -ffunction-sections -fdata-sections \
32         -falign-functions=512 \
33         -fno-rename-registers \
34         -fno-schedule-insns \
35         -fno-delayed-branch \
36         -freduce-all-givs
37
38 MIPS_CFLAGS = $(mips_optflags) $(flags) -I. -Wall -Wno-unused -Werror
39 MIPS_CXXFLAGS = $(MIPS_CFLAGS)
40 MIPS_PCFLAGS = $(MIPS_CFLAGS) --big-endian
41 MIPS_LD = mips-unknown-elf-gcc
42 MIPS_LDFLAGS= $(flags) --static -Wl,--gc-sections
43 MIPS_STRIP = mips-unknown-elf-strip
44
45 # Java compiler/VM settings
46 JAVAC = javac
47 JAVA = java
48 ifeq ($(firstword $(JAVAC)),gcj)
49         JAVAC_NODEBUG_FLAGS = -g0
50 else
51         JAVAC_NODEBUG_FLAGS = -g:none
52 endif
53
54 CYGWIN = $(findstring CYGWIN,$(shell uname))
55 CLASSGEN_PATH = upstream/build/classgen/build
56 ifneq ($(CYGWIN),)
57         classpath = $(shell cygpath -wp build:$(CLASSGEN_PATH))
58 else
59         classpath = build:$(CLASSGEN_PATH)
60 endif
61
62 GCJ = gcj
63 EXE_EXT = 
64
65 #####
66
67 java_classes = $(java_sources:src/%.java=build/%.class)
68 mips_c_objects = $(mips_sources:%.c=build/org/ibex/nestedvm/%.o)
69 mips_asm_objects = $(mips_asm_sources:%.s=build/org/ibex/nestedvm/%.o)
70 mips_objects = $(mips_asm_objects) $(mips_c_objects)
71
72 usr = $(mips2java_root)/upstream/install
73 PATH := $(usr)/bin:$(PATH)
74 export PATH
75
76 #
77 # General Build Stuff
78 #
79 all: $(java_classes) $(mips_objects)
80 ifdef NATIVE_MIPS2JAVA_COMPILER
81 all: build/mips2java$(EXE_EXT) $(mips_objects)
82 endif
83
84 # HACK: Ensure libc is kept up to date when our mips_objects change
85 $(tasks)/build_libc: $(mips_objects) upstream/misc/extraheaders.sh
86
87 $(tasks)/%:
88         $(MAKE) -C upstream tasks/$* usr="$(usr)" \
89                 MIPS_CFLAGS="$(filter-out -Werror,$(MIPS_CFLAGS))" \
90                 MIPS_PCFLAGS="$(filter-out -Werror,$(MIPS_PCFLAGS))" \
91                 MIPS_LDFLAGS="$(MIPS_LDFLAGS)"
92                 
93 upstream_clean_%:
94         $(MAKE) -C upstream clean_$* usr="$(usr)"
95
96 #
97 # Interpreter/Compiler/Runtime Java Compilation
98 #
99
100 # This works around a gcj -C bug
101 ifeq ($(firstword $(JAVAC)),gcj)
102 build/org/ibex/nestedvm/util/.Dummy.class:
103         mkdir -p `dirname $@`
104         touch $@
105 $(java_classes): build/org/ibex/nestedvm/util/.Dummy.class
106 endif
107
108 $(java_classes): $(java_sources) $(tasks)/build_darcs_classgen
109         $(JAVAC) -classpath "$(classpath)" -d build $(java_sources)
110
111 # GCJ Stuff
112 # FIXME: We're cramming more than we need into the binary here
113 build/mips2java$(EXE_EXT): $(java_sources) $(java_gen_sources)
114         @mkdir -p `dirname $@`
115         $(GCJ) -s -o $@ --main=org.ibex.nestedvm.Compiler $(java_sources) $(java_gen_sources)
116
117 #
118 # MIPS Binary compilation
119 #
120
121 # The nestedvm support library is special, it doesn't a full libc
122 $(mips_c_objects): build/%.o: src/%.c $(tasks)/build_gcc $(tasks)/build_newlib $(tasks)/build_extraheaders
123         @mkdir -p `dirname $@`
124         $(MIPS_CC) $(MIPS_CFLAGS) -c -o $@ $<
125
126 # Everything else needs a full libc
127 build/%.o: src/%.c $(tasks)/build_gcc $(tasks)/build_libc
128         @mkdir -p `dirname $@`
129         $(MIPS_CC) $(MIPS_CFLAGS) $($(notdir $*)_CFLAGS) -c -o $@ $<
130
131 build/%.o: src/%.s $(tasks)/build_gcc
132         @mkdir -p `dirname $@`
133         $(MIPS_CC) -x assembler-with-cpp -c -o $@ $<
134
135 tmp/%.s: %.c $(tasks)/build_gcc
136         @mkdir -p `dirname $@`
137         $(MIPS_CC) $(MIPS_CFLAGS) $($(notdir $*)_CFLAGS) -c -S -o $@ $<
138
139 build/%.mips: build/%.o $(tasks)/build_gcc $(tasks)/build_libc
140         $(MIPS_LD) -o $@ $< $(MIPS_LDFLAGS) $($(notdir $*)_LDFLAGS)
141
142 build/%.mips: src/%.cc $(tasks)/build_gcc_step2 $(tasks)/build_libc
143         @mkdir -p `dirname $@`
144         $(MIPS_CXX) $(MIPS_CXXFLAGS) $($(notdir $*)_CXXFLAGS) $(MIPS_LDFLAGS) $($(notdir $*)_LDFLAGS) -o $@ $<
145
146 build/%.mips: src/%.pas $(tasks)/build_gpc
147         @mkdir -p `dirname $@`
148         $(MIPS_PC) $(MIPS_PCFLAGS) $($(notdir $*)_PCFLAGS) $(MIPS_LDFLAGS) $($(notdir $*)_LDFLAGS) -o $@ $<
149
150 build/%.mips.stripped: build/%.mips $(tasks)/build_linker
151         cp $< $@
152         $(MIPS_STRIP) -s $@
153
154 # MIPS Compiler generated class compilation
155 ifdef DO_JAVASOURCE
156
157 build/%.java: build/%.mips build/org/ibex/nestedvm/JavaSourceCompiler.class 
158         $(JAVA) -cp "$(classpath)" org.ibex.nestedvm.Compiler -outformat javasource $(compiler_flags) $($(notdir $*)_COMPILERFLAGS) $(subst /,.,$*) $< > build/$*.java
159
160 build/%.class: build/%.java build/org/ibex/nestedvm/Runtime.class
161         $(JAVAC) $(JAVAC_NODEBUG_FLAGS) -classpath build -d build $<
162 else
163
164 build/%.class: build/%.mips build/org/ibex/nestedvm/ClassFileCompiler.class
165         $(JAVA) -cp "$(classpath)" org.ibex.nestedvm.Compiler -outformat class -d build $(compiler_flags) $($(notdir $*)_COMPILERFLAGS) $(subst /,.,$*) $<
166
167
168 endif
169
170 # General Java Class compilation
171 build/%.class: src/%.java
172         $(JAVAC) -classpath build -d build $<
173
174 clean:
175         rm -rf build/tests build/org/ibex/nestedvm *.jar build/mips2java$(EXE_EXT)
176
177 #
178 # env.sh
179 #
180 env.sh: Makefile $(tasks)/build_gcc $(tasks)/build_libc build/org/ibex/nestedvm/Compiler.class
181         @rm -f "$@~"
182         @echo 'PATH="$(mips2java_root)/build:$(usr)/bin:$$PATH"; export PATH' >> $@~
183         @echo 'CC=mips-unknown-elf-gcc; export CC' >> $@~
184         @echo 'CXX=mips-unknown-elf-g++; export CXX' >> $@~
185         @echo 'AS=mips-unknown-elf-as; export AS' >> $@~
186         @echo 'AR=mips-unknown-elf-ar; export AR' >> $@~
187         @echo 'LD=mips-unknown-elf-ld; export LD' >> $@~
188         @echo 'RANLIB=mips-unknown-elf-ranlib; export RANLIB' >> $@~
189         @echo 'CFLAGS="$(mips_optflags)"; export CFLAGS' >> $@~
190         @echo 'CXXFLAGS="$(mips_optflags)"; export CXXFLAGS' >> $@~
191         @echo 'LDFLAGS="$(MIPS_LDFLAGS)"; export LDFLAGS' >> $@~
192         @echo 'CLASSPATH=$(mips2java_root)/build:$(mips2java_root)/upstream/build/classgen/build:.; export CLASSPATH' >> $@~
193         @mv "$@~" "$@"
194         @echo "$@ created successfully"
195
196 #
197 # Runtime.jar
198 #
199
200 runtime_classes = Runtime Registers UsermodeConstants util/Seekable
201
202 tex.jar: $(mips_objects) $(runtime_classes:%=build/org/ibex/nestedvm/%.class) build/tests/TeX.class
203         echo -e "Manifest-Version: 1.0\nMain-Class: Tex\n" > .manifest
204         cp upstream/build/tex/TeX.class build
205         cd build && jar cfm ../$@ ../.manifest \
206                 $(runtime_classes:%=org/ibex/nestedvm/%.class) \
207                 org/ibex/nestedvm/Runtime\$$*.class \
208                 org/ibex/nestedvm/util/Seekable\$$*.class
209
210 runtime.jar: $(runtime_classes:%=build/org/ibex/nestedvm/%.class)
211         cd build && jar cf ../$@ \
212                 $(runtime_classes:%=org/ibex/nestedvm/%.class) \
213                 org/ibex/nestedvm/Runtime\$$*.class \
214                 org/ibex/nestedvm/util/Seekable\$$*.class
215
216 .manifest:
217         printf "Manifest-Version: 1.0\nMain-Class: org.ibex.nestedvm.RuntimeCompiler\n" > $@
218
219 nestedvm.jar: $(java_classes) .manifest
220         cd build && jar cfm ../$@ ../.manifest $(java_classes:build/%.class=%*.class)
221         cd $(CLASSGEN_PATH) && jar uf $(mips2java_root)/$@ .
222
223 compact_runtime_compiler.jar: $(java_classes) .manifest $(tasks)/build_darcs_gcclass
224         mkdir -p tmp/pruned
225         rm -rf tmp/pruned/*
226         java -cp \
227                 upstream/build/gcclass/build:upstream/build/gcclass/upstream/bcel-5.1/bcel-5.1.jar \
228         com.brian_web.gcclass.GCClass \
229                 "$(classpath)" tmp/pruned \
230                 org.ibex.nestedvm.RuntimeCompiler.main 'org.ibex.nestedvm.Runtime.decodeData' \
231                 'org.ibex.nestedvm.UnixRuntime.<init>' 'org.ibex.nestedvm.Runtime.initPages' \
232                 'org.ibex.nestedvm.Runtime.clearPages' 'org.ibex.nestedvm.Runtime.syscall' \
233                 'org.ibex.nestedvm.Runtime$$CPUState.dup' \
234                 org.ibex.nestedvm.util.Platform\$$Jdk{11,12,13,14}.'<init>'
235         cd tmp/pruned && jar cfm ../../$@ ../../.manifest .
236
237 sizecheck: compact_runtime_compiler.jar
238         @for c in `find tmp/pruned -name '*.class'|fgrep -v '$$'`; do \
239                 for f in `echo $$c|sed 's,\.class$$,,;'`*.class; do gzip -c $$f; done | wc -c | tr -d '\n'; \
240                 echo -e "\t`echo $$c | sed 's,tmp/pruned/org/ibex,,;s,\.class$$,,;s,/,.,g;'`"; \
241         done | sort -rn | awk '{ sum += $$1; print }  END { print sum,"Total"; }'
242
243
244 # This is only for Brian to use... don't mess with it
245 rebuild-constants: $(tasks)/build_libc
246         @mkdir -p `dirname $@`
247         ( \
248                 cat \
249                         src/org/ibex/nestedvm/syscalls.h \
250                         $(usr)/mips-unknown-elf/include/nestedvm/socket.h \
251                         $(usr)/mips-unknown-elf/include/sys/{errno.h,unistd.h,syslimits.h,sysctl.h}; \
252                 $(MIPS_CC) -E -dM $(usr)/mips-unknown-elf/include/sys/fcntl.h | awk '$$2 ~ /^[OF]_/ { print; }'; \
253         ) | ( \
254                 echo "// THIS FILE IS AUTOGENERATED! DO NOT EDIT!"; \
255                 echo "// run \"make rebuild-constants\" if it needs to be updated"; \
256                 echo ""; \
257                 echo "package org.ibex.nestedvm;"; \
258                 echo "public interface UsermodeConstants {"; \
259                 tr '\t' ' ' | sed -n ' \
260                         s/  */ /g; \
261                         s/ *# *define \([A-Z_][A-Za-z0-9_]*\) \([0-9][0-9a-fA-Fx]*\)/    public static final int \1 = \2;/p'; \
262                 echo "}"; \
263         ) > src/org/ibex/nestedvm/UsermodeConstants.java
264
265 #
266 # Tests
267 # These are simply here for convenience. They aren't required 
268 # to build or run mips2java
269 #
270
271 build/tests/Env.class: build/org/ibex/nestedvm/Runtime.class build/org/ibex/nestedvm/Interpreter.class
272
273 # Generic Hello Worldish test
274 test_COMPILERFLAGS = -o unixruntime
275 test: build/tests/Test.class
276         $(JAVA) -cp build tests.Test "arg 1" "arg 2" "arg 3"
277 inttest: build/tests/Test.mips build/org/ibex/nestedvm/Interpreter.class
278         $(JAVA) -cp build org.ibex.nestedvm.Interpreter build/tests/Test.mips "arg 1" "arg 2" "arg 3"
279 cxxtest: build/tests/CXXTest.class
280         $(JAVA) -cp build tests.CXXTest
281
282 # CallTest
283 build/tests/CallTest.class: build/tests/Test.class
284 calltest: build/tests/CallTest.class
285         $(JAVA) -cp build tests.CallTest `date|perl -pe 's/\D+/ /g;'` `id -u`
286
287 # FDTest
288 build/tests/FDTest.class: build/tests/Test.class
289 fdtest: build/tests/FDTest.class
290         $(JAVA) -cp build tests.FDTest
291
292 # Pascal Test
293 pascaltest: build/tests/PascalHello.class
294         $(JAVA) -cp build tests.PascalHello
295
296 # Simple
297 Simple_LDFLAGS = -nostdlib
298 simpletest: build/tests/Simple.class
299         $(JAVA) -cp build tests.Simple
300
301 # Paranoia
302 Paranoia_CFLAGS = "-Wno-error"
303 Paranoia_LDFLAGS = -lm
304 paranoiatest: build/tests/Paranoia.class
305         $(JAVA) -cp build tests.Paranoia
306
307 # Linpack
308 build/tests/Linpack.mips: $(tasks)/download_linpack $(tasks)/build_gcc_step2
309         mkdir -p `dirname "$@"`
310         $(MIPS_G77) $(MIPS_CFLAGS) $(Linpack_CFLAGS) $(MIPS_LDFLAGS) -o $@ upstream/download/linpack_bench.f -lc
311
312 linpacktest: build/tests/Linpack.class
313         $(JAVA) -cp build tests.Linpack
314
315 #
316 # Freetype Stuff
317 #
318 FreeType_CFLAGS = -Iupstream/build/freetype/include
319 FreeType_LDFLAGS =  -Lupstream/build/freetype/objs -lfreetype
320
321 FreeTypeDemoHelper_CFLAGS = $(FreeType_CFLAGS)
322 FreeTypeDemoHelper_LDFLAGS = $(FreeType_LDFLAGS)
323 build/tests/FreeTypeDemoHelper.o: $(tasks)/build_freetype
324 build/tests/FreeTypeDemoHelper.mips: 
325 build/tests/FreeTypeDemo.class: build/tests/FreeTypeDemoHelper.class
326
327 FTBench_CFLAGS =  $(FreeType_CFLAGS)
328 FTBench_LDFLAGS = $(FreeType_LDFLAGS)
329 build/tests/FTBench.o: $(tasks)/build_freetype
330
331 #
332 # MSPack Stuff
333 #
334 MSPackHelper_CFLAGS = -Iupstream/build/libmspack/mspack
335 MSPackHelper_LDFLAGS = -Lupstream/build/libmspack/mspack -lmspack
336 build/tests/MSPackHelper.o: $(tasks)/build_libmspack
337 build/tests/MSPack.class: build/tests/MSPackHelper.class
338
339 MSPackBench_CFLAGS = -Iupstream/build/libmspack/mspack
340 MSPackBench_LDFLAGS = -Lupstream/build/libmspack/mspack -lmspack
341 build/tests/MSPackBench.o: $(tasks)/build_libmspack
342
343 #
344 # Echo
345 #
346 build/tests/Echo.class: build/tests/EchoHelper.class
347
348 #
349 # Libjpeg
350 #
351 DJpeg_COMPILERFLAGS = -o onepage,pagesize=8m
352 build/tests/DJpeg.mips: $(tasks)/build_libjpeg
353         @mkdir -p `dirname $@`
354         cp upstream/build/libjpeg/djpeg $@
355
356 #
357 # Busybox
358 #
359 BusyBox_COMPILERFLAGS = -o unixruntime
360 build/tests/BusyBox.mips: $(tasks)/build_busybox
361         @mkdir -p `dirname $@`
362         cp upstream/build/busybox/busybox $@
363
364 busyboxtest: build/tests/BusyBox.class
365         $(JAVA) -Dnestedvm.busyboxhack=true -cp "$(classpath)" tests.BusyBox ash
366
367 #
368 # Boehm GC
369 #
370 build/tests/GCTest.mips: $(tasks)/build_boehmgc
371         @mkdir -p `dirname $@`
372         cp upstream/build/boehmgc/gctest $@
373
374 boehmgctest: build/tests/Env.class build/tests/GCTest.class
375         $(JAVA) -cp build tests.Env GC_PRINT_STATS=1  tests.GCTest
376
377
378 # TeX
379
380 Tangle_COMPILERFLAGS = -o unixruntime
381
382 build/tests/Tangle.mips: $(tasks)/build_tex_tangle
383         @mkdir -p `dirname $@`
384         cp upstream/build/tex/tangle.mips $@
385
386
387 TeX_COMPILERFLAGS = -o unixruntime
388 build/tests/TeX.mips: $(tasks)/build_tex
389         @mkdir -p `dirname $@`
390         cp upstream/build/tex/tex.mips $@
391         
392 #
393 # Speed tests
394 #
395
396 build/tests/SpeedTest.class: build/org/ibex/nestedvm/Runtime.class
397
398 tmp/thebride_1280.jpg:
399         @mkdir -p tmp
400         cd tmp && wget http://www.kill-bill.com/images/wallpaper/thebride_1280.jpg
401
402 oldspeedtest: build/tests/DJpeg.class tmp/thebride_1280.jpg
403         bash -c "time $(JAVA) -cp build tests.DJpeg -targa -outfile tmp/thebride_1280.tga tmp/thebride_1280.jpg"
404         @echo "e90f6b915aee2fc0d2eb9fc60ace6203  tmp/thebride_1280.tga" | md5sum -c && echo "MD5 is OK"
405
406 djpegspeedtest: build/tests/SpeedTest.class build/tests/DJpeg.class tmp/thebride_1280.jpg
407         @echo "Running DJpeg test..."
408         @$(JAVA) -cp build tests.SpeedTest tests.DJpeg 8 -targa -outfile tmp/thebride_1280.tga tmp/thebride_1280.jpg
409
410 mspackspeedtest: build/tests/SpeedTest.class build/tests/MSPackBench.class
411         @if [ -e tmp/mspack/comic32.exe ]; then \
412                 echo "Running MSPackBench test..."; \
413                 cd tmp/mspack && $(JAVA) -cp ../../build tests.SpeedTest tests.MSPackBench 20 *32.exe; \
414         else \
415                 echo "Run \"make check\" to get the MS True Type fonts for the MSPackBench test"; \
416         fi
417
418 speedtest: build/tests/SpeedTest.class build/tests/DJpeg.class build/tests/FTBench.class tmp/thebride_1280.jpg build/tests/MSPackBench.class
419         @echo "Running DJpeg test..."
420         @$(JAVA) -cp build tests.SpeedTest tests.DJpeg 10 -targa -outfile tmp/thebride_1280.tga tmp/thebride_1280.jpg
421         @if [ -e tmp/mspack/Comic.TTF ]; then \
422                 echo "Running FTBench test..."; \
423                 $(JAVA) -cp build tests.SpeedTest tests.FTBench 10 tmp/mspack/Comic.TTF tmp/mspack/Comic.TTF.render; \
424         else \
425                 echo "Run \"make check\" to get Arial.TTF for the FTBench test"; \
426         fi
427         @if false && [ -e tmp/mspack/comic32.exe ]; then \
428                 echo "Running MSPackBench test..."; \
429                 cd tmp/mspack && $(JAVA) -cp ../../build tests.SpeedTest tests.MSPackBench 10 *32.exe; \
430         else \
431                 echo "Run \"make check\" to get the MS True Type fonts for the MSPackBench test"; \
432         fi
433
434 intspeed: build/tests/DJpeg.mips  build/org/ibex/nestedvm/Interpreter.class tmp/thebride_1280.jpg
435         time $(JAVA) -cp build org.ibex.nestedvm.Interpreter build/tests/DJpeg.mips -targa  -outfile tmp/thebride_1280.tga tmp/thebride_1280.jpg
436         @echo "e90f6b915aee2fc0d2eb9fc60ace6203  tmp/thebride_1280.tga" | md5sum -c && echo "MD5 is OK"
437
438 #
439 # Verification checks
440 #
441
442 check: $(patsubst %,build/tests/%.class, FTBench MSPackBench DJpeg GCTest) tmp/thebride_1280.jpg
443         @/bin/bash ./src/tests/check.sh running_from_make
444
445 compiletests: $(patsubst %,build/tests/%.class,FTBench MSPackBench DJpeg Test FreeTypeDemoHelper MSPackHelper EchoHelper BusyBox GCTest Fork)
446         @true
447
448
449 #
450 # Darcs stuff
451 #
452
453 commit:
454         @if [ -d _darcs ]; then darcs push; \
455         else echo "You need darcs to commit"; false; \
456         fi
457
458 update:
459         @if [ -d _darcs ]; then darcs pull; \
460         else wget -nH -rl 16 -N -X _darcs http://nestedvm.darcs.brianweb.net; \
461         fi
462
463 #
464 # Paper stuff
465 #
466 charts := $(shell find doc/charts -name \*.dat)
467
468 # IVME Paper
469 doc/charts/%.pdf: doc/charts/%.dat doc/charts/%.gnuplot
470         cd doc/charts; gnuplot $*.gnuplot
471         cd doc/charts; chmod +x boxfill.pl; ./boxfill.pl -g -o unfilled.eps $*.eps
472         cd doc/charts; ps2pdf $*.eps
473
474 doc/ivme04.pdf: doc/ivme04.tex doc/acmconf.cls $(charts:%.dat=%.pdf) build/tests/TeX.class
475         cp upstream/build/tex/tex.pool upstream/build/tex/texinputs/tex.pool
476         cd upstream/build/tex/texinputs && echo '\latex.ltx' | java -cp $(mips2java_root)/build:$(mips2java_root)/$(CLASSGEN_PATH) tests.TeX
477         cd upstream/build/tex/texinputs && ln -fs ../../../../doc/* .; rm -f ivme04.aux; touch ivme04.aux; touch ivme04.bbl
478         cd upstream/build/tex/texinputs && echo '\&latex \input ivme04.tex' | java -cp $(mips2java_root)/build:$(mips2java_root)/$(CLASSGEN_PATH) tests.TeX
479         cd upstream/build/tex/texinputs && bibtex ivme04
480         cd upstream/build/tex/texinputs && echo '\&latex \input ivme04.tex' | java -cp $(mips2java_root)/build:$(mips2java_root)/$(CLASSGEN_PATH) tests.TeX
481         cd upstream/build/tex/texinputs && dvipdf ivme04.dvi
482         #cp upstream/build/tex/texinputs/ivme04.pdf $@
483
484 pdf: doc/ivme04.pdf
485         open doc/ivme04.pdf