[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] controlling C compilers from MacPerl?



[Sorry for the delay . There are still more than 300 unanswered mails in my
inbox]

davidh@SDL.UG.EDS.COM writes:
>I need to implement an automatic rebuild system for a project consisting 
>of about 1500 C files. This should be capable of receiving a set of source
>files from a remote system and doing full or incremental builds overnight, 

>There are a few things I'm not sure of in this translation process. The major
>one is that we don't have system() in MacPerl,

system() works, provided you have MPW Toolserver.

>so we have to interact with 
>other applications in a different way. I have CodeWarrior 9 as my C compiler, 
>and I have discovered it supports a suite of AppleEvents which look as though 
>they might do the trick. We would want to:
>
>* set compiler options, possibly differently for different C files, if we
>need to deoptimise, for example to get round a bug.

That's not the way the CodeWarrior IDE works. CodeWarrior is based on project
files, and building those on the fly is a bit complicated. I'd recommend using
the Metrowerks compilers for MPW (that's how MacPerl is built, for example).

>* do various stages of preprocessing on a file, using in-house tools, written
>in C and ported to Mac.

Easy in MPW.

>* compile individual files, and capture all error output such that this is
>writable to a log file, maintained by the Perl rebuild system.

Easy in MPW.

>* link and test a final image, and report on the results.

Easy in MPW.

>So to my questions:
>
>(1) Does using MacPerl sound a sensible approach to the problem, or would
>it be better to use MPW shellscript or Applescript (e.g. for reasons of speed)
?

A mix of Perl and MPW shellscripts is often quite effective for such problems.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
  "Thou shalt not answer questionnaires // Or quizzes upon world affairs,
   Nor with compliance // Take any test. Thou shalt not sit 
   with statisticians nor commit // A social science."
                         -- W.H. Auden, _Under which lyre_