cvsuser     02/07/06 23:09:17

  Modified:    .        make.pl
               lib/Make CC_Obj.pm Dependency.pm Link_Obj.pm Target_Obj.pm
  Added:       lib/Make Archive_Obj.pm Link_Shared_Obj.pm Lint_Obj.pm
  Log:
  Okay, as promised, some changes.
  
  The most obvious change is that make.pl has had the entire Parrot makefile inserted 
into it. This is just so that I have something to work with. It will likely be torn 
down and rebuilt by the simple expedient of taking away the Makefile and adding target 
after target until the original makefile is replicated.
  
  The new Make objects should be pretty self-explanatory, I hope.
  
  All targets now have some new optional parameters, specifically 'flags', 
'libraries', and 'library_paths'. (Er, well, wherever it makes sense.) The code to do 
this is somewhat simplistic and will probably be properly factored out of the 
subclasses in the next revision.
  
  'Shared_Object' has been added to the main dependencies. After some basic variables 
have been added I might make it autoversion the shared object.
  
  *please* don't take the code currently in CVS as anywhere near a finished work of 
art. It isn't polished, or even rough-hewn at this point. I think it'll go through a 
few revs before finally becoming the final product.
  
  Revision  Changes    Path
  1.7       +865 -3    parrot/make.pl
  
  Index: make.pl
  ===================================================================
  RCS file: /cvs/public/parrot/make.pl,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- make.pl   7 Jul 2002 03:40:52 -0000       1.6
  +++ make.pl   7 Jul 2002 06:08:45 -0000       1.7
  @@ -3,11 +3,873 @@
   use strict;
   use FindBin;
   use lib "$FindBin::Bin/lib";
  -use Make::Dependency qw(Object Executable);
  +use Make::Dependency qw(Object Shared_Object Executable);
  +use Make::Archive_Obj qw(Archive);
   use Make::CC_Obj qw(CC);
   use Make::Link_Obj qw(Link);
  +use Make::Link_Shared_Obj qw(Link_Shared);
   use Make::Perl_Obj qw(Perl);
   use Make::Target_Obj qw(Target);
  +use YAML qw(Store);
  +
  +my $depends = {};
  +my $VERSION = "0.0.6";
  +
  +#O = .o
  +#SO = .so
  +#A = .a
  +#RM_F = rm -f
  +#RM_RF = rm -rf
  +#AR_CRS = ar crs
  +#LD = cc
  +#LD_SHARED = -shared
  +#LD_OUT = -o 
  +
  +# No translation required, hopefully.
  +# Handled by Link_Shared maybe?
  +
  +#INC=include/parrot
  +
  +my $INC = 'include/parrot';
  +
  +###############################################################################
  +#
  +# "STICKY" GENERATED FILES:
  +#
  +# These files are created when Configure.pl runs.
  +#
  +# We don't delete these on 'clean' only on 'realclean'.
  +# That way, we don't have to re-Configure.pl after making
  +# clean.
  +#
  +###############################################################################
  +
  +#GEN_MAKEFILES = Makefile classes/Makefile languages/Makefile docs/Makefile \
  +#languages/jako/Makefile languages/miniperl/Makefile languages/scheme/Makefile
  +
  +my @GEN_MAKEFILES = qw(
  +  Makefile
  +  classes/Makefile languages/Makefile docs/Makefile
  +  languages/jako/Makefile languages/miniperl/Makefile languages/scheme/Makefile
  +);
  +
  +#GEN_CONFIGS  = include/parrot/config.h include/parrot/platform.h \
  +#                       lib/Parrot/Config.pm lib/Parrot/Types.pm platform.c
  +
  +my @GEN_CONFIGS = qw(
  +  include/parrot/config.h include/parrot/platform.h
  +  lib/Parrot/Config.pm lib/Parrot/Types.pm
  +  platform.c
  +);
  +
  +#STICKY_FILES = $(GEN_CONFIGS) $(GEN_MAKEFILES) config.opt
  +
  +my @STICKY_FILES = ( @GEN_CONFIGS, @GEN_MAKEFILES, 'config.opt' );
  +
  +###############################################################################
  +#
  +# "FLUID" GENERATED FILES:
  +#
  +# These files are created during the build process.
  +#
  +# We *do* delete these on 'clean'.
  +#
  +###############################################################################
  +
  +#GEN_OPSFILES = 
  +
  +my @GEN_OPSFILES = undef;
  +
  +#GEN_HEADERS = $(INC)/vtable.h $(INC)/oplib/core_ops.h \
  +#$(INC)/oplib/core_ops_prederef.h
  +
  +my @GEN_HEADERS = ("$INC/vtable.h", "$INC/oplib/core_ops.h", # XXX
  +                   "$INC/oplib/core_ops_prederef.h");
  +
  +#GEN_SOURCES = core_ops.c core_ops_prederef.c
  +
  +my @GEN_SOURCES = qw(core_ops.c core_ops_prederef.c);
  +
  +#GEN_MODULES = lib/Parrot/Jit.pm lib/Parrot/PMC.pm lib/Parrot/OpLib/core.pm
  +
  +my @GEN_MODULES = qw(lib/Parrot/Jit.pm lib/Parrot/PMC.pm
  +                     lib/Parrot/OpLib/core.pm);
  +
  +#FLUID_FILES = $(GEN_OPSFILES) $(GEN_HEADERS) $(GEN_SOURCES) $(GEN_MODULES)
  +
  +my @FLUID_FILES = (@GEN_OPSFILES, @GEN_HEADERS, @GEN_SOURCES, @GEN_MODULES);
  +
  +###############################################################################
  +#
  +# OTHER FILE GROUPS:
  +#
  +###############################################################################
  +
  +#GENERAL_H_FILES = $(INC)/config.h $(INC)/exceptions.h $(INC)/io.h $(INC)/op.h \
  +#$(INC)/register.h $(INC)/string.h $(INC)/events.h $(INC)/interpreter.h \
  +#$(INC)/memory.h $(INC)/parrot.h $(INC)/stacks.h $(INC)/packfile.h \
  +#$(INC)/global_setup.h $(INC)/vtable.h $(INC)/oplib/core_ops.h \
  +#$(INC)/oplib/core_ops_prederef.h $(INC)/runops_cores.h $(INC)/trace.h \
  +#$(INC)/pmc.h $(INC)/key.h $(INC)/hash.h $(INC)/resources.h $(INC)/platform.h 
