Hopefully, I'm reaching the right people now.
I'm not subscribed to the makemaker list.

What is the correct way of dealing with source files in 
other directories with MakeMaker ?

Makefile.PL in the Gtk subdir of the Gtk-Perl package,
passes a bunch of "xs/file.o"s as OBJECT to MakeMaker,
but the only rule it generates for these files is

.c$(OBJ_EXT): 
        $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c

But that basically amounts to "cc -c xs/file.c" with a bunch
of defines, which will create a file.o in the current directory
and not in the xs directory, whereas to make the rule specifies
a dependency of xs/file.o on xs/file.c .
What is the best way to resolve this ?

Similarly, in my own module (FCGI), I have some *.c files in 
a different directory (../libfcgi) whose object files I would
like to appear in the current directory.
How do I tell MakeMaker about these *.c files ?
Right now I do this:

        my $extrarules = join "\n",
            map { $b = $_; $b =~ s/\.c$//; my $s="$devkit/libfcgi/$b.c";
                  "$b\$(OBJ_EXT): $s\n\t".
                  '$(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) '."$s\n"; }
                @dist2;
        eval 'package MY; sub postamble { $extrarules; }';

Is there a better way ?

skimo

Reply via email to