X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/c88dc003865de6396a5fd0d6402675a5ea8b3237..811453cbc32f1f0f14cfef25f54eabf2e3b28bd9:/mkfiles.pl diff --git a/mkfiles.pl b/mkfiles.pl index fabdc87b..422b8b0e 100755 --- a/mkfiles.pl +++ b/mkfiles.pl @@ -9,9 +9,20 @@ 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"; +}; -@incdirs = ("", "unix/", "mac/"); +# HACK: One of the source files in `charset' is auto-generated by +# sbcsgen.pl. We need to generate that _now_, before attempting +# dependency analysis. +eval 'chdir "charset"; require "sbcsgen.pl"; chdir ".."'; + +@incdirs = ("", "charset/", "unix/", "mac/"); $help = ""; # list of newline-free lines of help text %programs = (); # maps prog name + type letter to listref of objects/resources @@ -293,6 +304,9 @@ print "# TOOLPATH = /pkg/mingw32msvc/i386-mingw32msvc/bin/\n". "CC = \$(TOOLPATH)gcc\n". "RC = \$(TOOLPATH)windres\n". +"# Uncomment the following two lines to compile under Winelib\n". +"# CC = winegcc\n". +"# RC = wrc\n". "# You may also need to tell windres where to find include files:\n". "# RCINC = --include-dir c:\\cygwin\\include\\\n". "\n". @@ -531,7 +545,7 @@ print "# TOOLPATH = /opt/gcc/bin\n". "CC = \$(TOOLPATH)cc\n". "\n". -&splitline("CFLAGS = -Wall -g -I. -I.. `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", @@ -593,30 +607,51 @@ END print $_; 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 $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;