$(INC)/oplib/core_ops_cg.h \
  +#$(INC)/interp_guts.h  $(INC)/rx.h $(INC)/rxstacks.h \
  +#$(INC)/embed.h $(INC)/warnings.h $(INC)/misc.h $(INC)/debug.h
  +
  +# Okay, doing this one quasiprogrammatically.
  +
  +my @GENERAL_H_FILES = map {
  +  "$INC/${_}.h"
  +} qw(
  +  config exceptions io.op register string events interpreter memory parrot
  +  stacks packfile global_setup vtable oplib/core_ops oplib/core_ops_prederef
  +  runops_cores trace pmc key hash resources platform oplib/core_ops_cg
  +  interp_guts rx rxstacks embed warnings misc debug
  +);
  +
  +#ALL_H_FILES = $(GENERAL_H_FILES)
  +
  +my @ALL_H_FILES = @GENERAL_H_FILES;
  +
  +#O_DIRS = classes
  +
  +my @O_DIRS = qw(classes);
  +
  +#CLASS_O_FILES =  classes/array$(O) classes/coroutine$(O) classes/default$(O) 
classes/intqueue$(O) classes/perlarray$(O) classes/perlhash$(O) classes/perlint$(O) 
classes/perlnum$(O) classes/perlstring$(O) classes/perlundef$(O) classes/pointer$(O) 
classes/sub$(O)
  +
  +# XXX Doing this one programmatically as well
  +
  +my @CLASS_O_FILES = map {
  +  Object(input=>"classes/$_")
  +} qw(
  +  array coroutine default intqueue
  +  perlarray perlhash perlint perlnum perlstring perlundef
  +  pointer sub
  +);
  +
  +#ENCODING_O_FILES = encodings/singlebyte$(O) encodings/utf8$(O) \
  +#                               encodings/utf16$(O) \
  +#                           encodings/utf32$(O)
  +
  +# XXX Same here...
  +
  +my @ENCODING_O_FILES = map {
  +  Object(input=>"encodings/$_")
  +} qw(
  +  singlebyte utf8 utf16 utf32
  +);
  +
  +#CHARTYPE_O_FILES = chartypes/unicode$(O) chartypes/usascii$(O)
  +
  +# XXX Okay, tired of mentioning this.
  +
  +my @CHARTYPE_O_FILES = map {
  +  Object(input=>"chartypes/$_")
  +} qw(
  +  unicode usascii
  +);
  +
  +#IO_O_FILES = io/io$(O) io/io_buf$(O) io/io_unix$(O) io/io_win32$(O) \
  +#             io/io_stdio$(O)
  +
  +# XXX See previous comment
  +
  +my @IO_O_FILES = map {
  +  Object(input=>"io/$_")
  +} qw(
  +  io io_buf io_unix io_win32 io_stdio
  +);
  +
  +#INTERP_O_FILES = exceptions$(O) global_setup$(O) interpreter$(O) parrot$(O) \
  +#                             register$(O) core_ops$(O) core_ops_prederef$(O) 
memory$(O) \
  +#                             packfile$(O) stacks$(O) string$(O) sub$(O) 
encoding$(O) \
  +#                             chartype$(O) runops_cores$(O) trace$(O) pmc$(O) 
key$(O) hash$(O) \
  +#                             platform$(O)  resources$(O) rx$(O) rxstacks$(O) \
  +#                             embed$(O) warnings$(O) misc$(O) core_ops_cg$(O) \
  +#                             packout$(O) byteorder$(O) debug$(O)
  +
  +# XXX See previous XXX
  +
  +my @INTERP_O_FILES = map {
  +  Object(input=>$_)
  +} qw(
  +  exceptions global_setup interpreter parrot register
  +  core_ops core_ops_prederef
  +  memory packfiles stacks string sub encoding chartype runops_cores trace pmc
  +  key hash platform resources rx rxstacks embed warnings misc core_ops_cg
  +  packout byteorder debug
  +);
  +
  +#O_FILES = $(INTERP_O_FILES) \
  +#          $(IO_O_FILES) \
  +#              $(CLASS_O_FILES) \
  +#              $(ENCODING_O_FILES) \
  +#              $(CHARTYPE_O_FILES)
  +
  +my @O_FILES = (
  +  @INTERP_O_FILES, @IO_O_FILES, @CLASS_O_FILES, @ENCODING_O_FILES,
  +  @CHARTYPE_O_FILES
  +);
  +
  +#OPS_FILES = core.ops debug.ops io.ops math.ops rx.ops $(GEN_OPSFILES)
  +
  +my @OPS_FILES = (
  +  'core.ops', 'debug.ops', 'io.ops', 'math.ops', 'rx.ops',
  +  @GEN_OPSFILES
  +);
  +
  +###############################################################################
  +#
  +# BUILD TOOL CONFIGURATIONS:
  +#
  +# DO NOT ADD C COMPILER FLAGS HERE
  +# Add them in Configure.pl--look for the
  +# comment 'ADD C COMPILER FLAGS HERE'
  +#
  +###############################################################################
  +
  +#CFLAGS = -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline 
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return 
-Winline -W -Wno-unused -Wsign-compare   -I./include  -DHAVE_COMPUTED_GOTO
  +
  +my @CFLAGS = qw(
  +  -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
  +  -D_FILE_OFFSET_BITS=64  -Wall -Wstrict-prototypes -Wmissing-prototypes
  +  -Winline -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings
  +  -Waggregate-return -Winline -W -Wno-unused -Wsign-compare -I./include
  +  -DHAVE_COMPUTED_GOTO
  +);
  +Make::CC_Obj::flags(@CFLAGS);
  +
  +#LDFLAGS =  -L/usr/local/lib 
  +
  +my @LDFLAGS = qw(
  +  -L/usr/local/lib
  +);
  +Make::Link_Obj::flags(@LDFLAGS);
  +
  +#C_LIBS = -lnsl -ldl -lm -lcrypt -lutil
  +
  +my @C_LIBS = qw(
  +  -lnsl -ldl -lm -lcrypt -lutil
  +);
  +Make::CC_Obj::libraries(@C_LIBS);
  +
  +#CC = cc
  +
  +# XXX Shouldn't need to be explicitly mentioned
  +
  +###############################################################################
  +#
  +# BUILD TARGET CONFIGURATIONS:
  +#
  +###############################################################################
  +
  +#TEST_PROG = parrot
  +
  +my $TEST_PROG = Executable(input=>'parrot');
  +
  +# XXX Not sure how to represent running arbitrary programs...
  +
  +#TEST_PROG_SO = parrot_so
  +
  +my $TEST_PROG_SO = Executable(input=>'parrot_so');
  +
  +# XXX Not sure how to represent running arbitrary programs...
  +
  +#PDUMP = pdump
  +
  +# XXX Not sure how to represent running arbitrary programs...
  +
  +#LINT = lclint
  +
  +# XXX Shouldn't need to be set up
  +
  +#
  +# XXX Note below that 'LINTFLAGS' and 'LINTFLAGS2' are two separate sets of
  +# XXX flags that have to be passed to the build system.
  +# XXX This needs to be decided upon.
  +#
  +
  +# note: +distinctinternalnames with +externalnamelen at 8 characters
  +#       (the ANSI standard) is not going to fly for us.  
  +#LINTFLAGS = -weak +showscan +showsummary +posixstrictlib -abstract +aliasunique 
