From b44cb1ab1080151143efad6bdd1fb6d214e83126 Mon Sep 17 00:00:00 2001 From: Adam Russell Date: Mon, 13 May 2019 23:22:23 -0400 Subject: initial commit of solutions for challenge 008 --- challenge-008/adam-russell/perl5/ch-1.pl | 31 ++++++++++++++++++++++ challenge-008/adam-russell/perl5/ch-2.pl | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 challenge-008/adam-russell/perl5/ch-1.pl create mode 100644 challenge-008/adam-russell/perl5/ch-2.pl diff --git a/challenge-008/adam-russell/perl5/ch-1.pl b/challenge-008/adam-russell/perl5/ch-1.pl new file mode 100644 index 0000000000..cc858bfb94 --- /dev/null +++ b/challenge-008/adam-russell/perl5/ch-1.pl @@ -0,0 +1,31 @@ +use strict; +use warnings; +## +# Write a script that computes the first five perfect numbers. +# A perfect number is an integer that is the sum of its positive +# proper divisors (all divisors except itself). +## +use constant PERFECT_COUNT => 5; + +sub factor{ + my($n) = @_; + my @factors = (1); + foreach my $j (2..sqrt($n)){ + push @factors, $j if $n % $j == 0; + push @factors, ($n / $j) if $n % $j == 0 && $j ** 2 != $n; + } + return @factors; +} + +my $i = 1; +my $count = 0; +do{ + my @factors = factor($i); + my $sum = unpack("%32I*", pack("I*", @factors)); + if($sum == $i){ + print "$i "; + $count++; + } + $i++; +}while($count < PERFECT_COUNT); +print "\n"; diff --git a/challenge-008/adam-russell/perl5/ch-2.pl b/challenge-008/adam-russell/perl5/ch-2.pl new file mode 100644 index 0000000000..21bcab4519 --- /dev/null +++ b/challenge-008/adam-russell/perl5/ch-2.pl @@ -0,0 +1,44 @@ +use strict; +use warnings; +## +# Write a function, "center", whose argument is a list of strings, which +# will be lines of text. The function should insert spaces at the beginning +# of the lines of text so that if they were printed, the text would be +# centered, and return the modified lines. +## +use Data::Dump q/pp/; + +my @words; +my @padded_words; +my %line_length; +my $max_length = -1; +my $center; +do{ + local $/; + @words = split(/\n/, ); + my $i = 0; + foreach my $line (@words){ + $line_length{$i} = do{ + $line =~ tr/ [a-z][A-Z]//; + }; + $max_length = $line_length{$i} if $line_length{$i} > $max_length; + $i++; + } +}; +$center = int($max_length / 2); +for(my $i = 0; $i < @words; $i++){ + my $middle = int($line_length{$i} / 2); + my $padding = $center - $middle; + $padded_words[$i] = " " x $padding . $words[$i]; +} + + +foreach my $w (@padded_words){ + print "$w\n"; +} + +__DATA__ +This +is +a test of the +center function -- cgit From 9ca988dc2fc4a7846810d83ec10f3c7dd6c80f42 Mon Sep 17 00:00:00 2001 From: Adam Russell Date: Mon, 13 May 2019 23:50:30 -0400 Subject: restructured code in ch-2.pl --- challenge-008/adam-russell/perl5/ch-2.pl | 43 ++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/challenge-008/adam-russell/perl5/ch-2.pl b/challenge-008/adam-russell/perl5/ch-2.pl index 21bcab4519..97db2d1bcb 100644 --- a/challenge-008/adam-russell/perl5/ch-2.pl +++ b/challenge-008/adam-russell/perl5/ch-2.pl @@ -6,16 +6,12 @@ use warnings; # of the lines of text so that if they were printed, the text would be # centered, and return the modified lines. ## -use Data::Dump q/pp/; - -my @words; -my @padded_words; -my %line_length; -my $max_length = -1; -my $center; -do{ - local $/; - @words = split(/\n/, ); +sub center{ + my @words = @_; + my @padded_words; + my %line_length; + my $max_length = -1; + my $center; my $i = 0; foreach my $line (@words){ $line_length{$i} = do{ @@ -24,16 +20,25 @@ do{ $max_length = $line_length{$i} if $line_length{$i} > $max_length; $i++; } -}; -$center = int($max_length / 2); -for(my $i = 0; $i < @words; $i++){ - my $middle = int($line_length{$i} / 2); - my $padding = $center - $middle; - $padded_words[$i] = " " x $padding . $words[$i]; -} - + $center = int($max_length / 2); + for(my $i = 0; $i < @words; $i++){ + my $middle = int($line_length{$i} / 2); + my $padding = $center - $middle; + $padded_words[$i] = " " x $padding . $words[$i]; + } + return @padded_words; +} -foreach my $w (@padded_words){ +## +# Main +## +my @words; +do{ + local $/; + @words = split(/\n/, ); +}; +my @centered = center(@words); +foreach my $w (@centered){ print "$w\n"; } -- cgit From fa4970f9d4196de9e53c2e0f79b8d8ca99ef4c01 Mon Sep 17 00:00:00 2001 From: Adam Russell Date: Tue, 14 May 2019 15:19:44 -0400 Subject: added blog link --- challenge-008/adam-russell/blog.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 challenge-008/adam-russell/blog.txt diff --git a/challenge-008/adam-russell/blog.txt b/challenge-008/adam-russell/blog.txt new file mode 100644 index 0000000000..851cfcef8b --- /dev/null +++ b/challenge-008/adam-russell/blog.txt @@ -0,0 +1 @@ +https://adamcrussell.livejournal.com/2607.html -- cgit From 70d24d29332ad9e27edd0c1816fd9c67bef6a095 Mon Sep 17 00:00:00 2001 From: Adam Russell Date: Tue, 14 May 2019 23:28:20 -0400 Subject: updated ch-2.pl --- challenge-008/adam-russell/perl5/ch-1.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenge-008/adam-russell/perl5/ch-1.pl b/challenge-008/adam-russell/perl5/ch-1.pl index cc858bfb94..31c954ab9e 100644 --- a/challenge-008/adam-russell/perl5/ch-1.pl +++ b/challenge-008/adam-russell/perl5/ch-1.pl @@ -17,7 +17,7 @@ sub factor{ return @factors; } -my $i = 1; +my $i = 2; my $count = 0; do{ my @factors = factor($i); -- cgit From 03503a2734d88c446e045bb466bfc7c7ff2778a0 Mon Sep 17 00:00:00 2001 From: Adam Russell Date: Thu, 16 May 2019 16:14:54 -0400 Subject: added code for the SWIG experiment --- challenge-008/adam-russell/perl5/ch-1x.pl | 21 + challenge-008/adam-russell/perl5/ext/MYMETA.json | 37 + challenge-008/adam-russell/perl5/ext/MYMETA.yml | 21 + challenge-008/adam-russell/perl5/ext/Makefile | 1058 ++++++++++ challenge-008/adam-russell/perl5/ext/Makefile.pl | 6 + challenge-008/adam-russell/perl5/ext/Perfect.bs | 0 .../adam-russell/perl5/ext/blib/arch/.exists | 0 .../perl5/ext/blib/arch/auto/Perfect/.exists | 0 .../ext/blib/arch/auto/Perfect/Perfect.bundle | Bin 0 -> 19980 bytes .../adam-russell/perl5/ext/blib/bin/.exists | 0 .../adam-russell/perl5/ext/blib/lib/.exists | 0 .../adam-russell/perl5/ext/blib/lib/Makefile.pl | 6 + .../perl5/ext/blib/lib/auto/Perfect/.exists | 0 .../adam-russell/perl5/ext/blib/lib/perfect.pm | 95 + .../adam-russell/perl5/ext/blib/lib/temp.pl | 14 + .../adam-russell/perl5/ext/blib/man1/.exists | 0 .../adam-russell/perl5/ext/blib/man3/.exists | 0 .../adam-russell/perl5/ext/blib/script/.exists | 0 challenge-008/adam-russell/perl5/ext/perfect.cxx | 25 + challenge-008/adam-russell/perl5/ext/perfect.h | 11 + challenge-008/adam-russell/perl5/ext/perfect.i | 7 + challenge-008/adam-russell/perl5/ext/perfect.o | Bin 0 -> 1232 bytes challenge-008/adam-russell/perl5/ext/perfect.pm | 95 + .../adam-russell/perl5/ext/perfect_wrap.cxx | 2178 ++++++++++++++++++++ .../adam-russell/perl5/ext/perfect_wrap.o | Bin 0 -> 13188 bytes challenge-008/adam-russell/perl5/ext/pm_to_blib | 0 26 files changed, 3574 insertions(+) create mode 100644 challenge-008/adam-russell/perl5/ch-1x.pl create mode 100644 challenge-008/adam-russell/perl5/ext/MYMETA.json create mode 100644 challenge-008/adam-russell/perl5/ext/MYMETA.yml create mode 100644 challenge-008/adam-russell/perl5/ext/Makefile create mode 100644 challenge-008/adam-russell/perl5/ext/Makefile.pl create mode 100644 challenge-008/adam-russell/perl5/ext/Perfect.bs create mode 100644 challenge-008/adam-russell/perl5/ext/blib/arch/.exists create mode 100644 challenge-008/adam-russell/perl5/ext/blib/arch/auto/Perfect/.exists create mode 100755 challenge-008/adam-russell/perl5/ext/blib/arch/auto/Perfect/Perfect.bundle create mode 100644 challenge-008/adam-russell/perl5/ext/blib/bin/.exists create mode 100644 challenge-008/adam-russell/perl5/ext/blib/lib/.exists create mode 100644 challenge-008/adam-russell/perl5/ext/blib/lib/Makefile.pl create mode 100644 challenge-008/adam-russell/perl5/ext/blib/lib/auto/Perfect/.exists create mode 100644 challenge-008/adam-russell/perl5/ext/blib/lib/perfect.pm create mode 100644 challenge-008/adam-russell/perl5/ext/blib/lib/temp.pl create mode 100644 challenge-008/adam-russell/perl5/ext/blib/man1/.exists create mode 100644 challenge-008/adam-russell/perl5/ext/blib/man3/.exists create mode 100644 challenge-008/adam-russell/perl5/ext/blib/script/.exists create mode 100644 challenge-008/adam-russell/perl5/ext/perfect.cxx create mode 100644 challenge-008/adam-russell/perl5/ext/perfect.h create mode 100644 challenge-008/adam-russell/perl5/ext/perfect.i create mode 100644 challenge-008/adam-russell/perl5/ext/perfect.o create mode 100644 challenge-008/adam-russell/perl5/ext/perfect.pm create mode 100644 challenge-008/adam-russell/perl5/ext/perfect_wrap.cxx create mode 100644 challenge-008/adam-russell/perl5/ext/perfect_wrap.o create mode 100644 challenge-008/adam-russell/perl5/ext/pm_to_blib diff --git a/challenge-008/adam-russell/perl5/ch-1x.pl b/challenge-008/adam-russell/perl5/ch-1x.pl new file mode 100644 index 0000000000..8bf6e76687 --- /dev/null +++ b/challenge-008/adam-russell/perl5/ch-1x.pl @@ -0,0 +1,21 @@ +use strict; +use warnings; +## +# Write a script that computes the first five perfect numbers. +# A perfect number is an integer that is the sum of its positive +# proper divisors (all divisors except itself). +## +use Perfect; +use constant PERFECT_COUNT => 5; + +my $i = 2; +my $count = 0; +my $p = new Perfect::Perfect(); +do{ + if($p->isPerfect($i)){ + print "$i "; + $count++; + } + $i++; +}while($count < PERFECT_COUNT); +print "\n"; diff --git a/challenge-008/adam-russell/perl5/ext/MYMETA.json b/challenge-008/adam-russell/perl5/ext/MYMETA.json new file mode 100644 index 0000000000..41819df740 --- /dev/null +++ b/challenge-008/adam-russell/perl5/ext/MYMETA.json @@ -0,0 +1,37 @@ +{ + "abstract" : "unknown", + "author" : [ + "unknown" + ], + "dynamic_config" : 0, + "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", + "license" : [ + "unknown" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : 2 + }, + "name" : "Perfect", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + } + }, + "release_status" : "stable", + "version" : "", + "x_serialization_backend" : "JSON::PP version 2.97001" +} diff --git a/challenge-008/adam-russell/perl5/ext/MYMETA.yml b/challenge-008/adam-russell/perl5/ext/MYMETA.yml new file mode 100644 index 0000000000..aa27a91c8f --- /dev/null +++ b/challenge-008/adam-russell/perl5/ext/MYMETA.yml @@ -0,0 +1,21 @@ +--- +abstract: unknown +author: + - unknown +build_requires: + ExtUtils::MakeMaker: '0' +configure_requires: + ExtUtils::MakeMaker: '0' +dynamic_config: 0 +generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' +license: unknown +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: '1.4' +name: Perfect +no_index: + directory: + - t + - inc +version: '' +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff --git a/challenge-008/adam-russell/perl5/ext/Makefile b/challenge-008/adam-russell/perl5/ext/Makefile new file mode 100644 index 0000000000..3a8291aab3 --- /dev/null +++ b/challenge-008/adam-russell/perl5/ext/Makefile @@ -0,0 +1,1058 @@ +# This Makefile is for the Perfect extension to perl. +# +# It was generated automatically by MakeMaker version +# 7.34 (Revision: 73400) from the contents of +# Makefile.PL. Don't edit this file, edit Makefile.PL instead. +# +# ANY CHANGES MADE HERE WILL BE LOST! +# +# MakeMaker ARGV: () +# + +# MakeMaker Parameters: + +# BUILD_REQUIRES => { } +# CONFIGURE_REQUIRES => { } +# NAME => q[Perfect] +# OBJECT => q[perfect.o perfect_wrap.o] +# PREREQ_PM => { } +# TEST_REQUIRES => { } + +# --- MakeMaker post_initialize section: + + +# --- MakeMaker const_config section: + +# These definitions are from config.sh (via /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/darwin-thread-multi-2level/Config.pm). +# They may have been overridden via Makefile.PL or on the command line. +AR = ar +CC = cc +CCCDLFLAGS = +CCDLFLAGS = +DLEXT = bundle +DLSRC = dl_dlopen.xs +EXE_EXT = +FULL_AR = /usr/bin/ar +LD = cc +LDDLFLAGS = -mmacosx-version-min=10.14 -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector-strong +LDFLAGS = -mmacosx-version-min=10.14 -fstack-protector-strong -L/usr/local/lib -L/opt/local/lib +LIBC = +LIB_EXT = .a +OBJ_EXT = .o +OSNAME = darwin +OSVERS = 18.2.0 +RANLIB = ranlib +SITELIBEXP = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0 +SITEARCHEXP = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0/darwin-thread-multi-2level +SO = dylib +VENDORARCHEXP = +VENDORLIBEXP = + + +# --- MakeMaker constants section: +AR_STATIC_ARGS = cr +DIRFILESEP = / +DFSEP = $(DIRFILESEP) +NAME = Perfect +NAME_SYM = Perfect +VERSION = +VERSION_MACRO = VERSION +VERSION_SYM = +DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" +XS_VERSION = +XS_VERSION_MACRO = XS_VERSION +XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" +INST_ARCHLIB = blib/arch +INST_SCRIPT = blib/script +INST_BIN = blib/bin +INST_LIB = blib/lib +INST_MAN1DIR = blib/man1 +INST_MAN3DIR = blib/man3 +MAN1EXT = 1 +MAN3EXT = 3 +INSTALLDIRS = site +DESTDIR = +PREFIX = $(SITEPREFIX) +PERLPREFIX = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0 +SITEPREFIX = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0 +VENDORPREFIX = +INSTALLPRIVLIB = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0 +DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) +INSTALLSITELIB = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0 +DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) +INSTALLVENDORLIB = +DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) +INSTALLARCHLIB = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/darwin-thread-multi-2level +DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) +INSTALLSITEARCH = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0/darwin-thread-multi-2level +DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) +INSTALLVENDORARCH = +DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) +INSTALLBIN = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/bin +DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) +INSTALLSITEBIN = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/bin +DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) +INSTALLVENDORBIN = +DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) +INSTALLSCRIPT = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/bin +DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) +INSTALLSITESCRIPT = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/bin +DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT) +INSTALLVENDORSCRIPT = +DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT) +INSTALLMAN1DIR = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/man/man1 +DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) +INSTALLSITEMAN1DIR = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/man/man1 +DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) +INSTALLVENDORMAN1DIR = +DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) +INSTALLMAN3DIR = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/man/man3 +DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) +INSTALLSITEMAN3DIR = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/man/man3 +DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) +INSTALLVENDORMAN3DIR = +DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) +PERL_LIB = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0 +PERL_ARCHLIB = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/darwin-thread-multi-2level +PERL_ARCHLIBDEP = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/darwin-thread-multi-2level +LIBPERL_A = libperl.a +FIRST_MAKEFILE = Makefile +MAKEFILE_OLD = Makefile.old +MAKE_APERL_FILE = Makefile.aperl +PERLMAINCC = $(CC) +PERL_INC = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/darwin-thread-multi-2level/CORE +PERL_INCDEP = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/darwin-thread-multi-2level/CORE +PERL = "/Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/bin/perl" +FULLPERL = "/Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/bin/perl" +ABSPERL = $(PERL) +PERLRUN = $(PERL) +FULLPERLRUN = $(FULLPERL) +ABSPERLRUN = $(ABSPERL) +PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" +FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" +ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" +PERL_CORE = 0 +PERM_DIR = 755 +PERM_RW = 644 +PERM_RWX = 755 + +MAKEMAKER = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/ExtUtils/MakeMaker.pm +MM_VERSION = 7.34 +MM_REVISION = 73400 + +# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). +# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) +# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) +# DLBASE = Basename part of dynamic library. May be just equal BASEEXT. +MAKE = make +FULLEXT = Perfect +BASEEXT = Perfect +PARENT_NAME = +DLBASE = $(BASEEXT) +VERSION_FROM = +OBJECT = perfect$(OBJ_EXT) perfect_wrap$(OBJ_EXT) +LDFROM = $(OBJECT) +LINKTYPE = dynamic +BOOTDEP = + +# Handy lists of source code files: +XS_FILES = +C_FILES = perfect.cxx \ + perfect_wrap.cxx +O_FILES = perfect.o \ + perfect_wrap.o +H_FILES = perfect.h +MAN1PODS = +MAN3PODS = + +# Where is the Config information that we are using/depend on +CONFIGDEP = $(PERL_ARCHLIBDEP)$(DFSEP)Config.pm $(PERL_INCDEP)$(DFSEP)config.h + +# Where to build things +INST_LIBDIR = $(INST_LIB) +INST_ARCHLIBDIR = $(INST_ARCHLIB) + +INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) +INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) + +INST_STATIC = $(INST_ARCHAUTODIR)/$(BASEEXT)$(LIB_EXT) +INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(DLBASE).$(DLEXT) +INST_BOOT = $(INST_ARCHAUTODIR)/$(BASEEXT).bs + +# Extra linker info +EXPORT_LIST = +PERL_ARCHIVE = +PERL_ARCHIVEDEP = +PERL_ARCHIVE_AFTER = + + +TO_INST_PM = Makefile.pl \ + perfect.pm \ + temp.pl + + +# --- MakeMaker platform_constants section: +MM_Unix_VERSION = 7.34 +PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc + + +# --- MakeMaker tool_autosplit section: +# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto +AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$$$ARGV[0], $$$$ARGV[1], 0, 1, 1)' -- + + + +# --- MakeMaker tool_xsubpp section: + +XSUBPPDIR = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/ExtUtils +XSUBPP = "$(XSUBPPDIR)$(DFSEP)xsubpp" +XSUBPPRUN = $(PERLRUN) $(XSUBPP) +XSPROTOARG = +XSUBPPDEPS = /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/ExtUtils/typemap /Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/ExtUtils$(DFSEP)xsubpp +XSUBPPARGS = -typemap '/Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/ExtUtils/typemap' +XSUBPP_EXTRA_ARGS = + + +# --- MakeMaker tools_other section: +SHELL = /bin/sh +CHMOD = chmod +CP = cp +MV = mv +NOOP = $(TRUE) +NOECHO = @ +RM_F = rm -f +RM_RF = rm -rf +TEST_F = test -f +TOUCH = touch +UMASK_NULL = umask 0 +DEV_NULL = > /dev/null 2>&1 +MKPATH = $(ABSPERLRUN) -MExtUtils::Command -e 'mkpath' -- +EQUALIZE_TIMESTAMP = $(ABSPERLRUN) -MExtUtils::Command -e 'eqtime' -- +FALSE = false +TRUE = true +ECHO = echo +ECHO_N = echo -n +UNINST = 0 +VERBINST = 0 +MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' -- +DOC_INSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'perllocal_install' -- +UNINSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'uninstall' -- +WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'warn_if_old_packlist' -- +MACROSTART = +MACROEND = +USEMAKEFILE = -f +FIXIN = $(ABSPERLRUN) -MExtUtils::MY -e 'MY->fixin(shift)' -- +CP_NONEMPTY = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'cp_nonempty' -- + + +# --- MakeMaker makemakerdflt section: +makemakerdflt : all + $(NOECHO) $(NOOP) + + +# --- MakeMaker dist section: +TAR = COPY_EXTENDED_ATTRIBUTES_DISABLE=1 COPYFILE_DISABLE=1 tar +TARFLAGS = cvf +ZIP = zip +ZIPFLAGS = -r +COMPRESS = gzip --best +SUFFIX = .gz +SHAR = shar +PREOP = $(NOECHO) $(NOOP) +POSTOP = $(NOECHO) $(NOOP) +TO_UNIX = $(NOECHO) $(NOOP) +CI = ci -u +RCS_LABEL = rcs -Nv$(VERSION_SYM): -q +DIST_CP = best +DIST_DEFAULT = tardist +DISTNAME = Perfect +DISTVNAME = Perfect- + + +# --- MakeMaker macro section: + + +# --- MakeMaker depend section: + + +# --- MakeMaker cflags section: + +CCFLAGS = -fno-common -DPERL_DARWIN -mmacosx-version-min=10.14 -fno-strict-aliasing -pipe -fstack-protector-strong -I/opt/local/include -DPERL_USE_SAFE_PUTENV +OPTIMIZE = -O3 +PERLTYPE = +MPOLLUTE = + + +# --- MakeMaker const_loadlibs section: + +# Perfect might depend on some other libraries: +# See ExtUtils::Liblist for details +# + + +# --- MakeMaker const_cccmd section: +CCCMD = $(CC) -c $(PASTHRU_INC) $(INC) \ + $(CCFLAGS) $(OPTIMIZE) \ + $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \ + $(XS_DEFINE_VERSION) + +# --- MakeMaker post_constants section: + + +# --- MakeMaker pasthru section: + +PASTHRU = LIBPERL_A="$(LIBPERL_A)"\ + LINKTYPE="$(LINKTYPE)"\ + OPTIMIZE="$(OPTIMIZE)"\ + PREFIX="$(PREFIX)"\ + PASTHRU_DEFINE='$(DEFINE) $(PASTHRU_DEFINE)'\ + PASTHRU_INC='$(INC) $(PASTHRU_INC)' + + +# --- MakeMaker special_targets section: +.SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) + +.PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir pure_all subdirs clean_subdirs makemakerdflt manifypods realclean_subdirs subdirs_dynamic subdirs_pure_nolink subdirs_static subdirs-test_dynamic subdirs-test_static test_dynamic test_static + + + +# --- MakeMaker c_o section: + +.c.i: + cc -E -c $(PASTHRU_INC) $(INC) \ + $(CCFLAGS) $(OPTIMIZE) \ + $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \ + $(XS_DEFINE_VERSION) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i + +.c.s : + $(CCCMD) -S $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c + +.c$(OBJ_EXT) : + $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c + +.cpp$(OBJ_EXT) : + $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cpp + +.cxx$(OBJ_EXT) : + $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cxx + +.cc$(OBJ_EXT) : + $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cc + +.C$(OBJ_EXT) : + $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.C + + +# --- MakeMaker xs_c section: + +.xs.c: + $(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $(XSUBPP_EXTRA_ARGS) $*.xs > $*.xsc + $(MV) $*.xsc $*.c + + +# --- MakeMaker xs_o section: +.xs$(OBJ_EXT) : + $(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.xsc + $(MV) $*.xsc $*.c + $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c + + +# --- MakeMaker top_targets section: +all :: pure_all manifypods + $(NOECHO) $(NOOP) + +pure_all :: config pm_to_blib subdirs linkext + $(NOECHO) $(NOOP) + + $(NOECHO) $(NOOP) + +subdirs :: $(MYEXTLIB) + $(NOECHO) $(NOOP) + +config :: $(FIRST_MAKEFILE) blibdirs + $(NOECHO) $(NOOP) + +$(O_FILES) : $(H_FILES) + +help : + perldoc ExtUtils::MakeMaker + + +# --- MakeMaker blibdirs section: +blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists + $(NOECHO) $(NOOP) + +# Backwards compat with 6.18 through 6.25 +blibdirs.ts : blibdirs + $(NOECHO) $(NOOP) + +$(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_LIBDIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_LIBDIR) + $(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists + +$(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_ARCHLIB) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHLIB) + $(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists + +$(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_AUTODIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_AUTODIR) + $(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists + +$(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHAUTODIR) + $(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists + +$(INST_BIN)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_BIN) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_BIN) + $(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists + +$(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_SCRIPT) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_SCRIPT) + $(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists + +$(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_MAN1DIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN1DIR) + $(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists + +$(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_MAN3DIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN3DIR) + $(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists + + + +# --- MakeMaker linkext section: + +linkext :: dynamic + $(NOECHO) $(NOOP) + + +# --- MakeMaker dlsyms section: + + +# --- MakeMaker dynamic_bs section: +BOOTSTRAP = $(BASEEXT).bs + +# As Mkbootstrap might not write a file (if none is required) +# we use touch to prevent make continually trying to remake it. +# The DynaLoader only reads a non-empty file. +$(BASEEXT).bs : $(FIRST_MAKEFILE) $(BOOTDEP) + $(NOECHO) $(ECHO) "Running Mkbootstrap for $(BASEEXT) ($(BSLOADLIBS))" + $(NOECHO) $(PERLRUN) \ + "-MExtUtils::Mkbootstrap" \ + -e "Mkbootstrap('$(BASEEXT)','$(BSLOADLIBS)');" + $(NOECHO) $(TOUCH) "$(BASEEXT).bs" + $(CHMOD) $(PERM_RW) "$(BASEEXT).bs" + +$(INST_ARCHAUTODIR)/$(BASEEXT).bs : $(BASEEXT).bs $(INST_ARCHAUTODIR)$(DFSEP).exists + $(NOECHO) $(RM_RF) $(INST_ARCHAUTODIR)/$(BASEEXT).bs + - $(CP_NONEMPTY) $(BASEEXT).bs $(INST_ARCHAUTODIR)/$(BASEEXT).bs $(PERM_RW) + + +# --- MakeMaker dynamic section: + +dynamic :: $(FIRST_MAKEFILE) config $(INST_BOOT) $(INST_DYNAMIC) + $(NOECHO) $(NOOP) + + +# --- MakeMaker dynamic_lib section: +# This section creates the dynamically loadable objects from relevant +# objects and possibly $(MYEXTLIB). +ARMAYBE = : +OTHERLDFLAGS = +INST_DYNAMIC_DEP = +INST_DYNAMIC_FIX = + +$(INST_DYNAMIC) : $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) + $(RM_F) $@ + $(LD) $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \ + $(PERL_ARCHIVE) $(LDLOADLIBS) $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST) \ + $(INST_DYNAMIC_FIX) + $(CHMOD) $(PERM_RWX) $@ + + +# --- MakeMaker static section: + +## $(INST_PM) has been moved to the all: target. +## It remains here for awhile to allow for old usage: "make static" +static :: $(FIRST_MAKEFILE) $(INST_STATIC) + $(NOECHO) $(NOOP) + + +# --- MakeMaker static_lib section: +$(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists + $(RM_F) "$@" + $(FULL_AR) $(AR_STATIC_ARGS) "$@" $(OBJECT) + $(RANLIB) "$@" + $(CHMOD) $(PERM_RWX) $@ + $(NOECHO) $(ECHO) "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)$(DFSEP)extralibs.ld + + +# --- MakeMaker manifypods section: + +POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" +POD2MAN = $(POD2MAN_EXE) + + +manifypods : pure_all config + $(NOECHO) $(NOOP) + + + + +# --- MakeMaker processPL section: + + +# --- MakeMaker installbin section: + + +# --- MakeMaker subdirs section: + +# none + +# --- MakeMaker clean_subdirs section: +clean_subdirs : + $(NOECHO) $(NOOP) + + +# --- MakeMaker clean section: + +# Delete temporary files but do not touch installed files. We don't delete +# the Makefile here so a later make realclean still has a makefile to use. + +clean :: clean_subdirs + - $(RM_F) \ + $(BASEEXT).bso $(BASEEXT).def \ + $(BASEEXT).exp $(BASEEXT).x \ + $(BOOTSTRAP) $(INST_ARCHAUTODIR)/extralibs.all \ + $(INST_ARCHAUTODIR)/extralibs.ld $(MAKE_APERL_FILE) \ + *$(LIB_EXT) *$(OBJ_EXT) \ + *perl.core MYMETA.json \ + MYMETA.yml blibdirs.ts \ + core core.*perl.*.? \ + core.[0-9] core.[0-9][0-9] \ + core.[0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9] \ + core.[0-9][0-9][0-9][0-9][0-9] lib$(BASEEXT).def \ + mon.out perl \ + perl$(EXE_EXT) perl.exe \ + perlmain.c pm_to_blib \ + pm_to_blib.ts so_locations \ + tmon.out + - $(RM_RF) \ + blib + $(NOECHO) $(RM_F) $(MAKEFILE_OLD) + - $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) + + +# --- MakeMaker realclean_subdirs section: +# so clean is forced to complete before realclean_subdirs runs +realclean_subdirs : clean + $(NOECHO) $(NOOP) + + +# --- MakeMaker realclean section: +# Delete temporary files (via clean) and also delete dist files +realclean purge :: realclean_subdirs + - $(RM_F) \ + $(FIRST_MAKEFILE) $(MAKEFILE_OLD) \ + $(OBJECT) + - $(RM_RF) \ + $(DISTVNAME) + + +# --- MakeMaker metafile section: +metafile : create_distdir + $(NOECHO) $(ECHO) Generating META.yml + $(NOECHO) $(ECHO) '---' > META_new.yml + $(NOECHO) $(ECHO) 'abstract: unknown' >> META_new.yml + $(NOECHO) $(ECHO) 'author:' >> META_new.yml + $(NOECHO) $(ECHO) ' - unknown' >> META_new.yml + $(NOECHO) $(ECHO) 'build_requires:' >> META_new.yml + $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: '\''0'\''' >> META_new.yml + $(NOECHO) $(ECHO) 'configure_requires:' >> META_new.yml + $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: '\''0'\''' >> META_new.yml + $(NOECHO) $(ECHO) 'dynamic_config: 1' >> META_new.yml + $(NOECHO) $(ECHO) 'generated_by: '\''ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010'\''' >> META_new.yml + $(NOECHO) $(ECHO) 'license: unknown' >> META_new.yml + $(NOECHO) $(ECHO) 'meta-spec:' >> META_new.yml + $(NOECHO) $(ECHO) ' url: http://module-build.sourceforge.net/META-spec-v1.4.html' >> META_new.yml + $(NOECHO) $(ECHO) ' version: '\''1.4'\''' >> META_new.yml + $(NOECHO) $(ECHO) 'name: Perfect' >> META_new.yml + $(NOECHO) $(ECHO) 'no_index:' >> META_new.yml + $(NOECHO) $(ECHO) ' directory:' >> META_new.yml + $(NOECHO) $(ECHO) ' - t' >> META_new.yml + $(NOECHO) $(ECHO) ' - inc' >> META_new.yml + $(NOECHO) $(ECHO) 'version: '\'''\''' >> META_new.yml + $(NOECHO) $(ECHO) 'x_serialization_backend: '\''CPAN::Meta::YAML version 0.018'\''' >> META_new.yml + -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml + $(NOECHO) $(ECHO) Generating META.json + $(NOECHO) $(ECHO) '{' > META_new.json + $(NOECHO) $(ECHO) ' "abstract" : "unknown",' >> META_new.json + $(NOECHO) $(ECHO) ' "author" : [' >> META_new.json + $(NOECHO) $(ECHO) ' "unknown"' >> META_new.json + $(NOECHO) $(ECHO) ' ],' >> META_new.json + $(NOECHO) $(ECHO) ' "dynamic_config" : 1,' >> META_new.json + $(NOECHO) $(ECHO) ' "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010",' >> META_new.json + $(NOECHO) $(ECHO) ' "license" : [' >> META_new.json + $(NOECHO) $(ECHO) ' "unknown"' >> META_new.json + $(NOECHO) $(ECHO) ' ],' >> META_new.json + $(NOECHO) $(ECHO) ' "meta-spec" : {' >> META_new.json + $(NOECHO) $(ECHO) ' "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",' >> META_new.json + $(NOECHO) $(ECHO) ' "version" : 2' >> META_new.json + $(NOECHO) $(ECHO) ' },' >> META_new.json + $(NOECHO) $(ECHO) ' "name" : "Perfect",' >> META_new.json + $(NOECHO) $(ECHO) ' "no_index" : {' >> META_new.json + $(NOECHO) $(ECHO) ' "directory" : [' >> META_new.json + $(NOECHO) $(ECHO) ' "t",' >> META_new.json + $(NOECHO) $(ECHO) ' "inc"' >> META_new.json + $(NOECHO) $(ECHO) ' ]' >> META_new.json + $(NOECHO) $(ECHO) ' },' >> META_new.json + $(NOECHO) $(ECHO) ' "prereqs" : {' >> META_new.json + $(NOECHO) $(ECHO) ' "build" : {' >> META_new.json + $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json + $(NOECHO) $(ECHO) ' "ExtUtils::MakeMaker" : "0"' >> META_new.json + $(NOECHO) $(ECHO) ' }' >> META_new.json + $(NOECHO) $(ECHO) ' },' >> META_new.json + $(NOECHO) $(ECHO) ' "configure" : {' >> META_new.json + $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json + $(NOECHO) $(ECHO) ' "ExtUtils::MakeMaker" : "0"' >> META_new.json + $(NOECHO) $(ECHO) ' }' >> META_new.json + $(NOECHO) $(ECHO) ' }' >> META_new.json + $(NOECHO) $(ECHO) ' },' >> META_new.json + $(NOECHO) $(ECHO) ' "release_status" : "stable",' >> META_new.json + $(NOECHO) $(ECHO) ' "version" : "",' >> META_new.json + $(NOECHO) $(ECHO) ' "x_serialization_backend" : "JSON::PP version 2.97001"' >> META_new.json + $(NOECHO) $(ECHO) '}' >> META_new.json + -$(NOECHO) $(MV) META_new.json $(DISTVNAME)/META.json + + +# --- MakeMaker signature section: +signature : + cpansign -s + + +# --- MakeMaker dist_basics section: +distclean :: realclean distcheck + $(NOECHO) $(NOOP) + +distcheck : + $(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck + +skipcheck : + $(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck + +manifest : + $(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest + +veryclean : realclean + $(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old + + + +# --- MakeMaker dist_core section: + +dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE) + $(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \ + -e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';' -- + +tardist : $(DISTVNAME).tar$(SUFFIX) + $(NOECHO) $(NOOP) + +uutardist : $(DISTVNAME).tar$(SUFFIX) + uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu + $(NOECHO) $(ECHO) 'Created $(DISTVNAME).tar$(SUFFIX)_uu' + +$(DISTVNAME).tar$(SUFFIX) : distdir + $(PREOP) + $(TO_UNIX) + $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME) + $(RM_RF) $(DISTVNAME) + $(COMPRESS) $(DISTVNAME).tar + $(NOECHO) $(ECHO) 'Created $(DISTVNAME).tar$(SUFFIX)' + $(POSTOP) + +zipdist : $(DISTVNAME).zip + $(NOECHO) $(NOOP) + +$(DISTVNAME).zip : distdir + $(PREOP) + $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME) + $(RM_RF) $(DISTVNAME) + $(NOECHO) $(ECHO) 'Created $(DISTVNAME).zip' + $(POSTOP) + +shdist : distdir + $(PREOP) + $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar + $(RM_RF) $(DISTVNAME) + $(NOECHO) $(ECHO) 'Created $(DISTVNAME).shar' + $(POSTOP) + + +# --- MakeMaker distdir section: +create_distdir : + $(RM_RF) $(DISTVNAME) + $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \ + -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" + +distdir : create_distdir distmeta + $(NOECHO) $(NOOP) + + + +# --- MakeMaker dist_test section: +disttest : distdir + cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL + cd $(DISTVNAME) && $(MAKE) $(PASTHRU) + cd $(DISTVNAME) && $(MAKE) test $(PASTHRU) + + + +# --- MakeMaker dist_ci section: +ci : + $(ABSPERLRUN) -MExtUtils::Manifest=maniread -e '@all = sort keys %{ maniread() };' \ + -e 'print(qq{Executing $(CI) @all\n});' \ + -e 'system(qq{$(CI) @all}) == 0 or die $$!;' \ + -e 'print(qq{Executing $(RCS_LABEL) ...\n});' \ + -e 'system(qq{$(RCS_LABEL) @all}) == 0 or die $$!;' -- + + +# --- MakeMaker distmeta section: +distmeta : create_distdir metafile + $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -e q{META.yml};' \ + -e 'eval { maniadd({q{META.yml} => q{Module YAML meta-data (added by MakeMaker)}}) }' \ + -e ' or die "Could not add META.yml to MANIFEST: $${'\''@'\''}"' -- + $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -f q{META.json};' \ + -e 'eval { maniadd({q{META.json} => q{Module JSON meta-data (added by MakeMaker)}}) }' \ + -e ' or die "Could not add META.json to MANIFEST: $${'\''@'\''}"' -- + + + +# --- MakeMaker distsignature section: +distsignature : distmeta + $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) }' \ + -e ' or die "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}"' -- + $(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE + cd $(DISTVNAME) && cpansign -s + + + +# --- MakeMaker install section: + +install :: pure_install doc_install + $(NOECHO) $(NOOP) + +install_perl :: pure_perl_install doc_perl_install + $(NOECHO) $(NOOP) + +install_site :: pure_site_install doc_site_install + $(NOECHO) $(NOOP) + +install_vendor :: pure_vendor_install doc_vendor_install + $(NOECHO) $(NOOP) + +pure_install :: pure_$(INSTALLDIRS)_install + $(NOECHO) $(NOOP) + +doc_install :: doc_$(INSTALLDIRS)_install + $(NOECHO) $(NOOP) + +pure__install : pure_site_install + $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site + +doc__install : doc_site_install + $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site + +pure_perl_install :: all + $(NOECHO) $(MOD_INSTALL) \ + read "$(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist" \ + write "$(DESTINSTALLARCHLIB)/auto/$(FULLEXT)/.packlist" \ + "$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \ + "$(INST_ARCHLIB)" "$(DESTINSTALLARCHLIB)" \ + "$(INST_BIN)" "$(DESTINSTALLBIN)" \ + "$(INST_SCRIPT)" "$(DESTINSTALLSCRIPT)" \ + "$(INST_MAN1DIR)" "$(DESTINSTALLMAN1DIR)" \ + "$(INST_MAN3DIR)" "$(DESTINSTALLMAN3DIR)" + $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ + "$(SITEARCHEXP)/auto/$(FULLEXT)" + + +pure_site_install :: all + $(NOECHO) $(MOD_INSTALL) \ + read "$(SITEARCHEXP)/auto/$(FULLEXT)/.packlist" \ + write "$(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist" \ + "$(INST_LIB)" "$(DESTINSTALLSITELIB)" \ + "$(INST_ARCHLIB)" "$(DESTINSTALLSITEARCH)" \ + "$(INST_BIN)" "$(DESTINSTALLSITEBIN)" \ + "$(INST_SCRIPT)" "$(DESTINSTALLSITESCRIPT)" \ + "$(INST_MAN1DIR)" "$(DESTINSTALLSITEMAN1DIR)" \ + "$(INST_MAN3DIR)" "$(DESTINSTALLSITEMAN3DIR)" + $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ + "$(PERL_ARCHLIB)/auto/$(FULLEXT)" + +pure_vendor_install :: all + $(NOECHO) $(MOD_INSTALL) \ + read "$(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist" \ + write "$(DESTINSTALLVENDORARCH)/auto/$(FULLEXT)/.packlist" \ + "$(INST_LIB)" "$(DESTINSTALLVENDORLIB)" \ + "$(INST_ARCHLIB)" "$(DESTINSTALLVENDORARCH)" \ + "$(INST_BIN)" "$(DESTINSTALLVENDORBIN)" \ + "$(INST_SCRIPT)" "$(DESTINSTALLVENDORSCRIPT)" \ + "$(INST_MAN1DIR)" "$(DESTINSTALLVENDORMAN1DIR)" \ + "$(INST_MAN3DIR)" "$(DESTINSTALLVENDORMAN3DIR)" + + +doc_perl_install :: all + $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod" + -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)" + -$(NOECHO) $(DOC_INSTALL) \ + "Module" "$(NAME)" \ + "installed into" "$(INSTALLPRIVLIB)" \ + LINKTYPE "$(LINKTYPE)" \ + VERSION "$(VERSION)" \ + EXE_FILES "$(EXE_FILES)" \ + >> "$(DESTINSTALLARCHLIB)/perllocal.pod" + +doc_site_install :: all + $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod" + -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)" + -$(NOECHO) $(DOC_INSTALL) \ + "Module" "$(NAME)" \ + "installed into" "$(INSTALLSITELIB)" \ + LINKTYPE "$(LINKTYPE)" \ + VERSION "$(VERSION)" \ + EXE_FILES "$(EXE_FILES)" \ + >> "$(DESTINSTALLARCHLIB)/perllocal.pod" + +doc_vendor_install :: all + $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod" + -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)" + -$(NOECHO) $(DOC_INSTALL) \ + "Module" "$(NAME)" \ + "installed into" "$(INSTALLVENDORLIB)" \ + LINKTYPE "$(LINKTYPE)" \ + VERSION "$(VERSION)" \ + EXE_FILES "$(EXE_FILES)" \ + >> "$(DESTINSTALLARCHLIB)/perllocal.pod" + + +uninstall :: uninstall_from_$(INSTALLDIRS)dirs + $(NOECHO) $(NOOP) + +uninstall_from_perldirs :: + $(NOECHO) $(UNINSTALL) "$(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist" + +uninstall_from_sitedirs :: + $(NOECHO) $(UNINSTALL) "$(SITEARCHEXP)/auto/$(FULLEXT)/.packlist" + +uninstall_from_vendordirs :: + $(NOECHO) $(UNINSTALL) "$(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist" + + +# --- MakeMaker force section: +# Phony target to force checking subdirectories. +FORCE : + $(NOECHO) $(NOOP) + + +# --- MakeMaker perldepend section: +PERL_HDRS = \ + $(PERL_INCDEP)/EXTERN.h \ + $(PERL_INCDEP)/INTERN.h \ + $(PERL_INCDEP)/XSUB.h \ + $(PERL_INCDEP)/av.h \ + $(PERL_INCDEP)/bitcount.h \ + $(PERL_INCDEP)/charclass_invlists.h \ + $(PERL_INCDEP)/config.h \ + $(PERL_INCDEP)/cop.h \ + $(PERL_INCDEP)/cv.h \ + $(PERL_INCDEP)/dosish.h \ + $(PERL_INCDEP)/dquote_inline.h \ + $(PERL_INCDEP)/ebcdic_tables.h \ + $(PERL_INCDEP)/embed.h \ + $(PERL_INCDEP)/embedvar.h \ + $(PERL_INCDEP)/fakesdio.h \ + $(PERL_INCDEP)/feature.h \ + $(PERL_INCDEP)/form.h \ + $(PERL_INCDEP)/git_version.h \ + $(PERL_INCDEP)/gv.h \ + $(PERL_INCDEP)/handy.h \ + $(PERL_INCDEP)/hv.h \ + $(PERL_INCDEP)/hv_func.h \ + $(PERL_INCDEP)/hv_macro.h \ + $(PERL_INCDEP)/inline.h \ + $(PERL_INCDEP)/intrpvar.h \ + $(PERL_INCDEP)/invlist_inline.h \ + $(PERL_INCDEP)/iperlsys.h \ + $(PERL_INCDEP)/keywords.h \ + $(PERL_INCDEP)/l1_char_class_tab.h \ + $(PERL_INCDEP)/malloc_ctl.h \ + $(PERL_INCDEP)/metaconfig.h \ + $(PERL_INCDEP)/mg.h \ + $(PERL_INCDEP)/mg_data.h \ + $(PERL_INCDEP)/mg_raw.h \ + $(PERL_INCDEP)/mg_vtable.h \ + $(PERL_INCDEP)/mydtrace.h \ + $(PERL_INCDEP)/nostdio.h \ + $(PERL_INCDEP)/op.h \ + $(PERL_INCDEP)/op_reg_common.h \ + $(PERL_INCDEP)/opcode.h \ + $(PERL_INCDEP)/opnames.h \ + $(PERL_INCDEP)/overload.h \ + $(PERL_INCDEP)/pad.h \ + $(PERL_INCDEP)/parser.h \ + $(PERL_INCDEP)/patchlevel.h \ + $(PERL_INCDEP)/perl.h \ + $(PERL_INCDEP)/perl_inc_macro.h \ + $(PERL_INCDEP)/perl_langinfo.h \ + $(PERL_INCDEP)/perlapi.h \ + $(PERL_INCDEP)/perlio.h \ + $(PERL_INCDEP)/perliol.h \ + $(PERL_INCDEP)/perlsdio.h \ + $(PERL_INCDEP)/perlvars.h \ + $(PERL_INCDEP)/perly.h \ + $(PERL_INCDEP)/pp.h \ + $(PERL_INCDEP)/pp_proto.h \ + $(PERL_INCDEP)/proto.h \ + $(PERL_INCDEP)/reentr.h \ + $(PERL_INCDEP)/regcharclass.h \ + $(PERL_INCDEP)/regcomp.h \ + $(PERL_INCDEP)/regexp.h \ + $(PERL_INCDEP)/regnodes.h \ + $(PERL_INCDEP)/sbox32_hash.h \ + $(PERL_INCDEP)/scope.h \ + $(PERL_INCDEP)/stadtx_hash.h \ + $(PERL_INCDEP)/sv.h \ + $(PERL_INCDEP)/thread.h \ + $(PERL_INCDEP)/time64.h \ + $(PERL_INCDEP)/time64_config.h \ + $(PERL_INCDEP)/uconfig.h \ + $(PERL_INCDEP)/uni_keywords.h \ + $(PERL_INCDEP)/unicode_constants.h \ + $(PERL_INCDEP)/unixish.h \ + $(PERL_INCDEP)/utf8.h \ + $(PERL_INCDEP)/utfebcdic.h \ + $(PERL_INCDEP)/util.h \ + $(PERL_INCDEP)/uudmap.h \ + $(PERL_INCDEP)/vutil.h \ + $(PERL_INCDEP)/warnings.h \ + $(PERL_INCDEP)/zaphod32_hash.h + +$(OBJECT) : $(PERL_HDRS) + + +# --- MakeMaker makefile section: + +$(OBJECT) : $(FIRST_MAKEFILE) + +# We take a very conservative approach here, but it's worth it. +# We move Makefile to Makefile.old here to avoid gnu make looping. +$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) + $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" + $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." + -$(NOECHO) $(RM_F) $(MAKEFILE_OLD) + -$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) + - $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL) + $(PERLRUN) Makefile.PL + $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" + $(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <==" + $(FALSE) + + + +# --- MakeMaker staticmake section: + +# --- MakeMaker makeaperl section --- +MAP_TARGET = perl +FULLPERL = "/Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/bin/perl" +MAP_PERLINC = "-Iblib/arch" "-Iblib/lib" "-I/Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/darwin-thread-multi-2level" "-I/Users/adamcrussell/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0" + +$(MAP_TARGET) :: $(MAKE_APERL_FILE) + $(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@ + +$(MAKE_APERL_FILE) : static $(FIRST_MAKEFILE) pm_to_blib + $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) + $(NOECHO) $(PERLRUNINST) \ + Makefile.PL DIR="" \ + MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ + MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= + + +# --- MakeMaker test section: +TEST_VERBOSE=0 +TEST_TYPE=test_$(LINKTYPE) +TEST_FILE = test.pl +TEST_FILES = +TESTDB_SW = -d + +testdb :: testdb_$(LINKTYPE) + $(NOECHO) $(NOOP) + +test :: $(TEST_TYPE) + $(NOECHO) $(NOOP) + +# Occasionally we may face this degenerate target: +test_ : test_dynamic + $(NOECHO) $(NOOP) + +subdirs-test_dynamic :: dynamic pure_all + +testdb_dynamic test_dynamic :: subdirs-test_dynamic + $(NOECHO) $(ECHO) 'No tests defined for $(NAME) extension.' + +subdirs-test_static :: static pure_all + +testdb_static test_static :: subdirs-test_static + $(NOECHO) $(ECHO) 'No tests defined for $(NAME) extension.' + + + +# --- MakeMaker ppd section: +# Creates a PPD (Perl Package Description) for a binary distribution. +ppd : + $(NOECHO) $(ECHO) '' > Perfect.ppd + $(NOECHO) $(ECHO) ' ' >> Perfect.ppd + $(NOECHO) $(ECHO) ' ' >> Perfect.ppd + $(NOECHO) $(ECHO) ' ' >> Perfect.ppd + $(NOECHO) $(ECHO) ' ' >> Perfect.ppd + $(NOECHO) $(ECHO) ' ' >> Perfect.ppd + $(NOECHO) $(ECHO) ' ' >> Perfect.ppd + $(NOECHO) $(ECHO) '' >> Perfect.ppd + + +# --- MakeMaker pm_to_blib section: + +pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM) + $(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', q[$(PM_FILTER)], '\''$(PERM_DIR)'\'')' -- \ + 'Makefile.pl' '$(INST_LIB)/Makefile.pl' \ + 'perfect.pm' '$(INST_LIB)/perfect.pm' \ + 'temp.pl' '$(INST_LIB)/temp.pl' + $(NOECHO) $(TOUCH) pm_to_blib + + +# --- MakeMaker selfdocument section: + +# here so even if top_targets is overridden, these will still be defined +# gmake will silently still work if any are .PHONY-ed but nmake won't + +static :: + $(NOECHO) $(NOOP) + +dynamic :: + $(NOECHO) $(NOOP) + +config :: + $(NOECHO) $(NOOP) + + +# --- MakeMaker postamble section: + + +# End. diff --git a/challenge-008/adam-russell/perl5/ext/Makefile.pl b/challenge-008/adam-russell/perl5/ext/Makefile.pl new file mode 100644 index 0000000000..5396352034 --- /dev/null +++ b/challenge-008/adam-russell/perl5/ext/Makefile.pl @@ -0,0 +1,6 @@ +# File : Makefile.PL +use ExtUtils::MakeMaker; +WriteMakefile( + "NAME" => "Perfect", # Name of package + "OBJECT" => "perfect.o perfect_wrap.o" # Object files +); diff --git a/challenge-008/adam-russell/perl5/ext/Perfect.bs b/challenge-008/adam-russell/perl5/ext/Perfect.bs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/challenge-008/adam-russell/perl5/ext/blib/arch/.exists b/challenge-008/adam-russell/perl5/ext/blib/arch/.exists new file mode 100644 index 0000000000..e69de29bb2 diff --git a/challenge-008/adam-russell/perl5/ext/blib/arch/auto/Perfect/.exists b/challenge-008/adam-russell/perl5/ext/blib/arch/auto/Perfect/.exists new file mode 100644 index 0000000000..e69de29bb2 diff --git a/challenge-008/adam-russell/perl5/ext/blib/arch/auto/Perfect/Perfect.bundle b/challenge-008/adam-russell/perl5/ext/blib/arch/auto/Perfect/Perfect.bundle new file mode 100755 index 0000000000..23d2b78c2d Binary files /dev/null and b/challenge-008/adam-russell/perl5/ext/blib/arch/auto/Perfect/Perfect.bundle differ diff --git a/challenge-008/adam-russell/perl5/ext/blib/bin/.exists b/challenge-008/adam-russell/perl5/ext/blib/bin/.exists new file mode 100644 index 0000000000..e69de29bb2 diff --git a/challenge-008/adam-russell/perl5/ext/blib/lib/.exists b/challenge-008/adam-russell/perl5/ext/blib/lib/.exists new file mode 100644 index 0000000000..e69de29bb2 diff --git a/challenge-008/adam-russell/perl5/ext/blib/lib/Makefile.pl b/challenge-008/adam-russell/perl5/ext/blib/lib/Makefile.pl new file mode 100644 index 0000000000..5396352034 --- /dev/null +++ b/challenge-008/adam-russell/perl5/ext/blib/lib/Makefile.pl @@ -0,0 +1,6 @@ +# File : Makefile.PL +use ExtUtils::MakeMaker; +WriteMakefile( + "NAME" => "Perfect", # Name of package + "OBJECT" => "perfect.o perfect_wrap.o" # Object files +); diff --git a/challenge-008/adam-russell/perl5/ext/blib/lib/auto/Perfect/.exists b/challenge-008/adam-russell/perl5/ext/blib/lib/auto/Perfect/.exists new file mode 100644 index 0000000000..e69de29bb2 diff --git a/challenge-008/adam-russell/perl5/ext/blib/lib/perfect.pm b/challenge-008/adam-russell/perl5/ext/blib/lib/perfect.pm new file mode 100644 index 0000000000..13d6aa08e4 --- /dev/null +++ b/challenge-008/adam-russell/perl5/ext/blib/lib/perfect.pm @@ -0,0 +1,95 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 3.0.12 +# +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. + +package Perfect; +use base qw(Exporter); +use base qw(DynaLoader); +package Perfectc; +bootstrap Perfect; +package Perfect; +@EXPORT = qw(); + +# ---------- BASE METHODS ------------- + +package Perfect; + +sub TIEHASH { + my ($classname,$obj) = @_; + return bless $obj, $classname; +} + +sub CLEAR { } + +sub FIRSTKEY { } + +sub NEXTKEY { } + +sub FETCH { + my ($self,$field) = @_; + my $member_func = "swig_${field}_get"; + $self->$member_func(); +} + +sub STORE { + my ($self,$field,$newval) = @_; + my $member_func = "swig_${field}_set"; + $self->$member_func($newval); +} + +sub this { + my $ptr = shift; + return tied(%$ptr); +} + + +# ------- FUNCTION WRAPPERS -------- + +package Perfect; + + +############# Class : Perfect::Perfect ############## + +package Perfect::Perfect; +use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); +@ISA = qw( Perfect ); +%OWNER = (); +%ITERATORS = (); +sub new { + my $pkg = shift; + my $self = Perfectc::new_Perfect(@_); + bless $self, $pkg if defined($self); +} + +sub DESTROY { + return unless $_[0]->isa('HASH'); + my $self = tied(%{$_[0]}); + return unless defined $self; + delete $ITERATORS{$self}; + if (exists $OWNER{$self}) { + Perfectc::delete_Perfect($self); + delete $OWNER{$self}; + } +} + +*isPerfect = *Perfectc::Perfect_isPerfect; +sub DISOWN { + my $self = shift; + my $ptr = tied(%$self); + delete $OWNER{$ptr}; +} + +sub ACQUIRE { + my $self = shift; + my $ptr = tied(%$self); + $OWNER{$ptr} = 1; +} + + +# ------- VARIABLE STUBS -------- + +package Perfect; + +1; diff --git a/challenge-008/adam-russell/perl5/ext/blib/lib/temp.pl b/challenge-008/adam-russell/perl5/ext/blib/lib/temp.pl new file mode 100644 index 0000000000..ed75e5c98f --- /dev/null +++ b/challenge-008/adam-russell/perl5/ext/blib/lib/temp.pl @@ -0,0 +1,14 @@ +use strict; +use warnings; + +use perfect; + +use Data::Dump q/pp/; + +my $p=new perfect::Perfect(); +foreach my $x (0..10000){ + if($p->isPerfect($x)){ + print "$x "; + } +} +print "\n"; diff --git a/challenge-008/adam-russell/perl5/ext/blib/man1/.exists b/challenge-008/adam-russell/perl5/ext/blib/man1/.exists new file mode 100644 index 0000000000..e69de29bb2 diff --git a/challenge-008/adam-russell/perl5/ext/blib/man3/.exists b/challenge-008/adam-russell/perl5/ext/blib/man3/.exists new file mode 100644 index 0000000000..e69de29bb2 diff --git a/challenge-008/adam-russell/perl5/ext/blib/script/.exists b/challenge-008/adam-russell/perl5/ext/blib/script/.exists new file mode 100644 index 0000000000..e69de29bb2 diff --git a/challenge-008/adam-russell/perl5/ext/perfect.cxx b/challenge-008/adam-russell/perl5/ext/perfect.cxx new file mode 100644 index 0000000000..4242e519b1 --- /dev/null +++ b/challenge-008/adam-russell/perl5/ext/perfect.cxx @@ -0,0 +1,25 @@ +#include "perfect.h" + +Perfect::Perfect(){ +} + +Perfect::~Perfect(){ +} + +bool Perfect::isPerfect(int n){ + long int sum = 1; + + // Find all divisors and add them + for (long int i=2; i*i<=n; i++){ + if (n%i==0){ + if(i*i!=n) + sum = sum + i + n/i; + else + sum=sum+i; + } + } + if (sum == n && n != 1){ + return true; + } + return false; +} diff --git a/challenge-008/adam-russell/perl5/ext/perfect.h b/challenge-008/adam-russell/perl5/ext/perfect.h new file mode 100644 index 0000000000..b5cb024c0f --- /dev/null +++ b/challenge-008/adam-russell/perl5/ext/perfect.h @@ -0,0 +1,11 @@ +#ifndef PERFECT_H_ +#define PERFECT_H_ + +class Perfect{ + public: + Perfect(); + ~Perfect(); + bool isPerfect(int n); +}; + +#endif diff --git a/challenge-008/adam-russell/perl5/ext/perfect.i b/challenge-008/adam-russell/perl5/ext/perfect.i new file mode 100644 index 0000000000..caa885713c --- /dev/null +++ b/challenge-008/adam-russell/perl5/ext/perfect.i @@ -0,0 +1,7 @@ +/* File : perfect.i */ +%module Perfect +%{ + #include "perfect.h" +%} + +%include "perfect.h" diff --git a/challenge-008/adam-russell/perl5/ext/perfect.o b/challenge-008/adam-russell/perl5/ext/perfect.o new file mode 100644 index 0000000000..e579ddea0f Binary files /dev/null and b/challenge-008/adam-russell/perl5/ext/perfect.o differ diff --git a/challenge-008/adam-russell/perl5/ext/perfect.pm b/challenge-008/adam-russell/perl5/ext/perfect.pm new file mode 100644 index 0000000000..13d6aa08e4 --- /dev/null +++ b/challenge-008/adam-russell/perl5/ext/perfect.pm @@ -0,0 +1,95 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 3.0.12 +# +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. + +package Perfect; +use base qw(Exporter); +use base qw(DynaLoader); +package Perfectc; +bootstrap Perfect; +package Perfect; +@EXPORT = qw(); + +# ---------- BASE METHODS ------------- + +package Perfect; + +sub TIEHASH { + my ($classname,$obj) = @_; + return bless $obj, $classname; +} + +sub CLEAR { } + +sub FIRSTKEY { } + +sub NEXTKEY { } + +sub FETCH { + my ($self,$field) = @_; + my $member_func = "swig_${field}_get"; + $self->$member_func(); +} + +sub STORE { + my ($self,$field,$newval) = @_; + my $member_func = "swig_${field}_set"; + $self->$member_func($newval); +} + +sub this { + my $ptr = shift; + return tied(%$ptr); +} + + +# ------- FUNCTION WRAPPERS -------- + +package Perfect; + + +############# Class : Perfect::Perfect ############## + +package Perfect::Perfect; +use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); +@ISA = qw( Perfect ); +%OWNER = (); +%ITERATORS = (); +sub new { + my $pkg = shift; + my $self = Perfectc::new_Perfect(@_); + bless $self, $pkg if defined($self); +} + +sub DESTROY { + return unless $_[0]->isa('HASH'); + my $self = tied(%{$_[0]}); + return unless defined $self; + delete $ITERATORS{$self}; + if (exists $OWNER{$self}) { + Perfectc::delete_Perfect($self); + delete $OWNER{$self}; + } +} + +*isPerfect = *Perfectc::Perfect_isPerfect; +sub DISOWN { + my $self = shift; + my $ptr = tied(%$self); + delete $OWNER{$ptr}; +} + +sub ACQUIRE { + my $self = shift; + my $ptr = tied(%$self); + $OWNER{$ptr} = 1; +} + + +# ------- VARIABLE STUBS -------- + +package Perfect; + +1; diff --git a/challenge-008/adam-russell/perl5/ext/perfect_wrap.cxx b/challenge-008/adam-russell/perl5/ext/perfect_wrap.cxx new file mode 100644 index 0000000000..bc7c6b2478 --- /dev/null +++ b/challenge-008/adam-russell/perl5/ext/perfect_wrap.cxx @@ -0,0 +1,2178 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 3.0.12 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + + +#ifndef SWIGPERL +#define SWIGPERL +#endif + +#define SWIG_CASTRANK_MODE + + +#ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } +}; + +template T SwigValueInit() { + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +#