Dan Sugalski:
# Okay, I think it's time to abstract out how the build
# system's handled a
# bit. I'm not sure how much we need, but filling in a template
# makefile's
# not going to cut it, I think.

Well, you caught me at just about the worst time possible--I'm probably
gonna be incommunicado for the next week and a half, and I'm definitely
not going to be able to test things.  OTOH, I've worked on code on paper
during vacations before...

# We've a couple of things we need to do generically:
#
# *) Compile C code to an object module and put that module in a library
# *) Link an executable
# *) Link a shared library with a list of exported routines
# (Yes, we are
# *not* going to export everything)
# *) Delete things for cleanup
# *) General "X depends on Y, run perl program Z to do it" things
# *) Run build in directory X
#
# All filenames with paths can be specified in Unix format, but
# need to go
# through a to_native routine that puts them in platform-native format.
# (Generally just an issue on VMS and MVS, alas, but I think we
# might have
# issues on Win32)

Fairly easy with $^O (or a platform-specific hints file).  On most
platforms all we need is a split, a join and maybe some concats.

# Of course, how you invoke the compiler, librarian, linker, linker for
# shared libraries, delete files, and actually fire off a make
# is horribly
# platform-dependent, as to be otherwise would make things too
# easy for us.

Turn them into function calls and use the hints files (or their
equivalent).

# Any takers? The source dependency files don't have to look
# anything like a
# Makefile if you don't want 'em to...

Okay, this and cleaning up babyperl will be my two projects for the
trip.

I can envision for the dependency system something directly evalable:

(
        'STARTRULE' => 'foo|source',
        'foo|source' => {
                depends => [qw(${INCLDIR}bar|header baz|script baz.frob)],
                action  => 'perl {baz|script} baz.frob'
        },
        'bar|object' => {
                depends => [qw($INCLDIR$parrot|header bar|source)],
                #action omitted, but it knows how to build an object file
        },
        'bar|source' => {
                depends => [qw(generate|script)]
                action => 'perl {generate|script} -yadda > {bar|source}',
        }
        #etc.
)

(The slightly strange 'foo|bar' format is because of things like .dll vs
.so.  I'll probably change most of the format from this, since it looks
so ugly, but you get the idea.)

Unfortunately, I'm not terribly familiar with this sort of thing.  I'm
leaving early in the morning (7:30 Pacific) tomorrow--any info you can
send before then that may help would be wonderful.

--Brent Dax
[EMAIL PROTECTED]
Configure pumpking for Perl 6

They *will* pay for what they've done.

Reply via email to