+ansireserved +ansireservedinternal +assignexpose +bitwisesigned +boolcompare 
+booltype BOOLVAL +casebreak -castfcnptr -charint +continuecomment +controlnestdepth 
15 +cppnames +declundef +distinctinternalnames +evalorder +fielduse +forcehints -globs 
+imptype +includenest 8 +incondefs +incondefslib +linelen 9999 +longintegral 
+macroassign +macroempty +macroredef +matchanyintegral +nestedextern +noeffect 
+readonlystrings +realcompare +shadow -type
  +
  +my @LINTFLAGS = qw(
  +  -weak +showscan +showsummary +posixstrictlib -abstract +aliasunique
  +  +ansireserved +ansireservedinternal +assignexpose +bitwisesigned
  +  +boolcompare +booltype BOOLVAL +casebreak -castfcnptr -charint
  +  +continuecomment +controlnestdepth 15 +cppnames +declundef
  +  +distinctinternalnames +evalorder +fielduse +forcehints -globs +imptype
  +  +includenest 8 +incondefs +incondefslib +linelen 9999 +longintegral
  +  +macroassign +macroempty +macroredef +matchanyintegral +nestedextern
  +  +noeffect +readonlystrings +realcompare +shadow -type
  +);
  +
  +#LINTFLAGS2 = $(LINTFLAGS) -ansireserved -retvalother
  +
  +my @LINTFLAGS2 = (@LINTFLAGS, '-ansireserved', '-retvalother');
  +
  +###############################################################################
  +#
  +# MAKE CONFIGURATION:
  +#
  +###############################################################################
  +
  +#
  +# This is set to  MAKE=$make if your $make command doesn't
  +# do it for you.
  +#
  +
  +# XXX Shouldn't need to be done anymore
  +
  +#
  +
  +#.c$(O) :
  +#    $(CC) $(CFLAGS) -o $@ -c $<
  +
  +#all : $(TEST_PROG) docs
  +
  +$depends->{all} = Target(
  +  input => undef,
  +  dependsOn => [ $TEST_PROG, 'docs' ],
  +);
  +
  +#mops : examples/assembly/mops examples/mops/mops
  +
  +# XXX This needs to be properly phrased. I'm not sure how this will be
  +# XXX accomplished.
  +
  +$depends->{mops} = Target(
  +  input => undef,
  +  dependsOn => [qw(examples/assembly/mops examples/mops/mops)],
  +);
  +
  +## XXX Unix-only for now
  +#libparrot$(A) : $(O_DIRS) $(O_FILES)
  +#    $(AR_CRS) $@ $(O_FILES)
  +
  +# XXX The Archive tool won't build unless we're under UNIX.
  +
  +my $libparrot_A = Archive(
  +  input => [@O_FILES], # XXX Not sure what $@ is in make-speak
  +  dependsOn => [@O_DIRS, @O_FILES],
  +);
  +
  +#$(TEST_PROG) : test_main$(O) $(GEN_HEADERS) $(O_DIRS) $(O_FILES) 
lib/Parrot/OpLib/core.pm lib/Parrot/PMC.pm lib/Parrot/.dummy
  +#    $(LD) -o $(TEST_PROG) $(LDFLAGS) $(O_FILES) test_main$(O) $(C_LIBS)
  +
  +# XXX Includes LDFLAGS and C_LIBS automagically.
  +# XXX This may, of course, be the wrong behavior.
  +
  +$TEST_PROG = Link(
  +  input => [@O_FILES, Object(input=>'test_main')],
  +  output => Executable(input=>'parrot'),
  +  dependsOn => [Object(input=>'test_main'),@GEN_HEADERS,@O_DIRS,@O_FILES,
  +    'lib/Parrot/OpLib/core.pm','lib/Parrot/PMC.pm','lib/Parrot/.dummy'
  +  ],
  +);
  +
  +#lib_deps_object : $(O_DIRS) $(O_FILES)
  +#    $(PERL) tools/dev/lib_deps.pl object $(O_FILES)
  +
  +my $lib_deps_object = Perl( # XXX
  +  input => 'tools/dev/lib_deps.pl',
  +  dependsOn => [ @O_DIRS, @O_FILES ],
  +  commandLine => "tools/dev/lib_deps.pl object @O_FILES",
  +);
  +
  +#lib_deps_source : $(GENERAL_H_FILES)
  +#    $(PERL) tools/dev/lib_deps.pl source all_source
  +
  +my $lib_deps_source = Perl( # XXX
  +  input => 'tools/dev/lib_deps.pl',
  +  dependsOn => [ @GENERAL_H_FILES ],
  +  commandLine => "tools/dev/lib_deps.pl source all_source",
  +);
  +
  +#lib_deps : lib_deps_object lib_deps_source
  +
  +# XXX The dependsOn will eventually be their own objects down below.
  +# XXX This forces a certain amount of linearity to the app that I really don't
  +# XXX like though.
  +
  +$depends->{lib_deps} = Target(
  +  input => undef, # XXX
  +  dependsOn => ['lib_deps_object', 'lib_deps_source'], 
  +);
  +
  +#check_source : $(GENERAL_H_FILES)
  +#    $(PERL) tools/dev/check_source_standards.pl all_source
  +
  +my $check_source = Perl( # XXX
  +  input => undef, # XXX 
  +  dependsOn => [ @GENERAL_H_FILES ],
  +  commandLine => "tools/dev/check_source_standards.pl all_source",
  +);
  +
  +###############################################################################
  +#
  +# Shared Library Targets:
  +#
  +# XXX This target is not portable to Win32
  +#
  +###############################################################################
  +
  +# XXX New addition
  +
  +my $libparrot_shared = Shared_Object(input=>'blib/lib/libparrot').$VERSION;
  +
  +#blib :
  +#    mkdir -p blib
  +
  +$depends->{blib} = Target(
  +  action => 'mkdir -p blib',
  +  input => undef,
  +  dependsOn => undef,
  +);
  +
  +#blib_lib :
  +#    mkdir -p blib/lib
  +
  +$depends->{blib_lib} = Target(
  +  action => 'mkdir -p blib/lib',
  +  input => undef,
  +  dependsOn => undef,
  +);
  +
  +#shared : blib_lib blib/lib/libparrot$(SO) blib/lib/libcore_prederef$(SO) 
