Author: chromatic
Date: Sun Feb 18 01:17:25 2007
New Revision: 17038

Added:
   trunk/config/gen/makefiles/parrot_embed.in
Modified:
   trunk/MANIFEST
   trunk/config/gen/makefiles.pm

Log:
Added a Parrot-style Makefile for Parrot::Embed.
 
I *hope* it's cross platform, but there's a tricky bit of Perl configuration
that needs evaluation within the generated Makefile.  This may be gmake
specific.
     
If this does work on other platforms, we may be able to enable Parrot::Embed in
the build by default.

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST      (original)
+++ trunk/MANIFEST      Sun Feb 18 01:17:25 2007
@@ -231,6 +231,7 @@
 config/gen/makefiles/json.in                                []
 config/gen/makefiles/languages.in                           []
 config/gen/makefiles/parrot.pc.in                           []
+config/gen/makefiles/parrot_embed.in                        []
 config/gen/makefiles/past-pm.in                             []
 config/gen/makefiles/past.in                                []
 config/gen/makefiles/pge.in                                 []

Modified: trunk/config/gen/makefiles.pm
==============================================================================
--- trunk/config/gen/makefiles.pm       (original)
+++ trunk/config/gen/makefiles.pm       Sun Feb 18 01:17:25 2007
@@ -60,6 +60,7 @@
     my ( $self, $conf ) = @_;
 
     genfile( 'config/gen/makefiles/root.in' => 'Makefile' );
+    genfile( 'config/gen/makefiles/parrot_embed.in' => 
'ext/Parrot-Embed/Makefile' );
 
     genfile( 'config/gen/makefiles/past.in'      => 'compilers/past/Makefile' 
);
     genfile( 'config/gen/makefiles/past-pm.in'   => 
'compilers/past-pm/Makefile' );

Added: trunk/config/gen/makefiles/parrot_embed.in
==============================================================================
--- (empty file)
+++ trunk/config/gen/makefiles/parrot_embed.in  Sun Feb 18 01:17:25 2007
@@ -0,0 +1,57 @@
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+#
+# cross-platform commands and paths
+RM_F            = @rm_f@
+RM_RF           = @rm_rf@
+MKPATH          = @mkpath@
+CP              = @cp@
+PERL            = @perl@
+PERL_INC       = $(shell $(PERL) -MConfig -e "print 
\$$Config::Config{archlib}")/CORE
+PERL_TYPEMAP    = $(shell $(PERL) -MExtUtils::MakeMaker -e "\$$_ = 
\$$INC{\"ExtUtils/MakeMaker.pm\"}; s/MakeMaker.pm/typemap/; print")
+PARROT          = ../../parrot$(EXE)
+
+# compilation options
+O               = @o@
+SHARE_EXT       = @share_ext@
+C_LIBS          = @libs@
+ALL_PARROT_LIBS = @libparrot_ldflags@ $(ICU_SHARED) $(C_LIBS)
+LINKFLAGS       = @linkflags@ @link_debug@ @ld_debug@
+LINK            = @link@
+LD_SHARE_FLAGS  = @ld_share_flags@
+CC_INC          = -I$(PERL_INC) -I../../include
+CFLAGS          = $(CC_INC) @ccflags@ @cc_debug@ @ccwarn@ @cc_hasjit@ 
@cg_flag@ @gc_flag@ $(CC_SHARED)
+
+# files needing compilation
+C_FILE          = lib/Parrot/Embed.c
+SO_FILE         = blib/arch/auto/Parrot/Embed/Embed$(SHARE_EXT)
+O_FILE          = lib/Parrot/Embed$(O)
+
+# other useful files
+PM              = blib/lib/Parrot/Embed.pm
+PBC             = t/greet.pbc
+TEST_FILES      = t/*.t
+
+all : $(SO_FILE) $(PM) $(PBC)
+
+$(O_FILE) : $(C_FILE)
+
+$(PM) : lib/Parrot/Embed.pm
+       $(MKPATH) blib/lib/Parrot
+       $(CP) lib/Parrot/Embed.pm blib/lib/Parrot
+
+$(SO_FILE) : $(O_FILE)
+       $(MKPATH) blib/arch/auto/Parrot/Embed
+       $(LINK) $(LD_SHARE_FLAGS) -o $(SO_FILE) $(O_FILE) @rpath_blib@ 
$(ALL_PARROT_LIBS) $(LINKFLAGS)
+
+$(C_FILE) : lib/Parrot/Embed.xs
+       ( cd lib/Parrot; xsubpp -prototypes -typemap $(PERL_TYPEMAP) -typemap 
../../typemap Embed.xs > Embed.c )
+
+$(PBC) : t/greet.pir
+       $(PARROT) -o $(PBC) t/greet.pir
+
+test : $(TEST_FILES)
+       prove -b $(TEST_FILES)
+
+clean : 
+       $(RM_RF) blib $(C_FILE) $(O_FILE)

Reply via email to