3 # Makefile generator for PuTTY.
5 # Reads the file `Recipe' to determine the list of generated
6 # executables and their component objects. Then reads the source
7 # files to compute #include dependencies. Finally, writes out the
8 # various target Makefiles.
12 open IN, "Recipe" or do {
13 # We want to deal correctly with being run from one of the
14 # subdirs in the source tree. So if we can't find Recipe here,
17 open IN, "Recipe" or die "unable to open Recipe file\n";
20 # HACK: One of the source files in `charset' is auto-generated by
21 # sbcsgen.pl. We need to generate that _now_, before attempting
22 # dependency analysis.
23 eval 'chdir "charset"; require "sbcsgen.pl"; chdir ".."';
25 @incdirs = ("", "charset/", "unix/", "mac/");
27 $help = ""; # list of newline-free lines of help text
28 %programs = (); # maps prog name + type letter to listref of objects/resources
29 %groups = (); # maps group name to listref of objects/resources
32 # Skip comments (unless the comments belong, for example because
33 # they're part of the help text).
34 next if /^\s*#/ and !$in_help;
38 if ($_[0] eq "!begin" and $_[1] eq "help") { $in_help = 1; next; }
39 if ($_[0] eq "!end" and $in_help) { $in_help = 0; next; }
40 # If we're gathering help text, keep doing so.
41 if ($in_help) { $help .= "$_\n"; next; }
43 next if scalar @_ == 0;
45 # Now we have an ordinary line. See if it's an = line, a : line
50 $listref = $lastlistref;
52 die "$.: unexpected + line\n" if !defined $lastlistref;
53 } elsif ($_[1] eq "=") {
54 $groups{$_[0]} = [] if !defined $groups{$_[0]};
55 $listref = $groups{$_[0]};
57 shift @objs; # eat the group name
58 } elsif ($_[1] eq ":") {
61 shift @objs; # eat the program name
63 die "$.: unrecognised line type\n";
65 shift @objs; # eat the +, the = or the :
67 while (scalar @objs > 0) {
70 foreach $j (@{$groups{$i}}) { unshift @objs, $j; }
71 } elsif (($i eq "[G]" or $i eq "[C]" or $i eq "[M]" or
72 $i eq "[X]" or $i eq "[U]") and defined $prog) {
73 $type = substr($i,1,1);
78 if ($prog and $type) {
79 die "multiple program entries for $prog [$type]\n"
80 if defined $programs{$prog . "," . $type};
81 $programs{$prog . "," . $type} = $listref;
83 $lastlistref = $listref;
88 # Now retrieve the complete list of objects and resource files, and
89 # construct dependency data for them. While we're here, expand the
90 # object list for each program, and complain if its type isn't set.
91 @prognames = sort keys %programs;
94 foreach $i (@prognames) {
95 ($prog, $type) = split ",", $i;
96 # Strip duplicate object names.
98 @list = grep { $status = ($prev ne $_); $prev=$_; $status }
99 sort @{$programs{$i}};
100 $programs{$i} = [@list];
102 # Dependencies for "x" start with "x.c".
103 # Dependencies for "x.res" start with "x.rc".
104 # Dependencies for "x.rsrc" start with "x.r".
105 # Both types of file are pushed on the list of files to scan.
106 # Libraries (.lib) don't have dependencies at all.
107 if ($j =~ /^(.*)\.res$/) {
109 $depends{$j} = [$file];
110 push @scanlist, $file;
111 } elsif ($j =~ /^(.*)\.rsrc$/) {
113 $depends{$j} = [$file];
114 push @scanlist, $file;
115 } elsif ($j =~ /\.lib$/) {
116 # libraries don't have dependencies
119 $depends{$j} = [$file];
120 push @scanlist, $file;
125 # Scan each file on @scanlist and find further inclusions.
126 # Inclusions are given by lines of the form `#include "otherfile"'
127 # (system headers are automatically ignored by this because they'll
128 # be given in angle brackets). Files included by this method are
129 # added back on to @scanlist to be scanned in turn (if not already
132 # Resource scripts (.rc) can also include a file by means of a line
133 # ending `ICON "filename"'. Files included by this method are not
134 # added to @scanlist because they can never include further files.
136 # In this pass we write out a hash %further which maps a source
137 # file name into a listref containing further source file names.
140 while (scalar @scanlist > 0) {
141 $file = shift @scanlist;
142 next if defined $further{$file}; # skip if we've already done it
143 $resource = ($file =~ /\.rc$/ ? 1 : 0);
144 $further{$file} = [];
145 $dirfile = &findfile($file);
146 open IN, "$dirfile" or die "unable to open source file $file\n";
149 /^\s*#include\s+\"([^\"]+)\"/ and do {
150 push @{$further{$file}}, $1;
154 /ICON\s+\"([^\"]+)\"\s*$/ and do {
155 push @{$further{$file}}, $1;
162 # Now we're ready to generate the final dependencies section. For
163 # each key in %depends, we must expand the dependencies list by
164 # iteratively adding entries from %further.
165 foreach $i (keys %depends) {
167 @scanlist = @{$depends{$i}};
168 foreach $i (@scanlist) { $dep{$i} = 1; }
169 while (scalar @scanlist > 0) {
170 $file = shift @scanlist;
171 foreach $j (@{$further{$file}}) {
174 push @{$depends{$i}}, $j;
179 # printf "%s: %s\n", $i, join ' ',@{$depends{$i}};
182 # Utility routines while writing out the Makefiles.
186 my $dir, $i, $outdir = "";
187 unless (defined $findfilecache{$name}) {
189 foreach $dir (@incdirs) {
190 $outdir = $dir, $i++ if -f "$dir$name";
192 die "multiple instances of source file $name\n" if $i > 1;
193 $findfilecache{$name} = $outdir . $name;
195 return $findfilecache{$name};
199 my ($prog, $otmpl, $rtmpl, $ltmpl, $prefix, $dirsep) = @_;
203 foreach $i (@{$programs{$prog}}) {
205 if ($i =~ /^(.*)\.(res|rsrc)/) {
207 ($x = $rtmpl) =~ s/X/$y/;
208 } elsif ($i =~ /^(.*)\.lib/) {
210 ($x = $ltmpl) =~ s/X/$y/;
212 ($x = $otmpl) =~ s/X/$i/;
214 push @ret, $x if $x ne "";
216 return join " ", @ret;
220 my ($line, $width, $splitchar) = @_;
222 $len = (defined $width ? $width : 76);
223 $splitchar = (defined $splitchar ? $splitchar : '\\');
224 while (length $line > $len) {
225 $line =~ /^(.{0,$len})\s(.*)$/ or $line =~ /^(.{$len,}?\s(.*)$/;
226 $result .= $1 . " ${splitchar}\n\t\t";
230 return $result . $line;
234 my ($otmpl, $rtmpl, $prefix, $dirsep, $depchar, $splitchar) = @_;
239 foreach $i (sort keys %depends) {
240 if ($i =~ /^(.*)\.(res|rsrc)/) {
241 next if !defined $rtmpl;
243 ($x = $rtmpl) =~ s/X/$y/;
245 ($x = $otmpl) =~ s/X/$i/;
247 @deps = @{$depends{$i}};
253 push @ret, {obj => $x, deps => [@deps]};
260 my ($n, $prog, $type);
263 foreach $n (@prognames) {
264 ($prog, $type) = split ",", $n;
265 push @ret, $n if index($types, $type) >= 0;
272 my ($n, $prog, $type);
275 foreach $n (@prognames) {
276 ($prog, $type) = split ",", $n;
277 push @ret, $prog if index($types, $type) >= 0;
283 my ($types,$suffix) = @_;
285 # assume that all UNIX programs have a man page
286 if($suffix eq "1" && $types =~ /X/) {
287 return map("$_.1", &progrealnames($types));
292 # Now we're ready to output the actual Makefiles.
295 open OUT, ">Makefile.cyg"; select OUT;
297 "# Makefile for PuTTY under cygwin.\n".
298 "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
299 "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
300 # gcc command line option is -D not /D
301 ($_ = $help) =~ s/=\/D/=-D/gs;
305 "# You can define this path to point at your tools if you need to\n".
306 "# TOOLPATH = c:\\cygwin\\bin\\ # or similar, if you're running Windows\n".
307 "# TOOLPATH = /pkg/mingw32msvc/i386-mingw32msvc/bin/\n".
308 "CC = \$(TOOLPATH)gcc\n".
309 "RC = \$(TOOLPATH)windres\n".
310 "# Uncomment the following two lines to compile under Winelib\n".
313 "# You may also need to tell windres where to find include files:\n".
314 "# RCINC = --include-dir c:\\cygwin\\include\\\n".
316 &splitline("CFLAGS = -mno-cygwin -Wall -O2 -D_WINDOWS -DDEBUG -DWIN32S_COMPAT".
317 " -D_NO_OLDNAMES -DNO_MULTIMON -I.")."\n".
318 "LDFLAGS = -mno-cygwin -s\n".
319 &splitline("RCFLAGS = \$(RCINC) --define WIN32=1 --define _WIN32=1".
320 " --define WINVER=0x0400 --define MINGW32_FIX=1")."\n".
325 "\t\$(CC) \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) -c \$<\n".
328 "\t\$(RC) \$(FWHACK) \$(RCFL) \$(RCFLAGS) \$< \$\@\n".
330 print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("GC"));
332 foreach $p (&prognames("GC")) {
333 ($prog, $type) = split ",", $p;
334 $objstr = &objects($p, "X.o", "X.res.o", undef);
335 print &splitline($prog . ".exe: " . $objstr), "\n";
336 my $mw = $type eq "G" ? " -mwindows" : "";
337 $libstr = &objects($p, undef, undef, "-lX");
338 print &splitline("\t\$(CC)" . $mw . " \$(LDFLAGS) -o \$@ " .
339 $objstr . " $libstr", 69), "\n\n";
341 foreach $d (&deps("X.o", "X.res.o", "", "/")) {
342 print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})),
347 "version.o: FORCE;\n".
348 "# Hack to force version.o to be rebuilt always\n".
350 "\t\$(CC) \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) \$(VER) -c version.c\n".
352 "\trm -f *.o *.exe *.res.o\n".
354 select STDOUT; close OUT;
356 ##-- Borland makefile
357 %stdlibs = ( # Borland provides many Win32 API libraries intrinsically
369 open OUT, ">Makefile.bor"; select OUT;
371 "# Makefile for PuTTY under Borland C.\n".
372 "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
373 "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
374 # bcc32 command line option is -D not /D
375 ($_ = $help) =~ s/=\/D/=-D/gs;
379 "# If you rename this file to `Makefile', you should change this line,\n".
380 "# so that the .rsp files still depend on the correct makefile.\n".
381 "MAKEFILE = Makefile.bor\n".
383 "# C compilation flags\n".
384 "CFLAGS = -D_WINDOWS -DWINVER=0x0401\n".
386 "# Get include directory for resource compiler\n".
388 "BCB = \$(MAKEDIR)\\..\n".
392 &splitline("\tbcc32 -w-aus -w-ccc -w-par -w-pia \$(COMPAT) \$(FWHACK)".
393 " \$(XFLAGS) \$(CFLAGS) /c \$*.c",69)."\n".
395 &splitline("\tbrcc32 \$(FWHACK) \$(RCFL) -i \$(BCB)\\include -r".
396 " -DNO_WINRESRC_H -DWIN32 -D_WIN32 -DWINVER=0x0401 \$*.rc",69)."\n".
398 print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("GC"));
400 foreach $p (&prognames("GC")) {
401 ($prog, $type) = split ",", $p;
402 $objstr = &objects($p, "X.obj", "X.res", undef);
403 print &splitline("$prog.exe: " . $objstr . " $prog.rsp"), "\n";
404 my $ap = ($type eq "G") ? "-aa" : "-ap";
405 print "\tilink32 $ap -Gn -L\$(BCB)\\lib \@$prog.rsp\n\n";
407 foreach $p (&prognames("GC")) {
408 ($prog, $type) = split ",", $p;
409 print $prog, ".rsp: \$(MAKEFILE)\n";
410 $objstr = &objects($p, "X.obj", undef, undef);
411 @objlist = split " ", $objstr;
413 foreach $i (@objlist) {
414 if (length($objlines[$#objlines] . " $i") > 50) {
417 $objlines[$#objlines] .= " $i";
419 $c0w = ($type eq "G") ? "c0w32" : "c0x32";
420 print "\techo $c0w + > $prog.rsp\n";
421 for ($i=0; $i<=$#objlines; $i++) {
422 $plus = ($i < $#objlines ? " +" : "");
423 print "\techo$objlines[$i]$plus >> $prog.rsp\n";
425 print "\techo $prog.exe >> $prog.rsp\n";
426 $objstr = &objects($p, "X.obj", "X.res", undef);
427 @libs = split " ", &objects($p, undef, undef, "X");
428 @libs = grep { !$stdlibs{$_} } @libs;
429 unshift @libs, "cw32", "import32";
430 $libstr = join ' ', @libs;
431 print "\techo nul,$libstr, >> $prog.rsp\n";
432 print "\techo " . &objects($p, undef, "X.res", undef) . " >> $prog.rsp\n";
435 foreach $d (&deps("X.obj", "X.res", "", "\\")) {
436 print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})),
441 "version.o: FORCE\n".
442 "# Hack to force version.o to be rebuilt always\n".
444 "\tbcc32 \$(FWHACK) \$(VER) \$(CFLAGS) /c version.c\n\n".
455 "\t-del *.\$\$\$\$\$\$\n";
456 select STDOUT; close OUT;
458 ##-- Visual C++ makefile
459 open OUT, ">Makefile.vc"; select OUT;
461 "# Makefile for PuTTY under Visual C.\n".
462 "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
463 "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
467 "# If you rename this file to `Makefile', you should change this line,\n".
468 "# so that the .rsp files still depend on the correct makefile.\n".
469 "MAKEFILE = Makefile.vc\n".
471 "# C compilation flags\n".
472 "CFLAGS = /nologo /W3 /O1 /D_WINDOWS /D_WIN32_WINDOWS=0x401 /DWINVER=0x401\n".
473 "LFLAGS = /incremental:no /fixed\n".
476 "\tcl \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) /c \$*.c\n".
478 "\trc \$(FWHACK) \$(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 \$*.rc\n".
480 print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("GC"));
482 foreach $p (&prognames("GC")) {
483 ($prog, $type) = split ",", $p;
484 $objstr = &objects($p, "X.obj", "X.res", undef);
485 print &splitline("$prog.exe: " . $objstr . " $prog.rsp"), "\n";
486 print "\tlink \$(LFLAGS) -out:$prog.exe -map:$prog.map \@$prog.rsp\n\n";
488 foreach $p (&prognames("GC")) {
489 ($prog, $type) = split ",", $p;
490 print $prog, ".rsp: \$(MAKEFILE)\n";
491 $objstr = &objects($p, "X.obj", "X.res", "X.lib");
492 @objlist = split " ", $objstr;
494 foreach $i (@objlist) {
495 if (length($objlines[$#objlines] . " $i") > 50) {
498 $objlines[$#objlines] .= " $i";
500 $subsys = ($type eq "G") ? "windows" : "console";
501 print "\techo /nologo /subsystem:$subsys > $prog.rsp\n";
502 for ($i=0; $i<=$#objlines; $i++) {
503 print "\techo$objlines[$i] >> $prog.rsp\n";
507 foreach $d (&deps("X.obj", "X.res", "", "\\")) {
508 print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})),
513 "# Hack to force version.o to be rebuilt always\n".
514 "version.obj: *.c *.h *.rc\n".
515 "\tcl \$(FWHACK) \$(VER) \$(CFLAGS) /c version.c\n\n".
533 "\t-del debug.log\n";
534 select STDOUT; close OUT;
536 ##-- X/GTK/Unix makefile
537 open OUT, ">unix/Makefile.gtk"; select OUT;
539 "# Makefile for PuTTY under X/GTK and Unix.\n".
540 "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
541 "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
542 # gcc command line option is -D not /D
543 ($_ = $help) =~ s/=\/D/=-D/gs;
547 "# You can define this path to point at your tools if you need to\n".
548 "# TOOLPATH = /opt/gcc/bin\n".
549 "CC = \$(TOOLPATH)cc\n".
551 &splitline("CFLAGS = -O2 -Wall -Werror -g -I. -I.. -I../charset `gtk-config --cflags`")."\n".
552 "XLDFLAGS = `gtk-config --libs`\n".
555 "INSTALL_PROGRAM=\$(INSTALL)\n",
556 "INSTALL_DATA=\$(INSTALL)\n",
557 "prefix=/usr/local\n",
558 "exec_prefix=\$(prefix)\n",
559 "bindir=\$(exec_prefix)/bin\n",
560 "mandir=\$(prefix)/man\n",
561 "man1dir=\$(mandir)/man1\n",
566 "\t\$(CC) \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) -c \$<\n".
568 print &splitline("all:" . join "", map { " $_" } &progrealnames("XU"));
570 foreach $p (&prognames("XU")) {
571 ($prog, $type) = split ",", $p;
572 $objstr = &objects($p, "X.o", undef, undef);
573 print &splitline($prog . ": " . $objstr), "\n";
574 $libstr = &objects($p, undef, undef, "-lX");
575 print &splitline("\t\$(CC)" . $mw . " \$(${type}LDFLAGS) -o \$@ " .
576 $objstr . " $libstr", 69), "\n\n";
578 foreach $d (&deps("X.o", undef, "../", "/")) {
579 print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})),
584 "version.o: FORCE;\n".
585 "# Hack to force version.o to be rebuilt always\n".
587 "\t\$(CC) \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) \$(VER) -c ../version.c\n".
589 "\trm -f *.o". (join "", map { " $_" } &progrealnames("XU")) . "\n".
592 map("\t\$(INSTALL_PROGRAM) -m 755 $_ \$(DESTDIR)\$(bindir)/$_\n", &progrealnames("XU")),
593 map("\t\$(INSTALL_DATA) -m 644 $_ \$(DESTDIR)\$(man1dir)/$_\n", &manpages("XU", "1")),
596 "\t\$(MAKE) install INSTALL_PROGRAM=\"\$(INSTALL_PROGRAM) -s\"\n",
598 select STDOUT; close OUT;
601 open OUT, ">mac/Makefile.mpw"; select OUT;
603 # Makefile for PuTTY under MPW.
605 # This file was created by `mkfiles.pl' from the `Recipe' file.
606 # DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.
608 # MPW command line option is -d not /D
609 ($_ = $help) =~ s/=\/D/=-d /gs;
613 ROptions = `Echo "{VER}" | StreamEdit -e "1,\$ replace /=(\xc5)\xa81\xb0/ 'STR=\xb6\xb6\xb6\xb6\xb6"' \xa81 '\xb6\xb6\xb6\xb6\xb6"'"`
620 # -w 35 disables "unused parameter" warnings
621 COptions = -i : -i :: -i ::charset -w 35 -w err -proto strict -ansi on \xb6
623 COptions_68K = {COptions} -model far -opt time
624 # Enabling "-opt space" for CFM-68K gives me undefined references to
625 # _\$LDIVT and _\$LMODT.
626 COptions_CFM68K = {COptions} -model cfmSeg -opt time
627 COptions_PPC = {COptions} -opt size -traceback
628 COptions_Carbon = {COptions} -opt size -traceback -d TARGET_API_MAC_CARBON
633 Link_Carbon = PPCLink
635 LinkOptions = -c 'pTTY'
636 LinkOptions_68K = {LinkOptions} -br 68k -model far -compact
637 LinkOptions_CFM68K = {LinkOptions} -br 020 -model cfmseg -compact
638 LinkOptions_PPC = {LinkOptions}
639 LinkOptions_Carbon = -m __appstart -w {LinkOptions}
641 Libs_68K = "{CLibraries}StdCLib.far.o" \xb6
642 "{Libraries}MacRuntime.o" \xb6
643 "{Libraries}MathLib.far.o" \xb6
644 "{Libraries}IntEnv.far.o" \xb6
645 "{Libraries}Interface.o" \xb6
646 "{Libraries}Navigation.far.o" \xb6
647 "{Libraries}OpenTransport.o" \xb6
648 "{Libraries}OpenTransportApp.o" \xb6
649 "{Libraries}OpenTptInet.o" \xb6
650 "{Libraries}UnicodeConverterLib.far.o"
652 Libs_CFM = "{SharedLibraries}InterfaceLib" \xb6
653 "{SharedLibraries}StdCLib" \xb6
654 "{SharedLibraries}AppearanceLib" \xb6
655 -weaklib AppearanceLib \xb6
656 "{SharedLibraries}NavigationLib" \xb6
657 -weaklib NavigationLib \xb6
658 "{SharedLibraries}TextCommon" \xb6
659 -weaklib TextCommon \xb6
660 "{SharedLibraries}UnicodeConverter" \xb6
661 -weaklib UnicodeConverter
663 Libs_CFM68K = {Libs_CFM} \xb6
664 "{CFM68KLibraries}NuMacRuntime.o"
666 Libs_PPC = {Libs_CFM} \xb6
667 "{SharedLibraries}ControlsLib" \xb6
668 -weaklib ControlsLib \xb6
669 "{SharedLibraries}WindowsLib" \xb6
670 -weaklib WindowsLib \xb6
671 "{SharedLibraries}OpenTransportLib" \xb6
672 -weaklib OTClientLib \xb6
673 -weaklib OTClientUtilLib \xb6
674 "{SharedLibraries}OpenTptInternetLib" \xb6
675 -weaklib OTInetClientLib \xb6
676 "{PPCLibraries}StdCRuntime.o" \xb6
677 "{PPCLibraries}PPCCRuntime.o" \xb6
678 "{PPCLibraries}CarbonAccessors.o" \xb6
679 "{PPCLibraries}OpenTransportAppPPC.o" \xb6
680 "{PPCLibraries}OpenTptInetPPC.o"
682 Libs_Carbon = "{PPCLibraries}CarbonStdCLib.o" \xb6
683 "{PPCLibraries}StdCRuntime.o" \xb6
684 "{PPCLibraries}PPCCRuntime.o" \xb6
685 "{SharedLibraries}CarbonLib" \xb6
686 "{SharedLibraries}StdCLib"
689 print &splitline("all \xc4 " . join(" ", &progrealnames("M")), undef, "\xb6");
691 foreach $p (&prognames("M")) {
692 ($prog, $type) = split ",", $p;
694 print &splitline("$prog \xc4 $prog.68k $prog.ppc $prog.carbon",
695 undef, "\xb6"), "\n\n";
697 $rsrc = &objects($p, "", "X.rsrc", undef);
699 foreach $arch (qw(68K CFM68K PPC Carbon)) {
700 $objstr = &objects($p, "X.\L$arch\E.o", "", undef);
701 print &splitline("$prog.\L$arch\E \xc4 $objstr $rsrc", undef, "\xb6");
703 print &splitline("\tDuplicate -y $rsrc {Targ}", 69, "\xb6"), "\n";
704 print &splitline("\t{Link_$arch} -o {Targ} -fragname $prog " .
705 "{LinkOptions_$arch} " .
706 $objstr . " {Libs_$arch}", 69, "\xb6"), "\n";
707 print &splitline("\tSetFile -a BMi {Targ}", 69, "\xb6"), "\n\n";
711 foreach $d (&deps("", "X.rsrc", "::", ":")) {
712 next unless $d->{obj};
713 print &splitline(sprintf("%s \xc4 %s", $d->{obj}, join " ", @{$d->{deps}}),
714 undef, "\xb6"), "\n";
715 print "\tRez ", $d->{deps}->[0], " -o {Targ} {ROptions}\n\n";
717 foreach $arch (qw(68K CFM68K)) {
718 foreach $d (&deps("X.\L$arch\E.o", "", "::", ":")) {
719 next unless $d->{obj};
720 print &splitline(sprintf("%s \xc4 %s", $d->{obj},
721 join " ", @{$d->{deps}}),
722 undef, "\xb6"), "\n";
723 print "\t{C_$arch} ", $d->{deps}->[0],
724 " -o {Targ} {COptions_$arch}\n\n";
727 foreach $arch (qw(PPC Carbon)) {
728 foreach $d (&deps("X.\L$arch\E.o", "", "::", ":")) {
729 next unless $d->{obj};
730 print &splitline(sprintf("%s \xc4 %s", $d->{obj},
731 join " ", @{$d->{deps}}),
732 undef, "\xb6"), "\n";
733 # The odd stuff here seems to stop afpd getting confused.
734 print "\techo -n > {Targ}\n";
735 print "\tsetfile -t XCOF {Targ}\n";
736 print "\t{C_$arch} ", $d->{deps}->[0],
737 " -o {Targ} {COptions_$arch}\n\n";
740 select STDOUT; close OUT;