$(TEST_PROG_SO)
  +
  +$depends->{shared} = Target(
  +  input => undef, # XXX
  +  dependsOn => [ 'blib_lib', $libparrot_shared,
  +                 Shared_Object(input=>'blib/lib/libcore_prederef'),
  +                 $TEST_PROG_SO
  +               ],
  +);
  +
  +#blib/lib/libparrot$(SO).0.0.6 : blib_lib $(O_DIRS) $(O_FILES)
  +#    $(LD) $(LD_SHARED) -Wl,-soname,libparrot$(SO).0 $(LDFLAGS) 
$(LD_OUT)blib/lib/libparrot$(SO).0.0.6 $(O_FILES)
  +
  +# XXX Note the introduction of the flags variable
  +
  +my $shared_blib_lib_libparrot = Link_Shared(
  +  input => [@O_FILES],
  +  output => $libparrot_shared,
  +  flags => ['-Wl', "-soname,".Shared_Object(input=>'libparrot')],
  +  dependsOn => [$depends->{blib_lib}, @O_DIRS, @O_FILES],
  +);
  +
  +#------------------------------------------------------------------------------
  +=pod
  +
  +blib/lib/libparrot$(SO).0.0 : blib/lib/libparrot$(SO).0.0.6
  +     $(RM_F) $@
  +     cd blib/lib; ln -s libparrot$(SO).0.0.6 libparrot$(SO).0.0
  +
  +blib/lib/libparrot$(SO).0 : blib/lib/libparrot$(SO).0.0
  +     $(RM_F) $@
  +     cd blib/lib; ln -s libparrot$(SO).0.0 libparrot$(SO).0
  +
  +blib/lib/libparrot$(SO) : blib/lib/libparrot$(SO).0
  +     $(RM_F) $@
  +     cd blib/lib; ln -s libparrot$(SO).0 libparrot$(SO)
  +
  +blib/lib/libcore_prederef$(SO).0.0.6 : blib_lib core_ops_prederef$(O)
  +     $(LD) $(LD_SHARED) -Wl,-soname,libparrot$(SO).0 $(LDFLAGS) 
$(LD_OUT)blib/lib/libcore_prederef$(SO).0.0.6 core_ops_prederef$(O)
  +
  +blib/lib/libcore_prederef$(SO).0.0 : blib/lib/libcore_prederef$(SO).0.0.6
  +     $(RM_F) $@
  +     cd blib/lib; ln -s libcore_prederef$(SO).0.0.6 libcore_prederef$(SO).0.0
  +
  +blib/lib/libcore_prederef$(SO).0 : blib/lib/libcore_prederef$(SO).0.0
  +     $(RM_F) $@
  +     cd blib/lib; ln -s libcore_prederef$(SO).0.0 libcore_prederef$(SO).0
  +
  +blib/lib/libcore_prederef$(SO) : blib/lib/libcore_prederef$(SO).0
  +     $(RM_F) $@
  +     cd blib/lib; ln -s libcore_prederef$(SO).0 libcore_prederef$(SO)
  +
  +=cut
  +#------------------------------------------------------------------------------
  +
  +#$(TEST_PROG_SO) : test_main$(O) blib/lib/libparrot$(SO) lib/Parrot/OpLib/core.pm 
lib/Parrot/PMC.pm
  +#    $(LD) $(LD_OUT)$(TEST_PROG) test_main$(O) $(LDFLAGS) $(C_LIBS) -L blib/lib 
-lparrot
  +
  +#
  +# XXX libraries and library_paths are appended to the global settings.
  +#
  +
  +$TEST_PROG_SO = Link(
  +  input => [ Object(input=>'test_main'), ],
  +
  +  libraries => ['parrot'],
  +  library_paths => ['blib/lib'],
  +
  +  output => Executable(input=>'parrot'),
  +  dependsOn => [Object(input=>'test_main'),
  +                Shared_Object(input=>'blib/lib/libparrot'),
  +                'lib/Parrot/OpLib/core.pm',
  +                'lib/Parrot/PMC.pm'
  +               ],
  +);
  +
  +#
  +# Parrot Debugger
  +#
  +#PDB=pdb
  +
  +my $PDB = Executable(input=>'pdb');
  +
  +#------------------------------------------------------------------------------
  +=pod
  +
  +#pdb$(O) : $(GENERAL_H_FILES)
  +
  +$(PDB) : pdb$(O) $(O_DIRS) $(O_FILES)
  +     $(LD) -o $(PDB) pdb$(O) $(O_FILES) $(C_LIBS) $(LDFLAGS)
  +
  +#
  +# Parrot Disassembler
  +#
  +DIS=disassemble
  +
  +disassemble$(O) : $(GENERAL_H_FILES)
  +
  +$(DIS) : disassemble$(O) $(O_DIRS) $(O_FILES)
  +     $(LD) -o $(DIS) disassemble$(O) $(O_FILES) $(C_LIBS) $(LDFLAGS)
  +
  +#
  +# Parrot Dump
  +#
  +
  +#$(PDUMP) : pdump$(O) packfile$(O)
  +#    $(LD) -o $(PDUMP) pdump$(O) packfile$(O) string$(O) chartype$(O) memory$(O) 
$(C_LIBS) $(LDFLAGS)
  +
  +
  +###############################################################################
  +#
  +# Other Dependencies and Build Rules:
  +#
  +###############################################################################
  +
  +test_main$(O) : test_main.c $(GENERAL_H_FILES)
  +
  +#lib/Parrot/OpLib/core.pm : $(OPS_FILES) ops2pm.pl lib/Parrot/OpsFile.pm 
