charj: don't try to move compiler output when we're just translating
authorAaron Becker <akbecker@gmail.com>
Thu, 21 Jun 2012 23:23:29 +0000 (18:23 -0500)
committerAaron Becker <akbecker@gmail.com>
Thu, 21 Jun 2012 23:23:29 +0000 (18:23 -0500)
src/langs/charj/bin/charjc

index 82486769167ca3fabcd582841d4b07142eec3d1c..ab53cf785ed5074a0e315ab30cac2e25dcbc4b1a 100755 (executable)
@@ -15,6 +15,7 @@ CHARJ_JFLAGS="-classpath $CLASSPATH:$ANTLR_JAR:$JSAP_JAR:$CHARJ_JAR"
 # We need to aggregate all charmc options into one quoted string, while leaving
 # the charjc options alone.
 VERBOSE=false
+NOCOMPILE=false
 CHARMC=$CHARJCHOME/../../../../bin/charmc
 STDLIB=$CHARJCHOME/../src
 CHARMC_ARGS=
@@ -49,6 +50,7 @@ processArgs() {
             shift
             ;;
         "--translate-only")
+            NOCOMPILE=true
             ARGS="$ARGS $arg"
             ;;
         "--count-tokens")
@@ -91,6 +93,8 @@ for file in $CJFILES; do
     fi
     java $CHARJ_JFLAGS charj.Main --charmc "$CHARMC" --stdlib $STDLIB \
         $ARGS $file
-    cp *.o *.decl.h ..
+    if ! $NOCOMPILE; then
+        cp *.o *.decl.h ..
+    fi
 done