develooper Front page | perl.perl5.porters | Postings from January 2001

[patch] MM_Unix cpprun shortcut

Thread Next
From:
Doug MacEachern
Date:
January 1, 2001 13:23
Subject:
[patch] MM_Unix cpprun shortcut
Message ID:
Pine.LNX.4.10.10101011312060.3379-100000@mojo.covalent.net
this patch adds
 make ModuleName.pp
as a shortcut for:
 make "CC=cc -E" ModuleName.o > ModuleName.pp

not sure if this is the right place for it, but i find it handy.

--- lib/ExtUtils/MM_Unix.pm~	Fri Dec 15 07:20:25 2000
+++ lib/ExtUtils/MM_Unix.pm	Mon Jan  1 13:25:48 2001
@@ -266,6 +266,14 @@
     my($self) = shift;
     return '' unless $self->needs_linking();
     my(@m);
+    if (my $cpp = $Config{cpprun}) {
+        my $cpp_cmd = $self->const_cccmd;
+        $cpp_cmd =~ s/^CCCMD\s*=\s*\$\(CC\)/$cpp/;
+        push @m, '
+.c.pp:
+	'. $cpp_cmd . ' $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c > $*.pp
+';
+    }
     push @m, '
 .c$(OBJ_EXT):
 	$(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
@@ -630,7 +638,7 @@
 # work around a famous dec-osf make(1) feature(?):
 makemakerdflt: all
 
-.SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)
+.SUFFIXES: .xs .c .C .cpp .pp .cxx .cc \$(OBJ_EXT)
 
 # Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
 # some make implementations will delete the Makefile when we rebuild it. Because


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About