The attached assemble.diff has assemble.pl look in its parent
directory if the data files it needs aren't in the current one.  This
lets me camp out in t/ and assemble stuff over and over.

The attached Makefile goes in the t/ directory.  It lets me reassemble
files by invoking "make test.pbc".

-- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sourceforge.net
--- assemble.pl-orig    Fri Sep 14 11:20:05 2001
+++ assemble.pl Fri Sep 14 12:26:38 2001
@@ -59,7 +59,9 @@
                 
 
 # get opcodes from guts.
-open GUTS, "interp_guts.h";
+open(GUTS, "<interp_guts.h") or
+  open(GUTS, "<../interp_guts.h") or
+  die "Can't get opcodes from guts, $!/$^E";
 my %opcodes;
 while (<GUTS>) {
     next unless /\tx\[(\d+)\] = ([a-z0-9_]+);/;
@@ -68,7 +70,9 @@
 close GUTS;
 
 # get opcodes and their arg lists
-open OPCODES, "<opcode_table" or die "Can't get opcode table, $!/$^E";
+open(OPCODES, "<opcode_table") or
+  open(OPCODES, "<../opcode_table") or
+  die "Can't get opcode table, $!/$^E";
 my $opcode_table;
 while (<OPCODES>) {
     $opcode_table .= $_;
# $Id$
# Convenient makefile for assembling files.

.SUFFIXES: .pbc .pasm

.pasm.pbc:
        perl ../assemble.pl $< > $@

Reply via email to