lib/Parrot/Op.pm
  +#    $(PERL) ops2pm.pl $(OPS_FILES)
  +
  +my $lib_Parrot_OpLib_core_pm = Perl( # XXX
  +  dependsOn => [ @OPS_FILES, 'ops2pm.pl', 'lib/Parrot/OpsFile.pm',
  +                 'lib/Parrot/Op.pm' ],
  +  commandLine => "ops2pm.pl @OPS_FILES",
  +);
  +
  +#lib/Parrot/PMC.pm : include/parrot/pmc.h pmc_pm.pl
  +#    $(PERL) pmc_pm.pl 
  +
  +my #lib_Parrot_PMC_pm = Perl( # XXX
  +  dependsOn => [ 'include/parrot/pmc.h', 'pmc_pm.pl' ],
  +  commandLine => "pmc_pm.pl",
  +);
  +
  +
  +###############################################################################
  +#
  +# Examples (Assembly):
  +#
  +###############################################################################
  +
  +examples/assembly/mops.pbc : examples/assembly/mops.pasm assemble.pl
  +     cd examples && cd assembly && $(MAKE) mops.pbc PERL=$(PERL) && cd .. && cd ..
  +
  +#examples/assembly/mops.c : examples/assembly/mops.pbc pbc2c.pl
  +#    $(PERL) pbc2c.pl examples/assembly/mops.pbc > examples/assembly/mops.c
  +
  +my $examples_assembly_mops_c = Perl(
  +  dependsOn => [ 'examples/assembly/mops.pbc', 'pbc2c.pl' ],
  +  commandLine =>
  +    "pbc2c.pl examples/assembly/mops.pbc > examples/assembly/mops.c",
  +);
  +
  +#examples/assembly/mops : examples/assembly/mops$(O) $(O_DIRS) $(O_FILES)
  +#    $(LD) $(LDFLAGS) -o examples/assembly/mops examples/assembly/mops$(O) 
$(O_FILES) $(C_LIBS)
  +
  +my $examples_assembly_mops = Link( # XXX
  +  input => [ Object('examples/assembly/mops'), @O_FILES, @C_LIBS ],
  +  output => Executable('examples/assembly/mops'),
  +  dependsOn => [ Object('examples/assembly/mops'), @O_DIRS, @O_FILES ],
  +);
  +
  +examples/assembly/life.pbc : examples/assembly/life.pasm assemble.pl
  +     cd examples && cd assembly && $(MAKE) life.pbc PERL=$(PERL) && cd .. && cd ..
  +
  +#examples/assembly/life.c : examples/assembly/life.pbc pbc2c.pl
  +#    $(PERL) pbc2c.pl examples/assembly/life.pbc > examples/assembly/life.c
  +
  +my $examples_assembly_life_c = Perl( # XXX
  +  dependsOn => [ 'examples/assembly/life.pbc', 'pbc2c.pl' ],
  +  commandLine =>
  +    "pbc2c.pl examples/assembly/life.pbc > examples/assembly/life.c",
  +);
  +
  +#examples/assembly/life : examples/assembly/life$(O) $(O_DIRS) $(O_FILES)
  +#    $(LD) $(LDFLAGS) -o examples/assembly/life examples/assembly/life$(O) 
$(O_FILES) $(C_LIBS)
  +
  +my $examples_assembly_life = Link( # XXX
  +  input => [ Object('examples/assembly/life'), @O_FILES, @C_LIBS ],
  +  output => Executable('examples/assembly/life'),
  +  dependsOn => [ Object('examples/assembly/life'), @O_DIRS, @O_FILES ],
  +);
  +
  +###############################################################################
  +#
  +# Examples (MOPS) - Comparative:
  +#
  +###############################################################################
  +
  +examples/mops/mops$(O) : examples/mops/mops.c
  +
  +#examples/mops/mops : examples/mops/mops$(O) platform$(O)
  +#    $(LD) $(LDFLAGS) -o examples/mops/mops examples/mops/mops$(O) platform$(O) 
$(C_LIBS)
  +
  +my $examples_mops_mops = Link( # XXX ?
  +  input => [ Object('examples/mops/mops'), Object('platform'), @C_LIBS ],
  +  output => Executable('examples/mops/mops'),
  +  dependsOn => [ Object('examples/mops/mops'), Object('platform') ],
  +);
  +
  +
  +###############################################################################
  +#
  +# Dependencies:
  +#
  +###############################################################################
  +
  +global_setup$(O) : $(GENERAL_H_FILES)
  +
  +pmc$(O) : $(GENERAL_H_FILES)
  +
  +hash$(O) : $(GENERAL_H_FILES)
  +
  +jit$(O) : $(GENERAL_H_FILES)
  +
  +jit_cpu$(O): $(GENERAL_H_FILES) $(INC)/jit_emit.h
  +
  +key$(O) : $(GENERAL_H_FILES)
  +
  +resources$(O) : $(GENERAL_H_FILES)
  +
  +platform$(O) : $(GENERAL_H_FILES)
  +
  +debug$(O) : $(GENERAL_H_FILES)
  +
  +string$(O) : $(GENERAL_H_FILES)
  +
  +chartype$(O) : $(GENERAL_H_FILES)
  +
  +encoding$(O) : $(GENERAL_H_FILES)
  +
  +chartype/usascii$(O) : $(GENERAL_H_FILES)
  +
  +chartype/unicode$(O) : $(GENERAL_H_FILES)
  +
  +exceptions$(O) : $(GENERAL_H_FILES)
  +
  +encoding/singlebyte$(O) : $(GENERAL_H_FILES)
  +
  +encoding/utf8$(O) : $(GENERAL_H_FILES)
  +
  +encoding/utf16$(O) : $(GENERAL_H_FILES)
  +
  +encoding/utf32$(O) : $(GENERAL_H_FILES)
  +
  +interpreter$(O) : interpreter.c $(GENERAL_H_FILES)
  +
  +io/io$(O) : $(GENERAL_H_FILES)
  +
  +io/io_buf$(O) : $(GENERAL_H_FILES)
  +
  +io/io_unix$(O) : $(GENERAL_H_FILES)
  +
  +io/io_win32$(O) : $(GENERAL_H_FILES)
  +
  +io/io_stdio$(O) : $(GENERAL_H_FILES)
  +
  +memory$(O) : $(GENERAL_H_FILES)
  +
  +packfile$(O) : $(GENERAL_H_FILES)
  +
  +packout$(O) : $(GENERAL_H_FILES)
  +
  +parrot$(O) : $(GENERAL_H_FILES)
  +
  +register$(O) : $(GENERAL_H_FILES)
  +
  +rx$(O) : $(GENERAL_H_FILES)
  +
  +rxstacks$(O) : $(GENERAL_H_FILES)
  +
  +stacks$(O) : $(GENERAL_H_FILES)
  +
  +embed$(O) : $(GENERAL_H_FILES)
  +
  +core_ops$(O) : $(GENERAL_H_FILES) core_ops.c
  +
  +core_ops.c $(INC)/oplib/core_ops.h : $(OPS_FILES) ops2c.pl lib/Parrot/OpsFile.pm 
lib/Parrot/Op.pm
  +     $(PERL) ops2c.pl C $(OPS_FILES)
  +
  +core_ops_prederef$(O) : $(GENERAL_H_FILES) core_ops_prederef.c
  +
  +#core_ops_prederef.c $(INC)/oplib/core_ops_prederef.h : $(OPS_FILES) ops2c.pl 
