diff --git a/readme.txt b/generate_folder.pl similarity index 90% rename from readme.txt rename to generate_folder.pl index 7165151..b59b9b6 100644 --- a/readme.txt +++ b/generate_folder.pl @@ -10,6 +10,7 @@ use File::pushd; use feature 'signatures'; + my @dlls = ( glob('/usr/x86_64-w64-mingw32/usr/bin/*'), glob('/usr/x86_64-w64-mingw32/usr/lib/*') @@ -100,14 +101,14 @@ my $destdir = path(__FILE__)->parent->absolute; "@{[$destdir->child('c/bin')]};@{[$destdir->child('perl/bin')]}", ); -exec 'wperl.exe', $destdir->child('start.pl'); +exec 'perl/bin/wperl.exe', $destdir->child('start.pl'); EOF my $start_c_file_contents = <<'EOF'; #include int main() { - return execl( "perl/bin/wperl.exe", "wperl.exe", "-Iperl/lib", "setup_env.pl", NULL ); + return execl( "perl/bin/wperl.exe", "wperl.exe", "-Iperl/lib", "setup_env.pl", (char *)NULL ); } EOF @@ -139,12 +140,18 @@ EOF $destdir->child('start.c')->spew_raw($start_c_file_contents); $destdir->child('start.pl')->spew_raw($start_pl_file_contents); $destdir->child('setup_env.pl')->spew_raw($setup_env_file_contents); - execute('rm', $destdir->child('start.exe')); + execute('rm', '-f', $destdir->child('start.exe')); execute( qw{/usr/bin/x86_64-w64-mingw32-gcc -mwindows -o}, $destdir->child('start.exe'), $destdir->child('start.c'), '-Wl,--subsystem,windows', ); + execute( 'rm', '-r', $destdir->child('.wine')); + execute( 'find', $destdir, '-name', '*.h', '-delete'); + execute( 'find', $destdir, '-name', '*.a', '-delete'); + execute( 'find', $destdir, '-name', '*.cmake', '-delete'); + execute( 'find', $destdir, '-name', '*.idl', '-delete'); + execute( 'find', $destdir, '-name', '*.rst', '-delete'); } sub execute(@command) {