Re: [perl #22855] [PATCH] build imcc as parrot

2003-07-03 Thread Andy Dougherty
On Wed, 2 Jul 2003, Benjamin Goldberg wrote:

 Andy Dougherty wrote:

  gmake: *** No rule to make target `languages/imcc/*.o', needed by
  `languages/imcc/imcc'.  Stop.

 Hmm... would it be possible/reasonable to do:
IMCCSRCS = languages/imcc/*.c
IMCCOBJS = $(IMCCSRCS:.c=.o)
 and then use $(IMCCOBJS) in place of languages/imcc/*.o ?

Alas, no.

First, that won't work.  That variable-substitution syntax is a
non-portable extension.

Second, it's unnecessarily redundant.  The full, correct, dependencies for
imcc should already be recorded in languages/imcc/Makefile.  There is no
point in reproducing them in the root Makefile as well.

I suspect it's best to have an IMCC_PROG target that simply
unconditionally does a cd to languages/imcc and calls $(MAKE). However, I
fully recognize that Leo's intent was a minimum patch to build imcc as
the parrot executable, and hence the current state (where the *.o line is
simply deleted) is probably fine for now.

-- 
Andy Dougherty  [EMAIL PROTECTED]


Re: [perl #22855] [PATCH] build imcc as parrot

2003-07-02 Thread Leopold Toetsch
Leopold Toetsch [EMAIL PROTECTED] wrote:

Ok, as there are no problems reported, I've applied it.
Here is again a short summary:

 Attached is a minimum patch to build imcc as the parrot executable
 - renames orig parrot to test_main
 - renames imcc to parrot

 As the current build process needs rework anyway, I kept it to the bare
 minimum.

 Please give it a try on other platforms, especially non Linux.

 $ make test  # full speed ;-)
 $ parrot -j examples/assembly/mops.pasm# run PASM/PIR

and of course:

  $ parrot --help

Some more remarks:
- the one Makefile line with the *.o dependency is gone
- parrot now has one incompatible (WRT old) command line switch:
  -d (--debug) needs an additional parameter, specifying the debug
  level.
  Run -d 1 to get the old behavior.
- Several things are obsolete now, e.g. the quick*test targets in the
  Makefile as well as related code in Test.pm

languages/* users of imcc now should just use the $ROOT/parrot$EXE
executable instead of languages/imcc/imcc.

Have fun,
leo



Re: [perl #22855] [PATCH] build imcc as parrot

2003-07-02 Thread Dan Sugalski
At 3:57 PM +0100 7/1/03, Nicholas Clark wrote:
On Tue, Jul 01, 2003 at 10:04:41AM -0400, Andy Dougherty wrote:
 The problem is that with a clean build tree, there are no *.o files
 down in languages/imcc/ at the point when that target is reached.
 Hence make doesn't have anything to expand *.o as, and quite reasonably
 complains.  If, however, there is even a single .o file in that
 directory, then the wildcard is expanded as you'd expect and the make
 proceeds.
Is it possible to get a Bourne shell (here invoked as subshell) to expand
the wildcard to  if nothing matches? If so, that would solve the problem,
wouldn't it?
I think we'd be better off just specifying the object files. Being 
explicit's a good thing.
--
Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk


Re: [perl #22855] [PATCH] build imcc as parrot

2003-07-02 Thread Benjamin Goldberg


Andy Dougherty wrote:
 
 On Tue, 1 Jul 2003, Leopold Toetsch wrote:
 
  Andy Dougherty [EMAIL PROTECTED] wrote:
   On Mon, 30 Jun 2003, Leopold Toetsch wrote:
 
   Attached is a minimum patch to build imcc as the parrot executable
 
  languages/imcc/*.o
 
   languages/imcc/*.o doesn't match anything
 
  Brain dead make?
 
 No.  Here's the same result with GNU make:
 
 gmake: *** No rule to make target `languages/imcc/*.o', needed by
 `languages/imcc/imcc'.  Stop.
 
 The problem is that with a clean build tree, there are no *.o files
 down in languages/imcc/ at the point when that target is reached.
 Hence make doesn't have anything to expand *.o as, and quite reasonably
 complains.  If, however, there is even a single .o file in that
 directory, then the wildcard is expanded as you'd expect and the make
 proceeds.

Hmm... would it be possible/reasonable to do:
   IMCCSRCS = languages/imcc/*.c
   IMCCOBJS = $(IMCCSRCS:.c=.o)
and then use $(IMCCOBJS) in place of languages/imcc/*.o ?

Obviously, we're never going to not have any .c files :)

-- 
$a=24;split//,240513;s/\B/ = /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print [EMAIL PROTECTED]
]\n;((6=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))redo;}


Re: [perl #22855] [PATCH] build imcc as parrot

2003-07-01 Thread Andy Dougherty
On Tue, 1 Jul 2003, Leopold Toetsch wrote:

 Andy Dougherty [EMAIL PROTECTED] wrote:
  On Mon, 30 Jun 2003, Leopold Toetsch wrote:

  Attached is a minimum patch to build imcc as the parrot executable

 languages/imcc/*.o

  languages/imcc/*.o doesn't match anything

 Brain dead make?

No.  Here's the same result with GNU make:

gmake: *** No rule to make target `languages/imcc/*.o', needed by
`languages/imcc/imcc'.  Stop.

The problem is that with a clean build tree, there are no *.o files
down in languages/imcc/ at the point when that target is reached.
Hence make doesn't have anything to expand *.o as, and quite reasonably
complains.  If, however, there is even a single .o file in that
directory, then the wildcard is expanded as you'd expect and the make
proceeds.

 Anyway, this line could for sure be deleted.

That's probably sufficient for now.  Alternatively, you could simply
always force the descent into languages/imcc.  I can imagine scenarios
where the *.o files were updated but the *.c files weren't (e.g.
re-compiling imcc/*.c with different options) and the root Makefile
would miss that dependency, but such scenarios are certainly outside
the normal run of things.

  Apart from that, it built fine and passed all tests with Sun's cc and
  perl5.00503 on Solaris 8.

 Fine. Thanks for your feedback.

You're welcome.  And thanks for moving us past the perl assembler!

-- 
Andy Dougherty  [EMAIL PROTECTED]


Re: [perl #22855] [PATCH] build imcc as parrot

2003-07-01 Thread Nicholas Clark
On Tue, Jul 01, 2003 at 10:04:41AM -0400, Andy Dougherty wrote:
 The problem is that with a clean build tree, there are no *.o files
 down in languages/imcc/ at the point when that target is reached.
 Hence make doesn't have anything to expand *.o as, and quite reasonably
 complains.  If, however, there is even a single .o file in that
 directory, then the wildcard is expanded as you'd expect and the make
 proceeds.

Is it possible to get a Bourne shell (here invoked as subshell) to expand
the wildcard to  if nothing matches? If so, that would solve the problem,
wouldn't it?

Nicholas Clark


Re: [perl #22855] [PATCH] build imcc as parrot

2003-07-01 Thread Dave Whipp
Andy Dougherty [EMAIL PROTECTED] wrote:
 The problem is that with a clean build tree, there are no *.o files
 down in languages/imcc/ at the point when that target is reached.
 Hence make doesn't have anything to expand *.o as, and quite reasonably
 complains.  If, however, there is even a single .o file in that
 directory, then the wildcard is expanded as you'd expect and the make
 proceeds.

If you want a version of make where non-extisting files will still match the
wildcards (because the wildard engine looks at Make's DAG), you might want
to look at makepp (http://makepp.sourceforge.net). Its written in Perl, so
should be portable to everywhere parrot needs to build. Its blurb makes it
look pretty good, though I've not yet used it in a real project.


Dave.




[perl #22855] [PATCH] build imcc as parrot

2003-06-30 Thread via RT
# New Ticket Created by  Leopold Toetsch 
# Please include the string:  [perl #22855]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt2/Ticket/Display.html?id=22855 


Attached is a minimum patch to build imcc as the parrot executable
- renames orig parrot to test_main
- renames imcc to parrot

As the current build process needs rework anyway, I kept it to the bare 
minimum.

Please give it a try on other platforms, especially non Linux.

$ make test  # full speed ;-)
$ parrot -j examples/assembly/mops.pasm# run PASM/PIR

Thanks,
leo


-- attachment  1 --
url: http://rt.perl.org/rt2/attach/60060/44488/3e05c3/imcc_is_parrot.patch

--- parrot/config/gen/makefiles/imcc.in Fri May 30 21:41:17 2003
+++ parrot-leo/config/gen/makefiles/imcc.in Mon Jun 30 13:41:48 2003
@@ -48,7 +48,7 @@
 
 all : imcc${exe}
 
-../../$(PARROTLIB): ../../parrot$(EXE)
+../../$(PARROTLIB):
cd ..${slash}..  $(MAKE) $(PARROTLIB)  cd languages${slash}imcc
 
 # The .flag files are needed because we are keeping some derived files in CVS,
--- parrot/config/gen/makefiles/root.in Tue Jun 24 22:00:04 2003
+++ parrot-leo/config/gen/makefiles/root.in Mon Jun 30 13:45:49 2003
@@ -194,13 +194,14 @@
 .c$(O) :
$(CC) $(CFLAGS) ${cc_o_out}$@ -c $
 
-all : $(TEST_PROG) docs
+all : $(TEST_PROG) docs $(IMCC_PROG)
 
 
 mops : examples/assembly/mops${exe} examples/mops/mops${exe}
 
 $(TEST_PROG) : test_main$(O) $(GEN_HEADERS) $(LIBPARROT) lib/Parrot/OpLib/core.pm
$(LINK) ${ld_out}$(TEST_PROG) $(LINKFLAGS) test_main$(O) $(LIBPARROT) $(C_LIBS)
+   $(PERL) -MExtUtils::Command -e mv $(TEST_PROG) test_main$(EXE)
 
 lib_deps_object : $(O_FILES)
$(PERL) tools/dev/lib_deps.pl object $(O_FILES)
@@ -518,6 +519,10 @@
languages/imcc/*.l \
languages/imcc/*.o
cd languages${slash}imcc  $(MAKE)  cd ..${slash}..
+   $(PERL) -MExtUtils::Command -e mv $(IMCC_PROG) $(TEST_PROG)
+   cd languages${slash}imcc  $(MAKE)  cd ..${slash}..
+   # this doesn't work here
+   #$(PERL) -MExtUtils::Command -e chmod 0755 $(TEST_PROG)
 
 
 ###
--- parrot/lib/Parrot/Test.pm   Sun Jun  1 11:10:26 2003
+++ parrot-leo/lib/Parrot/Test.pm   Mon Jun 30 13:39:56 2003
@@ -95,6 +95,7 @@
   $can_skip_compile = 0 if (not -e $by_f);
 }
   }
+  $ENV{IMCC} = 'parrot' . $PConfig{exe};
 
   if (!$can_skip_compile) {
   open ASSEMBLY,  $as_f or die Unable to open '$as_f';


Re: [perl #22855] [PATCH] build imcc as parrot

2003-06-30 Thread Andy Dougherty
On Mon, 30 Jun 2003, Leopold Toetsch wrote:

 Attached is a minimum patch to build imcc as the parrot executable

 Please give it a try on other platforms, especially non Linux.

Sun's make failed with the following error:

make: Fatal error: Don't know how to make target `languages/imcc/*.o'

I guess it's because in the following segment of the Makefile,

$(IMCC_PROG) : $(LIBPARROT)\
   languages/imcc/*.c \
   languages/imcc/*.h \
   languages/imcc/*.y \
   languages/imcc/*.l \
   languages/imcc/*.o
cd languages/imcc  $(MAKE)  cd ../..

languages/imcc/*.o doesn't match anything since nothing's been built in
that directory yet.  I suspect it's best to have an IMCC_PROG target that
simply unconditionally does a cd to languages/imcc and calls $(MAKE).

Apart from that, it built fine and passed all tests with Sun's cc and
perl5.00503 on Solaris 8.

-- 
Andy Dougherty  [EMAIL PROTECTED]


Re: [perl #22855] [PATCH] build imcc as parrot

2003-06-30 Thread Leopold Toetsch
Andy Dougherty [EMAIL PROTECTED] wrote:
 On Mon, 30 Jun 2003, Leopold Toetsch wrote:

 Attached is a minimum patch to build imcc as the parrot executable

languages/imcc/*.o

 languages/imcc/*.o doesn't match anything

Brain dead make? Anyway, this line could for sure be deleted.

 Apart from that, it built fine and passed all tests with Sun's cc and
 perl5.00503 on Solaris 8.

Fine. Thanks for your feedback.

leo