lib/Parrot/OpsFile.pm lib/Parrot/Op.pm
  +#    $(PERL) ops2c.pl CPrederef $(OPS_FILES)
  +
  +my $core__ops__prederef_c = Perl( # XXX
  +  dependsOn => [ @OPS_FILES, 'ops2c.pl', 'lib/Parrot/OpsFile.pm',
  +                 'lib/Parrot/Op.pm' ],
  +  commandLine => "ops2c.pl CPrederef @OPS_FILES",
  +);
  +
  +core_ops_cg$(O): $(GENERAL_H_FILES) core_ops_cg.c
  +
  +#core_ops_cg.c $(INC)/oplib/core_ops_cg.h: $(OPS_FILES) ops2cgc.pl 
lib/Parrot/OpsFile.pm lib/Parrot/Op.pm
  +#    $(PERL) ops2cgc.pl CGoto $(OPS_FILES)
  +
  +my $core__ops__cg_c = Perl( # XXX
  +  dependsOn => [ @OPS_FILES, 'ops2cgc.pl', 'lib/Parrot/OpsFile.pm',
  +                 'lib/Parrot/Op.pm' ],
  +  commandLine => "ops2cgc.pl CGoto @OPS_FILES",
  +);
  +
  +
  +warnings$(O) : $(H_FILES)
  +
  +misc$(O) : $(H_FILES)
  +
  +$(STICKY_FILES) : Configure.pl
  +     $(PERL) Configure.pl
  +
  +$(INC)/vtable.h : vtable.tbl vtable_h.pl
  +     $(PERL) vtable_h.pl
  +
  +$(INC)/jit_emit.h: jit/i386/jit_emit.h
  +     $(PERL) -MFile::Copy=cp -e 'cp q|jit/i386/jit_emit.h|, q|$(INC)/jit_emit.h|'
  +jit_cpu.c: lib/Parrot/OpLib/core.pm $(INC)/jit_emit.h jit/i386/core.jit
  +     $(PERL) jit2h.pl i386 jit_cpu.c
  +
  +docs : docs/.dummy
  +
  +#newasm : $(TEST_PROG) lib/Parrot/.dummy
  +
  +lib/Parrot/.dummy :
  +     cd lib && cd Parrot && $(PERL) Makefile.PL && $(MAKE) && cd .. && cd ..
  +
  +docs/.dummy :
  +     cd docs && $(MAKE) && cd ..
  +
  +classes : classes/.dummy
  +
  +classes/.dummy :
  +     cd classes && $(MAKE) && cd ..
  +
  +languages : languages.dummy
  +
  +languages.dummy :
  +     cd languages && $(MAKE) && cd ..
  +
  +
  +###############################################################################
  +#
  +# Testing Targets:
  +#
  +###############################################################################
  +
  +test : $(TEST_PROG) assemble.pl test_dummy
  +
  +test_dummy :
  +     $(PERL) t/harness $(TEST_PROG_ARGS)
  +
  +testp : $(TEST_PROG) assemble.pl blib/lib/libcore_prederef$(SO) 
