From 0d9a33ce507dfb4dfb0aa5001f17ee530c0f0f65 Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 13 Apr 2004 13:28:35 -0700 Subject: [PATCH] fix Adam's UsermodeConstants breakage darcs-hash:20040413202835-24bed-f786de7e908705d685c0f035d580b03ed553d8ce.gz --- Makefile | 46 ++++++++++++++----------------- src/org/xwt/mips/UsermodeConstants.java | 3 ++ 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 9e5f04a..4f4e63b 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,10 @@ - # +# # What to build # # Java sources that are part of the compiler/interpreter java_sources = $(wildcard src/org/xwt/mips/*.java) $(wildcard src/org/xwt/mips/util/*.java) -# Java sources that are part of the compiler/interpreter that are -# generated from other sources -java_gen_sources = $(patsubst %,build/org/xwt/mips/%.java, UsermodeConstants) - # C sources that are part of the compiler/interpreter mips_sources = crt0.c support_aux.c mips_asm_sources = support.s @@ -59,14 +55,9 @@ EXE_EXT = ##### -java_classes = \ - $(java_sources:src/%.java=build/%.class) \ - $(java_gen_sources:%.java=%.class) - +java_classes = $(java_sources:src/%.java=build/%.class) mips_objects = $(mips_sources:%.c=build/org/xwt/mips/%.o) $(mips_asm_sources:%.s=build/org/xwt/mips/%.o) -.SECONDARY: - usr = $(mips2java_root)/upstream/install PATH := $(usr)/bin:$(PATH) export PATH @@ -103,23 +94,13 @@ build/org/xwt/mips/util/.Dummy.class: $(java_classes): build/org/xwt/mips/util/.Dummy.class endif -$(java_classes): $(java_sources) $(java_gen_sources) $(bcel_jar) - $(JAVAC) -classpath $(classpath) -d build $(java_sources) $(java_gen_sources) +$(java_classes): $(java_sources) $(bcel_jar) + $(JAVAC) -classpath $(classpath) -d build $(java_sources) -build/org/xwt/mips/UsermodeConstants.java: src/org/xwt/mips/syscalls.h $(errno_h) $(unistd_h) - @mkdir -p `dirname $@` - cat $^ | ( \ - echo "package org.xwt.mips;"; \ - echo "public interface UsermodeConstants {"; \ - tr '\t' ' ' | sed -n ' \ - s/ */ /g; \ - s/ *# *define \([A-Z_][A-Za-z0-9_]*\) \([0-9][0-9x]*\)/ public static final int \1 = \2;/p'; \ - echo "}"; \ - ) > $@ - $(bcel_jar): upstream/tasks/extract_bcel @true +# GCJ Stuff # FIXME: We're cramming more than we need into the binary here build/mips2java$(EXE_EXT): $(java_sources) $(java_gen_sources) @mkdir -p `dirname $@` @@ -205,8 +186,21 @@ runtime.jar: $(runtime_classes:%=build/org/xwt/mips/%.class) unixruntime.jar: $(unixruntime_classes:%=build/org/xwt/mips/%.class) cd build && jar cf ../$@ $(unixruntime_classes:%=org/xwt/mips/%*.class) - - +# This is only for Brian to use... don't mess with it +rebuild-constants: src/org/xwt/mips/syscalls.h $(errno_h) $(unistd_h) + @mkdir -p `dirname $@` + cat $^ | ( \ + echo "// THIS FILE IS AUTOGENERATED! DO NOT EDIT!"; \ + echo "// run \"make rebuild-constants\" if it needs to be updated"; \ + echo ""; \ + echo "package org.xwt.mips;"; \ + echo "public interface UsermodeConstants {"; \ + tr '\t' ' ' | sed -n ' \ + s/ */ /g; \ + s/ *# *define \([A-Z_][A-Za-z0-9_]*\) \([0-9][0-9x]*\)/ public static final int \1 = \2;/p'; \ + echo "}"; \ + ) > src/org/xwt/mips/UsermodeConstants.java + # # Tests # These are simply here for convenience. They aren't required diff --git a/src/org/xwt/mips/UsermodeConstants.java b/src/org/xwt/mips/UsermodeConstants.java index 3cb29eb..e3ffa35 100644 --- a/src/org/xwt/mips/UsermodeConstants.java +++ b/src/org/xwt/mips/UsermodeConstants.java @@ -1,3 +1,6 @@ +// THIS FILE IS AUTOGENERATED! DO NOT EDIT! +// run "make rebuild-constants" if it needs to be updated + package org.xwt.mips; public interface UsermodeConstants { public static final int SYS_null = 0; -- 1.7.10.4