X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/9ef3c1cab755348f63c462bbd350af3c3c6ecfbe..811453cbc32f1f0f14cfef25f54eabf2e3b28bd9:/mkfiles.pl diff --git a/mkfiles.pl b/mkfiles.pl index 2ac8e160..422b8b0e 100755 --- a/mkfiles.pl +++ b/mkfiles.pl @@ -9,7 +9,13 @@ use FileHandle; -open IN, "Recipe" or die "unable to open Recipe file\n"; +open IN, "Recipe" or do { + # We want to deal correctly with being run from one of the + # subdirs in the source tree. So if we can't find Recipe here, + # try one level up. + chdir ".."; + open IN, "Recipe" or die "unable to open Recipe file\n"; +}; # HACK: One of the source files in `charset' is auto-generated by # sbcsgen.pl. We need to generate that _now_, before attempting @@ -539,7 +545,7 @@ print "# TOOLPATH = /opt/gcc/bin\n". "CC = \$(TOOLPATH)cc\n". "\n". -&splitline("CFLAGS = -Wall -Werror -g -I. -I.. -I../charset `gtk-config --cflags`")."\n". +&splitline("CFLAGS = -O2 -Wall -Werror -g -I. -I.. -I../charset `gtk-config --cflags`")."\n". "XLDFLAGS = `gtk-config --libs`\n". "ULDFLAGS =#\n". "INSTALL=install\n", @@ -603,21 +609,31 @@ print <{obj}; print &splitline(sprintf("%s \xc4 %s", $d->{obj}, join " ", @{$d->{deps}}), undef, "\xb6"), "\n"; print "\tRez ", $d->{deps}->[0], " -o {Targ} {ROptions}\n\n"; -} -foreach $d (&deps("X.68k.o", "", "::", ":")) { - next unless $d->{obj}; - print &splitline(sprintf("%s \xc4 %s", $d->{obj}, join " ", @{$d->{deps}}), - undef, "\xb6"), "\n"; - print "\t{C} ", $d->{deps}->[0], " -o {Targ} {COptions_68K}\n\n"; } -foreach $d (&deps("X.cfm68k.o", "", "::", ":")) { - next unless $d->{obj}; - print &splitline(sprintf("%s \xc4 %s", $d->{obj}, join " ", @{$d->{deps}}), - undef, "\xb6"), "\n"; - print "\t{C} ", $d->{deps}->[0], " -o {Targ} {COptions_CFM68K}\n\n"; +foreach $arch (qw(68K CFM68K)) { + foreach $d (&deps("X.\L$arch\E.o", "", "::", ":")) { + next unless $d->{obj}; + print &splitline(sprintf("%s \xc4 %s", $d->{obj}, + join " ", @{$d->{deps}}), + undef, "\xb6"), "\n"; + print "\t{C_$arch} ", $d->{deps}->[0], + " -o {Targ} {COptions_$arch}\n\n"; + } } -foreach $d (&deps("X.ppc.o", "", "::", ":")) { - next unless $d->{obj}; - print &splitline(sprintf("%s \xc4 %s", $d->{obj}, join " ", @{$d->{deps}}), - undef, "\xb6"), "\n"; - # The odd stuff here seems to stop afpd getting confused. - print "\techo -n > {Targ}\n"; - print "\tsetfile -t XCOF {Targ}\n"; - print "\t{PPCC} ", $d->{deps}->[0], " -o {Targ} {COptions_PPC}\n\n"; -} -foreach $d (&deps("X.carbon.o", "", "::", ":")) { - next unless $d->{obj}; - print &splitline(sprintf("%s \xc4 %s", $d->{obj}, join " ", @{$d->{deps}}), - undef, "\xb6"), "\n"; - # The odd stuff here seems to stop afpd getting confused. - print "\techo -n > {Targ}\n"; - print "\tsetfile -t XCOF {Targ}\n"; - print "\t{PPCC} ", $d->{deps}->[0], " -o {Targ} {COptions_Carbon}\n\n"; +foreach $arch (qw(PPC Carbon)) { + foreach $d (&deps("X.\L$arch\E.o", "", "::", ":")) { + next unless $d->{obj}; + print &splitline(sprintf("%s \xc4 %s", $d->{obj}, + join " ", @{$d->{deps}}), + undef, "\xb6"), "\n"; + # The odd stuff here seems to stop afpd getting confused. + print "\techo -n > {Targ}\n"; + print "\tsetfile -t XCOF {Targ}\n"; + print "\t{C_$arch} ", $d->{deps}->[0], + " -o {Targ} {COptions_$arch}\n\n"; + } } select STDOUT; close OUT;