blib/lib/libparrot$(SO) $(TEST_PROG_SO) test_dummy_p
  +
  +test_dummy_p :
  +     $(PERL) t/harness $(TEST_PROG_ARGS) -P
  +
  +testj : $(TEST_PROG) assemble.pl test_dummy_j
  +
  +test_dummy_j :
  +     $(PERL) t/harness $(TEST_PROG_ARGS) -j
  +
  +quicktest : $(TEST_PROG) assemble.pl quicktest_dummy
  +
  +quicktest_dummy :
  +     $(PERL) t/harness $(TEST_PROG_ARGS) quick
  +
  +mopstest : $(TEST_PROG) examples/assembly/mops.pbc
  +     $(TEST_PROG) $(TEST_PROG_ARGS) examples/assembly/mops.pbc
  +
  +lifetest : $(TEST_PROG) examples/assembly/life.pbc
  +     $(TEST_PROG) $(TEST_PROG_ARGS) examples/assembly/life.pbc
  +
  +
  +###############################################################################
  +#
  +# Cleaning Targets:
  +#
  +###############################################################################
  +
  +clean : testclean
  +     $(RM_F) $(INC)/oplib/core_ops_cg.h core_ops_cg.c 
  +     $(RM_F) $(O_FILES)
  +     $(RM_F) *.s
  +     $(RM_F) $(FLUID_FILES)
  +     $(RM_F) $(TEST_PROG) test_main$(O) $(PDUMP) pdump$(O)
  +     $(RM_F) examples/assembly/mops examples/assembly/mops.c
  +     $(RM_F) examples/assembly/mops$(O) examples/assembly/mops.pbc
  +     $(RM_F) examples/mops/mops$(O) examples/mops/mops
  +     $(RM_RF) blib
  +     $(RM_F) *~
  +     cd docs && $(MAKE) clean && cd ..
  +     cd classes && $(MAKE) clean && cd ..
  +     cd languages && $(MAKE) clean && cd ..
  +
  +testclean :
  +     $(RM_F) t/op/*.pasm t/op/*.pbc t/op/*.out
  +
  +realclean : clean
  +     $(RM_F) $(STICKY_FILES)
  +
  +distclean :
  +     $(PERL) "-MExtUtils::Manifest=filecheck" -le 'sub 
ExtUtils::Manifest::_maniskip{sub{0}};$$ExtUtils::Manifest::Quiet=1;unlink $$_ for 
filecheck()'
  +
  +cvsclean :
  +     $(PERL) "-MExtUtils::Manifest=filecheck" -le 'sub 
ExtUtils::Manifest::_maniskip{sub{0}};$$ExtUtils::Manifest::Quiet=1; do { unlink $$_ 
unless $$_ =~ m!(?:CVS/|\.cvs)! } for filecheck()'
  +
  +reconfig :
  +     $(MAKE) clean; $(PERL) Configure.pl --reconfig
  +
  +manitest :
  +     $(PERL) "-MExtUtils::Manifest=fullcheck" -e fullcheck
  +
  +###############################################################################
  +#
  +# CVS Targets:
  +#
  +###############################################################################
  +
  +update :
  +     cvs -q update -dP
  +
  +status :
  +     cvs -n -q upd -dP
  +
  +lint : parrot
  +     $(LINT) -I./include  "-Iclasses" $(LINTFLAGS) `echo $(O_FILES) | sed 
's/\.o/\.c/g'`
  +     $(LINT) -I./include $(LINTFLAGS) test_main.c
  +
  +lint2 : parrot
  +     $(LINT) -I./include  "-Iclasses" $(LINTFLAGS2) `echo $(O_FILES) | sed 
's/\.o/\.c/g'`
  +     $(LINT) -I./include $(LINTFLAGS2) test_main.c   
  +
  +=cut
  +#------------------------------------------------------------------------------
  +
  +#Make::Link_Obj::command("cc"); # Default
  +Make::Link_Obj::flags("-lm");
   
   =head2 NAME
   
  @@ -111,8 +973,6 @@
     dependsOn => [$foo_o, $bar_o],     #   cc -o foo foo.o bar.o
   );
   
  -my $depends = {};
  -
   =item Target
   
   What the user invokes when typing 'make foo'. C<foo> is a sample target, and
  @@ -149,6 +1009,8 @@
     my ($target) = @_;
     my $actions = [];
     $depends->{$target}->satisfied($actions);
  +
  +#  print Store($depends);
   
     for(@$actions) {
   print "running $_->{action}\n";
  
  
  
  1.2       +16 -1     parrot/lib/Make/CC_Obj.pm
  
  Index: CC_Obj.pm
  ===================================================================
  RCS file: /cvs/public/parrot/lib/Make/CC_Obj.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- CC_Obj.pm 6 Jul 2002 06:12:36 -0000       1.1
  +++ CC_Obj.pm 7 Jul 2002 06:09:16 -0000       1.2
  @@ -6,6 +6,18 @@
   @ISA=("Make::Dependency",'Exporter');
   @EXPORT_OK = qw(CC);
   
  +my $program = $^O=~/Win/ ? 'cl' : 'cc';
  +sub program { $program = shift }
  +
  +my @flags = ();
  +sub flags { @flags = @_ }
  +
  +my @libraries = ();
  +sub libraries { @libraries = @_ }
  +
  +my @library_paths = ();
  +sub library_paths { @library_paths = @_ }
  +
   sub CC {
     my $class = 'Make::CC_Obj';
     my %args = @_;
  @@ -33,8 +45,11 @@
   
   sub build {
     my ($self) = @_;
  +  my $flags = $self->_flags_string();
  +  my $libraries = $self->_library_string();
  +  my $library_paths = $self->_library_path_string();
   
  -  { action => "cc -c $self->{input}",
  +  { action => "$program $flags $library_paths $libraries -c $self->{input}",
     };
   }
   
  
  
  
  1.2       +32 -1     parrot/lib/Make/Dependency.pm
  
  Index: Dependency.pm
  ===================================================================
  RCS file: /cvs/public/parrot/lib/Make/Dependency.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- Dependency.pm     6 Jul 2002 06:12:36 -0000       1.1
  +++ Dependency.pm     7 Jul 2002 06:09:16 -0000       1.2
  @@ -2,7 +2,7 @@
   
   use vars qw(@ISA @EXPORT_OK);
   @ISA = qw(Exporter);
  -@EXPORT_OK = qw(Object Executable);
  +@EXPORT_OK = qw(Object Shared_Object Executable);
   
   sub DEBUG () { 1 }
   
  @@ -18,6 +18,19 @@
     $args{input};
   }
   
  +sub Shared_Object {
  +  my %args = @_;
  +  unless(exists $args{input}) {
  +    my $target =
  +      "*** make.pl: Shared_Object() called from line ".(caller(0))[2];
  +    unless(exists $args{input}) {
  +      print STDERR "$target had no input specified.\n";
  +    }
  +  }
  +  $args{input} .= $^O =~ /Win/ ? '.dll' : '.so';
  +  $args{input};
  +}
  +
   sub Executable {
     my %args = @_;
     unless(exists $args{input}) {
  @@ -28,6 +41,24 @@
     }
     $args{input} .= $^O =~ /Win/ ? '.exe' : '';
     $args{input};
  +}
  +
  +sub _library_path_string {
  +  my $self = shift;
  +  my $lib_path_string;
  +  $lib_path_string .= join ' ', @{$self->{library_paths}};
  +  $lib_path_string .= join ' ', @{$self->{local_library_paths}};
  +
  +  $lib_path_string;
  +}
  +
  +sub _library_string {
  +  my $self = shift;
  +  my $lib_string;
  +  $lib_string .= join ' ', @{$self->{libraries}};
  +  $lib_string .= join ' ', @{$self->{local_libraries}};
  +
  +  $lib_string;
   }
   
   sub satisfied {
  
  
  
  1.3       +15 -10    parrot/lib/Make/Link_Obj.pm
  
  Index: Link_Obj.pm
  ===================================================================
  RCS file: /cvs/public/parrot/lib/Make/Link_Obj.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -w -r1.2 -r1.3
  --- Link_Obj.pm       7 Jul 2002 04:00:40 -0000       1.2
  +++ Link_Obj.pm       7 Jul 2002 06:09:16 -0000       1.3
  @@ -5,16 +5,14 @@
   @ISA=qw(Make::Dependency);
   @EXPORT_OK = qw(Link);
   
  -my $flags = undef;
  -my $command = "cc"; # XXX Platform-specific, don't know the other options.
  +my $program = "cc";
  +sub program { $program = shift; }
   
  -sub flags {
  -  $flags = shift;
  -}
  +my @flags = ();
  +sub flags { @flags = @_ }
   
  -sub command {
  -  $command  shift;
  -}
  +my @libraries = ();
  +sub libraries { @libraries = @_ }
   
   sub Link {
     my $class = 'Make::Link_Obj';
  @@ -35,6 +33,10 @@
     $args{input} = [$args{input}]
       unless ref($args{input}) eq 'ARRAY';
     my $self = bless {
  +    local_flags => $args{flags} || undef,
  +    local_libraries => $args{libraries} || undef,
  +    local_library_paths => $args{library_paths} || undef,
  +
       dependsOn => $args{dependsOn},
       input => $args{input},
       output => $args{output},
  @@ -45,9 +47,12 @@
   
   sub build {
     my ($self) = @_;
  -  my $ldflags = defined $flags ? $flags : '';
  +  my $flags = $self->_flags_string();
  +  my $libraries = $self->_library_string();
  +  my $library_paths = $self->_library_path_string();
   
  -  { action => "$link_command $ldflags -o $self->{output} ".join ' 
',@{$self->{input}},
  +  { action =>
  +      "$program $flags $library_paths $libraries -o $self->{output} ".join ' 
',@{$self->{input}},
     };
   }
   
  
  
  
  1.2       +7 -3      parrot/lib/Make/Target_Obj.pm
  
  Index: Target_Obj.pm
  ===================================================================
  RCS file: /cvs/public/parrot/lib/Make/Target_Obj.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- Target_Obj.pm     6 Jul 2002 06:12:36 -0000       1.1
  +++ Target_Obj.pm     7 Jul 2002 06:09:16 -0000       1.2
  @@ -22,6 +22,7 @@
     $args{dependsOn} = [$args{dependsOn}]
       unless ref($args{dependsOn}) eq 'ARRAY';
     my $self = bless {
  +    action => $args{action} || undef,
       dependsOn => $args{dependsOn},
       input => $args{input},
       output => '', # No real 'output' here, I think.
  @@ -32,10 +33,13 @@
   
   sub build {
     my ($self) = @_;
  +  my $return_val = undef;
   
  -#  { action => "cc -o $self->{output} $self->{input}",
  -#  };
  -  undef;
  +  if(defined $self->{action}) {
  +    $return_val = $self->{action}
  +  }
  +
  +  $return_val;
   }
   
   1;
  
  
  
  1.1                  parrot/lib/Make/Archive_Obj.pm
  
  Index: Archive_Obj.pm
  ===================================================================
  package Make::Archive_Obj;
  use Exporter;
  
  use vars qw(@ISA @EXPORT_OK);
  @ISA=qw(Make::Dependency);
  @EXPORT_OK = qw(Archive);
  
  my $program = "ar";
  sub program { $program = shift; }
  
  my @flags = ();
  sub flags { @flags = @_ }
  
  my @libraries = ();
  sub libraries { @libraries = @_ }
  
  my @library_paths = ();
  sub library_paths { @library_paths = @_ }
  
  sub Archive {
    my $class = 'Make::Archive_Obj';
    my %args = @_;
    unless(exists $args{input} and
           exists $args{dependsOn}) {
      my $target = "*** make.pl: Archive() called from line ".(caller(0))[2];
      unless(exists $args{input}) {
        print STDERR "$target had no input specified.\n";
      }
      unless(exists $args{dependsOn}) {
        print STDERR "$target had no dependsOn specified.\n";
      }
    }
  
    $args{dependsOn} = [$args{dependsOn}]
      unless ref($args{dependsOn}) eq 'ARRAY';
    $args{input} = [$args{input}]
      unless ref($args{input}) eq 'ARRAY';
    my $self = bless {
      local_flags => $args{flags} || undef,
      local_libraries => $args{libraries} || undef,
      local_library_paths => $args{library_paths} || undef,
  
      dependsOn => $args{dependsOn},
      input => $args{input},
      output => $args{output},
      type => 'Archive',
    }, $class;
    $self;
  }
  
  sub build {
    my ($self) = @_;
    my $return_val = undef;
    my $flags = $self->_flags_string();
  #  my $libraries = $self->_library_string();
  #  my $library_paths = $self->_library_path_string();
  
    # XXX Only run if under UNIX
  
    unless($^O =~ /Win/) {
      $return_val = { action =>
        "$program crs $flags -o $self->{output} ".join ' ',@{$self->{input}},
      };
    }
    return $return_val;
  }
  
  1;
  
  
  
  1.1                  parrot/lib/Make/Link_Shared_Obj.pm
  
  Index: Link_Shared_Obj.pm
  ===================================================================
  package Make::Link_Shared_Obj;
  use Exporter;
  
  use vars qw(@ISA @EXPORT_OK);
  @ISA=qw(Make::Dependency);
  @EXPORT_OK = qw(Link_Shared);
  
  my $program = "cc";
  sub program { $program = shift }
  
  my @flags = ();
  sub flags { @flags = @_ }
  
  my @libraries = ();
  sub libraries { @libraries = @_ }
  
  my @library_paths = ();
  sub library_paths { @library_paths = @_ }
  
  sub Link_Shared {
    my $class = 'Make::Link_Shared_Obj';
    my %args = @_;
    unless(exists $args{input} and
           exists $args{dependsOn}) {
      my $target = "*** make.pl: Link_Shared() called from line ".(caller(0))[2];
      unless(exists $args{input}) {
        print STDERR "$target had no input specified.\n";
      }
      unless(exists $args{dependsOn}) {
        print STDERR "$target had no dependsOn specified.\n";
      }
    }
  
    $args{dependsOn} = [$args{dependsOn}]
      unless ref($args{dependsOn}) eq 'ARRAY';
    $args{input} = [$args{input}]
      unless ref($args{input}) eq 'ARRAY';
    my $self = bless {
      dependsOn => $args{dependsOn},
      input => $args{input},
      output => $args{output},
      type => 'Link_Shared',
    }, $class;
    $self;
  }
  
  sub build {
    my ($self) = @_;
    my $flags = $self->_flags_string();
    my $libraries = $self->_library_string();
    my $library_paths = $self->_library_path_string();
  
    { action =>
        "$program @flags -shared -o $self->{output} " .
          join ' ',@{$self->{input}},
    };
  }
  
  1;
  
  
  
  1.1                  parrot/lib/Make/Lint_Obj.pm
  
  Index: Lint_Obj.pm
  ===================================================================
  package Make::Lint_Obj;
  use Make::Dependency;
  use Exporter;
  
  use vars qw(@ISA @EXPORT_OK);
  @ISA=("Make::Dependency",'Exporter');
  @EXPORT_OK = qw(Lint);
  
  my $program = 'lclint';
  sub program { $program = shift }
  
  my @flags = ();
  sub flags { @flags = @_ }
  
  sub Lint {
    my $class = 'Make::Lint_Obj';
    my %args = @_;
    unless(exists $args{input} and
           exists $args{dependsOn}) {
      my $target = "*** make.pl: Lint() called from line ".(caller(0))[2];
      unless(exists $args{input}) {
        print STDERR "$target had no input specified.\n";
      }
      unless(exists $args{dependsOn}) {
        print STDERR "$target had no dependsOn specified.\n";
      }
    }
  
    $args{dependsOn} = [$args{dependsOn}]
      unless ref($args{dependsOn}) eq 'ARRAY';
    my $self = bless {
      dependsOn => $args{dependsOn},
      input => $args{input},
      output => $args{output},
      commandLine => $args{commandLine} || undef,
      type => 'Lint',
    }, $class;
    $self;
  }
  
  sub build {
    my ($self) = @_;
    my $return_val;
    my $flags = $self->_flags_string();
    my $libraries = $self->_library_string();
    my $library_paths = $self->_library_path_string();
  
    if(defined $self->{commandLine}) {
      $return_val = {
        action => "$program $flags $self->{commandLine}",
      };
    }
    else {
      $return_val = {
        action => "$program $flags $self->{input}", # XXX May not work well.
      };
    }
    $return_val;
  }
  
  1;
  
  
  


Reply via email to