You can find examples of this type of thing all over the place, but a notable one is with the
Apache Web server. When compiling, there is a program called
apaci which is a wrapper that works just like you want. It is simply a
sh script. Here's a theoretical approximation:
#!/bin/sh
# Set Variables
FOO="bar"
CC="gcc"
COPTS="-l -q -r"
# Execute whatever
$*
All it does is set a few variables and then run whatever commands you give it. This also means that
make doesn't "talk" as much during compiles since the commands are shorter. I'm not a fan of Makefiles which spew out reams of useless "-I../../../../../src -DSOMETHING -DSOMETHING_ELSE ..." type parameters since it is harder to casually spot warnings, and harder still to parse what is actually going on.
As a note, though, you may not want to use Perl to actually execute the make process(es) as it is fairly heavy compared to a shell, something that might slow down your build. It might be advantageous for Perl to generate the required shell scripts and then kick off the whole process with a single
exec call.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.