Package list libcryptx-perl / 3f24975
chmod fix Karel Miko 3 years ago
25 changed file(s) with 6 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
33 use File::Find qw(find);
44 use File::Slurper qw(read_text write_text);
55 use FindBin;
6
7 warn "gonna chmod..\n";
8 find({ wanted=>sub { system "chmod -x $_" if -f $_ && -x $_ && $_ =~ /\.(c|h)/ }, no_chdir=>1 }, "$FindBin::Bin/ltm", "$FindBin::Bin/ltc");
69
710 my @objs = ();
11 warn "gonna find ltc..\n";
812 find({ wanted=>sub { push @objs, $_ if $_ =~ /\.c$/ && $_ !~ /tab\.c$/}, no_chdir=>1 }, "$FindBin::Bin/ltc");
13 warn "gonna find ltm..\n";
914 find({ wanted=>sub { push @objs, $_ if $_ =~ /\.c$/ }, no_chdir=>1 }, "$FindBin::Bin/ltm");
1015
1116 my $o = "OBJS=" . (join " ", map { s/\.c$/.o/r } map { s!^.*/(ltm|ltc)/!$1/!r } @objs) =~ s/(.{80}) /$1 \\\n/gr;
1217 my $obj = "OBJS=" . (join " ", map { s/\.c$/.obj/r } map { s!^.*/(ltm|ltc)/!$1/!r } @objs) =~ s/(.{80}) /$1 \\\n/gr;
1318
19 warn "gonna write makefiles..\n";
1420 write_text("$FindBin::Bin/Makefile", read_text("$FindBin::Bin/Makefile") =~ s/OBJS=.+?\.o\n/$o\n/sr);
1521 write_text("$FindBin::Bin/Makefile.nmake", read_text("$FindBin::Bin/Makefile.nmake") =~ s/OBJS=.+?\.obj\n/$obj\n/sr);