mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Make mkfiles.pl less tied to PuTTY in particular, by inventing new
directives that allow me to move some of the PuTTY-specific Makefile fragments into Recipe. Not complete yet, but ought to be enough for me to at least _try_ using mkfiles.pl in another project. [originally from svn r4136]
This commit is contained in:
parent
3867e5956e
commit
7bd6bec8e4
73
Recipe
73
Recipe
@ -6,6 +6,20 @@
|
||||
# really be made by editing this file and/or the Perl script, not
|
||||
# by editing the actual Makefiles.
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Top-level configuration.
|
||||
|
||||
# Overall project name.
|
||||
!name putty
|
||||
# Locations and types of output Makefiles.
|
||||
!makefile vc Makefile.vc
|
||||
!makefile vcproj MSVC
|
||||
!makefile cygwin Makefile.cyg
|
||||
!makefile borland Makefile.bor
|
||||
!makefile lcc Makefile.lcc
|
||||
!makefile gtk unix/Makefile.gtk
|
||||
!makefile mpw mac/Makefile.mpw
|
||||
|
||||
# Help text added to the top of each Makefile, with /D converted
|
||||
# into -D as appropriate for the particular Makefile.
|
||||
|
||||
@ -85,6 +99,64 @@
|
||||
#
|
||||
!end
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Additional text added verbatim to each individual Makefile.
|
||||
|
||||
# Hack to force version.o to be rebuilt always.
|
||||
!begin vc
|
||||
version.obj: *.c *.h *.rc
|
||||
cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
|
||||
!end
|
||||
!begin cygwin
|
||||
version.o: FORCE;
|
||||
FORCE:
|
||||
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) $(VER) -c version.c
|
||||
!end
|
||||
!begin borland
|
||||
version.obj: FORCE
|
||||
FORCE:
|
||||
bcc32 $(FWHACK) $(VER) $(CFLAGS) /c version.obj
|
||||
!end
|
||||
!begin lcc
|
||||
version.o: FORCE
|
||||
FORCE:
|
||||
lcc $(FWHACK) $(VER) $(CFLAGS) /c version.c
|
||||
!end
|
||||
# For Unix, we also need the gross MD5 hack that causes automatic
|
||||
# version number selection in release source archives.
|
||||
!begin gtk
|
||||
version.o: FORCE;
|
||||
FORCE:
|
||||
if test -z "$(VER)" && (cd ..; md5sum -c manifest); then \
|
||||
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) `cat ../version.def` -c ../version.c; \
|
||||
else \
|
||||
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) $(VER) -c ../version.c; \
|
||||
fi
|
||||
!end
|
||||
|
||||
# `make install' target for Unix.
|
||||
!begin gtk
|
||||
install:
|
||||
$(INSTALL_PROGRAM) -m 755 plink $(DESTDIR)$(bindir)/plink
|
||||
$(INSTALL_PROGRAM) -m 755 pscp $(DESTDIR)$(bindir)/pscp
|
||||
$(INSTALL_PROGRAM) -m 755 psftp $(DESTDIR)$(bindir)/psftp
|
||||
$(INSTALL_PROGRAM) -m 755 pterm $(DESTDIR)$(bindir)/pterm
|
||||
$(INSTALL_PROGRAM) -m 755 putty $(DESTDIR)$(bindir)/putty
|
||||
$(INSTALL_PROGRAM) -m 755 puttygen $(DESTDIR)$(bindir)/puttygen
|
||||
$(INSTALL_PROGRAM) -m 755 puttytel $(DESTDIR)$(bindir)/puttytel
|
||||
$(INSTALL_DATA) -m 644 ../doc/plink.1 $(DESTDIR)$(man1dir)/plink.1
|
||||
$(INSTALL_DATA) -m 644 ../doc/pscp.1 $(DESTDIR)$(man1dir)/pscp.1
|
||||
$(INSTALL_DATA) -m 644 ../doc/psftp.1 $(DESTDIR)$(man1dir)/psftp.1
|
||||
$(INSTALL_DATA) -m 644 ../doc/pterm.1 $(DESTDIR)$(man1dir)/pterm.1
|
||||
$(INSTALL_DATA) -m 644 ../doc/putty.1 $(DESTDIR)$(man1dir)/putty.1
|
||||
$(INSTALL_DATA) -m 644 ../doc/puttygen.1 $(DESTDIR)$(man1dir)/puttygen.1
|
||||
$(INSTALL_DATA) -m 644 ../doc/puttytel.1 $(DESTDIR)$(man1dir)/puttytel.1
|
||||
|
||||
install-strip:
|
||||
$(MAKE) install INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s"
|
||||
!end
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Definitions of object groups. A group name, followed by an =,
|
||||
# followed by any number of objects or other already-defined group
|
||||
# names. A line beginning `+' is assumed to continue the previous
|
||||
@ -128,6 +200,7 @@ CHARSET = sbcsdat slookup sbcs utf8 toucs fromucs xenc mimeenc macenc localenc
|
||||
LIBS = advapi32.lib user32.lib gdi32.lib comctl32.lib comdlg32.lib
|
||||
+ shell32.lib winmm.lib imm32.lib winspool.lib
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Definitions of actual programs. The program name, followed by a
|
||||
# colon, followed by a list of objects. Also in the list may be the
|
||||
# keywords [G] for Windows GUI app, [C] for Console app, [X] for
|
||||
|
327
mkfiles.pl
327
mkfiles.pl
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env perl
|
||||
#
|
||||
# Makefile generator for PuTTY.
|
||||
# Cross-platform Makefile generator.
|
||||
#
|
||||
# Reads the file `Recipe' to determine the list of generated
|
||||
# executables and their component objects. Then reads the source
|
||||
@ -8,6 +8,7 @@
|
||||
# various target Makefiles.
|
||||
|
||||
use FileHandle;
|
||||
use Cwd;
|
||||
|
||||
open IN, "Recipe" or do {
|
||||
# We want to deal correctly with being run from one of the
|
||||
@ -24,21 +25,35 @@ eval 'chdir "charset"; require "sbcsgen.pl"; chdir ".."';
|
||||
|
||||
@incdirs = ("", "charset/", "unix/", "mac/");
|
||||
|
||||
$divert = undef; # ref to scalar in which text is currently being put
|
||||
$help = ""; # list of newline-free lines of help text
|
||||
$project_name = "project"; # this is a good enough default
|
||||
%makefiles = (); # maps makefile types to output makefile pathnames
|
||||
%makefile_extra = (); # maps makefile types to extra Makefile text
|
||||
%programs = (); # maps prog name + type letter to listref of objects/resources
|
||||
%groups = (); # maps group name to listref of objects/resources
|
||||
|
||||
while (<IN>) {
|
||||
# Skip comments (unless the comments belong, for example because
|
||||
# they're part of the help text).
|
||||
next if /^\s*#/ and !$in_help;
|
||||
# they're part of a diversion).
|
||||
next if /^\s*#/ and !defined $divert;
|
||||
|
||||
chomp;
|
||||
split;
|
||||
if ($_[0] eq "!begin" and $_[1] eq "help") { $in_help = 1; next; }
|
||||
if ($_[0] eq "!end" and $in_help) { $in_help = 0; next; }
|
||||
if ($_[0] eq "!begin" and $_[1] eq "help") { $divert = \$help; next; }
|
||||
if ($_[0] eq "!end") { $divert = undef; next; }
|
||||
if ($_[0] eq "!name") { $project_name = $_[1]; next; }
|
||||
if ($_[0] eq "!makefile" and &mfval($_[1])) { $makefiles{$_[1]}=$_[2]; next;}
|
||||
if ($_[0] eq "!begin") {
|
||||
if (&mfval($_[1])) {
|
||||
$divert = \$makefile_extra{$_[1]};
|
||||
} else {
|
||||
$divert = \$dummy;
|
||||
}
|
||||
next;
|
||||
}
|
||||
# If we're gathering help text, keep doing so.
|
||||
if ($in_help) { $help .= "$_\n"; next; }
|
||||
if (defined $divert) { ${$divert} .= "$_\n"; next; }
|
||||
# Ignore blank lines.
|
||||
next if scalar @_ == 0;
|
||||
|
||||
@ -179,6 +194,20 @@ foreach $i (keys %depends) {
|
||||
# printf "%s: %s\n", $i, join ' ',@{$depends{$i}};
|
||||
}
|
||||
|
||||
# Validation of input.
|
||||
|
||||
sub mfval($) {
|
||||
my ($type) = @_;
|
||||
# Returns true if the argument is a known makefile type. Otherwise,
|
||||
# prints a warning and returns false;
|
||||
if (grep { $type eq $_ }
|
||||
("vc","vcproj","cygwin","borland","lcc","gtk","mpw")) {
|
||||
return 1;
|
||||
}
|
||||
warn "$.:unknown makefile type '$type'\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
# Utility routines while writing out the Makefiles.
|
||||
|
||||
sub findfile {
|
||||
@ -291,10 +320,12 @@ sub manpages {
|
||||
|
||||
# Now we're ready to output the actual Makefiles.
|
||||
|
||||
if (defined $makefiles{'cygwin'}) {
|
||||
|
||||
##-- CygWin makefile
|
||||
open OUT, ">Makefile.cyg"; select OUT;
|
||||
open OUT, ">$makefiles{'cygwin'}"; select OUT;
|
||||
print
|
||||
"# Makefile for PuTTY under cygwin.\n".
|
||||
"# Makefile for $project_name under cygwin.\n".
|
||||
"#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
|
||||
"# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
|
||||
# gcc command line option is -D not /D
|
||||
@ -343,18 +374,17 @@ foreach $d (&deps("X.o", "X.res.o", "", "/")) {
|
||||
print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})),
|
||||
"\n";
|
||||
}
|
||||
print
|
||||
"\n".
|
||||
"version.o: FORCE;\n".
|
||||
"# Hack to force version.o to be rebuilt always\n".
|
||||
"FORCE:\n".
|
||||
"\t\$(CC) \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) \$(VER) -c version.c\n".
|
||||
"clean:\n".
|
||||
print "\n";
|
||||
print $makefile_extra{'cygwin'};
|
||||
print "\nclean:\n".
|
||||
"\trm -f *.o *.exe *.res.o *.map\n".
|
||||
"\n";
|
||||
select STDOUT; close OUT;
|
||||
|
||||
}
|
||||
|
||||
##-- Borland makefile
|
||||
if (defined $makefiles{'borland'}) {
|
||||
%stdlibs = ( # Borland provides many Win32 API libraries intrinsically
|
||||
"advapi32" => 1,
|
||||
"comctl32" => 1,
|
||||
@ -367,9 +397,9 @@ select STDOUT; close OUT;
|
||||
"winspool" => 1,
|
||||
"wsock32" => 1,
|
||||
);
|
||||
open OUT, ">Makefile.bor"; select OUT;
|
||||
open OUT, ">$makefiles{'borland'}"; select OUT;
|
||||
print
|
||||
"# Makefile for PuTTY under Borland C.\n".
|
||||
"# Makefile for $project_name under Borland C.\n".
|
||||
"#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
|
||||
"# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
|
||||
# bcc32 command line option is -D not /D
|
||||
@ -437,13 +467,9 @@ foreach $d (&deps("X.obj", "X.res", "", "\\")) {
|
||||
print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})),
|
||||
"\n";
|
||||
}
|
||||
print
|
||||
"\n".
|
||||
"version.o: FORCE\n".
|
||||
"# Hack to force version.o to be rebuilt always\n".
|
||||
"FORCE:\n".
|
||||
"\tbcc32 \$(FWHACK) \$(VER) \$(CFLAGS) /c version.c\n\n".
|
||||
"clean:\n".
|
||||
print "\n";
|
||||
print $makefile_extra{'borland'};
|
||||
print "\nclean:\n".
|
||||
"\t-del *.obj\n".
|
||||
"\t-del *.exe\n".
|
||||
"\t-del *.res\n".
|
||||
@ -455,11 +481,13 @@ print
|
||||
"\t-del *.tds\n".
|
||||
"\t-del *.\$\$\$\$\$\$\n";
|
||||
select STDOUT; close OUT;
|
||||
}
|
||||
|
||||
if (defined $makefiles{'vc'}) {
|
||||
##-- Visual C++ makefile
|
||||
open OUT, ">Makefile.vc"; select OUT;
|
||||
open OUT, ">$makefiles{'vc'}"; select OUT;
|
||||
print
|
||||
"# Makefile for PuTTY under Visual C.\n".
|
||||
"# Makefile for $project_name under Visual C.\n".
|
||||
"#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
|
||||
"# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
|
||||
print $help;
|
||||
@ -509,12 +537,9 @@ foreach $d (&deps("X.obj", "X.res", "", "\\")) {
|
||||
print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})),
|
||||
"\n";
|
||||
}
|
||||
print
|
||||
"\n".
|
||||
"# Hack to force version.o to be rebuilt always\n".
|
||||
"version.obj: *.c *.h *.rc\n".
|
||||
"\tcl \$(FWHACK) \$(VER) \$(CFLAGS) /c version.c\n\n".
|
||||
"clean: tidy\n".
|
||||
print "\n";
|
||||
print $makefile_extra{'vc'};
|
||||
print "\nclean: tidy\n".
|
||||
"\t-del *.exe\n\n".
|
||||
"tidy:\n".
|
||||
"\t-del *.obj\n".
|
||||
@ -533,6 +558,11 @@ print
|
||||
"\t-del *.idb\n".
|
||||
"\t-del debug.log\n";
|
||||
select STDOUT; close OUT;
|
||||
}
|
||||
|
||||
if (defined $makefiles{'vcproj'}) {
|
||||
|
||||
$orig_dir = cwd;
|
||||
|
||||
##-- MSVC 6 Workspace and projects
|
||||
#
|
||||
@ -544,9 +574,9 @@ select STDOUT; close OUT;
|
||||
# and explicitly write the CRLFs.
|
||||
#
|
||||
# Create directories if necessary
|
||||
mkdir 'MSVC'
|
||||
if(! -d 'MSVC');
|
||||
chdir 'MSVC';
|
||||
mkdir $makefiles{'vcproj'}
|
||||
if(! -d $makefiles{'vcproj'});
|
||||
chdir $makefiles{'vcproj'};
|
||||
@deps = &deps("X.obj", "X.res", "", "\\");
|
||||
%all_object_deps = map {$_->{obj} => $_->{deps}} @deps;
|
||||
# Create the project files
|
||||
@ -556,7 +586,7 @@ foreach $progname (@prognames) {
|
||||
create_project(\%all_object_deps, $progname);
|
||||
}
|
||||
# Create the workspace file
|
||||
open OUT, ">putty.dsw"; binmode OUT; select OUT;
|
||||
open OUT, ">$project_name.dsw"; binmode OUT; select OUT;
|
||||
print
|
||||
"Microsoft Developer Studio Workspace File, Format Version 6.00\r\n".
|
||||
"# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r\n".
|
||||
@ -593,7 +623,7 @@ print
|
||||
"###############################################################################\r\n".
|
||||
"\r\n";
|
||||
select STDOUT; close OUT;
|
||||
chdir '..';
|
||||
chdir $orig_dir;
|
||||
|
||||
sub create_project {
|
||||
my ($all_object_deps, $progname) = @_;
|
||||
@ -781,13 +811,16 @@ sub create_project {
|
||||
"# End Target\r\n".
|
||||
"# End Project\r\n";
|
||||
select STDOUT; close OUT;
|
||||
chdir '..';
|
||||
chdir "..";
|
||||
}
|
||||
}
|
||||
|
||||
if (defined $makefiles{'gtk'}) {
|
||||
|
||||
##-- X/GTK/Unix makefile
|
||||
open OUT, ">unix/Makefile.gtk"; select OUT;
|
||||
open OUT, ">$makefiles{'gtk'}"; select OUT;
|
||||
print
|
||||
"# Makefile for PuTTY under X/GTK and Unix.\n".
|
||||
"# Makefile for $project_name under X/GTK and Unix.\n".
|
||||
"#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
|
||||
"# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
|
||||
# gcc command line option is -D not /D
|
||||
@ -830,117 +863,99 @@ foreach $d (&deps("X.o", undef, "../", "/")) {
|
||||
print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})),
|
||||
"\n";
|
||||
}
|
||||
print
|
||||
"\n".
|
||||
"version.o: FORCE;\n".
|
||||
"# Hack to force version.o to be rebuilt always\n".
|
||||
"FORCE:\n".
|
||||
"\tif test -z \"\$(VER)\" && (cd ..; md5sum -c manifest); then \\\n".
|
||||
"\t\t\$(CC) \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) `cat ../version.def` -c ../version.c; \\\n".
|
||||
"\telse \\\n".
|
||||
"\t\t\$(CC) \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) \$(VER) -c ../version.c; \\\n".
|
||||
"\tfi\n".
|
||||
"clean:\n".
|
||||
"\trm -f *.o". (join "", map { " $_" } &progrealnames("XU")) . "\n".
|
||||
"\n",
|
||||
"install:\n",
|
||||
map("\t\$(INSTALL_PROGRAM) -m 755 $_ \$(DESTDIR)\$(bindir)/$_\n", &progrealnames("XU")),
|
||||
map("\t\$(INSTALL_DATA) -m 644 ../doc/$_ \$(DESTDIR)\$(man1dir)/$_\n", &manpages("XU", "1")),
|
||||
"\n",
|
||||
"install-strip:\n",
|
||||
"\t\$(MAKE) install INSTALL_PROGRAM=\"\$(INSTALL_PROGRAM) -s\"\n",
|
||||
"\n";
|
||||
print "\n";
|
||||
print $makefile_extra{'gtk'};
|
||||
print "\nclean:\n".
|
||||
"\trm -f *.o". (join "", map { " $_" } &progrealnames("XU")) . "\n";
|
||||
select STDOUT; close OUT;
|
||||
}
|
||||
|
||||
if (defined $makefiles{'mpw'}) {
|
||||
##-- MPW Makefile
|
||||
open OUT, ">mac/Makefile.mpw"; select OUT;
|
||||
print <<END;
|
||||
# Makefile for PuTTY under MPW.
|
||||
#
|
||||
# This file was created by `mkfiles.pl' from the `Recipe' file.
|
||||
# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.
|
||||
END
|
||||
open OUT, ">$makefiles{'mpw'}"; select OUT;
|
||||
print
|
||||
"# Makefile for $project_name under MPW.\n#\n".
|
||||
"# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
|
||||
"# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
|
||||
# MPW command line option is -d not /D
|
||||
($_ = $help) =~ s/=\/D/=-d /gs;
|
||||
print $_;
|
||||
print <<END;
|
||||
|
||||
ROptions = `Echo "{VER}" | StreamEdit -e "1,\$ replace /=(\xc5)\xa81\xb0/ 'STR=\xb6\xb6\xb6\xb6\xb6"' \xa81 '\xb6\xb6\xb6\xb6\xb6"'"`
|
||||
|
||||
C_68K = {C}
|
||||
C_CFM68K = {C}
|
||||
C_PPC = {PPCC}
|
||||
C_Carbon = {PPCC}
|
||||
|
||||
# -w 35 disables "unused parameter" warnings
|
||||
COptions = -i : -i :: -i ::charset -w 35 -w err -proto strict -ansi on \xb6
|
||||
-notOnce
|
||||
COptions_68K = {COptions} -model far -opt time
|
||||
# Enabling "-opt space" for CFM-68K gives me undefined references to
|
||||
# _\$LDIVT and _\$LMODT.
|
||||
COptions_CFM68K = {COptions} -model cfmSeg -opt time
|
||||
COptions_PPC = {COptions} -opt size -traceback
|
||||
COptions_Carbon = {COptions} -opt size -traceback -d TARGET_API_MAC_CARBON
|
||||
|
||||
Link_68K = ILink
|
||||
Link_CFM68K = ILink
|
||||
Link_PPC = PPCLink
|
||||
Link_Carbon = PPCLink
|
||||
|
||||
LinkOptions = -c 'pTTY'
|
||||
LinkOptions_68K = {LinkOptions} -br 68k -model far -compact
|
||||
LinkOptions_CFM68K = {LinkOptions} -br 020 -model cfmseg -compact
|
||||
LinkOptions_PPC = {LinkOptions}
|
||||
LinkOptions_Carbon = -m __appstart -w {LinkOptions}
|
||||
|
||||
Libs_68K = "{CLibraries}StdCLib.far.o" \xb6
|
||||
"{Libraries}MacRuntime.o" \xb6
|
||||
"{Libraries}MathLib.far.o" \xb6
|
||||
"{Libraries}IntEnv.far.o" \xb6
|
||||
"{Libraries}Interface.o" \xb6
|
||||
"{Libraries}Navigation.far.o" \xb6
|
||||
"{Libraries}OpenTransport.o" \xb6
|
||||
"{Libraries}OpenTransportApp.o" \xb6
|
||||
"{Libraries}OpenTptInet.o" \xb6
|
||||
"{Libraries}UnicodeConverterLib.far.o"
|
||||
|
||||
Libs_CFM = "{SharedLibraries}InterfaceLib" \xb6
|
||||
"{SharedLibraries}StdCLib" \xb6
|
||||
"{SharedLibraries}AppearanceLib" \xb6
|
||||
-weaklib AppearanceLib \xb6
|
||||
"{SharedLibraries}NavigationLib" \xb6
|
||||
-weaklib NavigationLib \xb6
|
||||
"{SharedLibraries}TextCommon" \xb6
|
||||
-weaklib TextCommon \xb6
|
||||
"{SharedLibraries}UnicodeConverter" \xb6
|
||||
-weaklib UnicodeConverter
|
||||
|
||||
Libs_CFM68K = {Libs_CFM} \xb6
|
||||
"{CFM68KLibraries}NuMacRuntime.o"
|
||||
|
||||
Libs_PPC = {Libs_CFM} \xb6
|
||||
"{SharedLibraries}ControlsLib" \xb6
|
||||
-weaklib ControlsLib \xb6
|
||||
"{SharedLibraries}WindowsLib" \xb6
|
||||
-weaklib WindowsLib \xb6
|
||||
"{SharedLibraries}OpenTransportLib" \xb6
|
||||
-weaklib OTClientLib \xb6
|
||||
-weaklib OTClientUtilLib \xb6
|
||||
"{SharedLibraries}OpenTptInternetLib" \xb6
|
||||
-weaklib OTInetClientLib \xb6
|
||||
"{PPCLibraries}StdCRuntime.o" \xb6
|
||||
"{PPCLibraries}PPCCRuntime.o" \xb6
|
||||
"{PPCLibraries}CarbonAccessors.o" \xb6
|
||||
"{PPCLibraries}OpenTransportAppPPC.o" \xb6
|
||||
"{PPCLibraries}OpenTptInetPPC.o"
|
||||
|
||||
Libs_Carbon = "{PPCLibraries}CarbonStdCLib.o" \xb6
|
||||
"{PPCLibraries}StdCRuntime.o" \xb6
|
||||
"{PPCLibraries}PPCCRuntime.o" \xb6
|
||||
"{SharedLibraries}CarbonLib" \xb6
|
||||
"{SharedLibraries}StdCLib"
|
||||
|
||||
END
|
||||
print "\n\n".
|
||||
"ROptions = `Echo \"{VER}\" | StreamEdit -e \"1,\$ replace /=(\xc5)\xa81\xb0/ 'STR=\xb6\xb6\xb6\xb6\xb6\"' \xa81 '\xb6\xb6\xb6\xb6\xb6\"'\"`".
|
||||
"\n".
|
||||
"C_68K = {C}\n".
|
||||
"C_CFM68K = {C}\n".
|
||||
"C_PPC = {PPCC}\n".
|
||||
"C_Carbon = {PPCC}\n".
|
||||
"\n".
|
||||
"# -w 35 disables \"unused parameter\" warnings\n".
|
||||
"COptions = -i : -i :: -i ::charset -w 35 -w err -proto strict -ansi on \xb6\n".
|
||||
" -notOnce\n".
|
||||
"COptions_68K = {COptions} -model far -opt time\n".
|
||||
"# Enabling \"-opt space\" for CFM-68K gives me undefined references to\n".
|
||||
"# _\$LDIVT and _\$LMODT.\n".
|
||||
"COptions_CFM68K = {COptions} -model cfmSeg -opt time\n".
|
||||
"COptions_PPC = {COptions} -opt size -traceback\n".
|
||||
"COptions_Carbon = {COptions} -opt size -traceback -d TARGET_API_MAC_CARBON\n".
|
||||
"\n".
|
||||
"Link_68K = ILink\n".
|
||||
"Link_CFM68K = ILink\n".
|
||||
"Link_PPC = PPCLink\n".
|
||||
"Link_Carbon = PPCLink\n".
|
||||
"\n".
|
||||
"LinkOptions = -c 'pTTY'\n".
|
||||
"LinkOptions_68K = {LinkOptions} -br 68k -model far -compact\n".
|
||||
"LinkOptions_CFM68K = {LinkOptions} -br 020 -model cfmseg -compact\n".
|
||||
"LinkOptions_PPC = {LinkOptions}\n".
|
||||
"LinkOptions_Carbon = -m __appstart -w {LinkOptions}\n".
|
||||
"\n".
|
||||
"Libs_68K = \"{CLibraries}StdCLib.far.o\" \xb6\n".
|
||||
" \"{Libraries}MacRuntime.o\" \xb6\n".
|
||||
" \"{Libraries}MathLib.far.o\" \xb6\n".
|
||||
" \"{Libraries}IntEnv.far.o\" \xb6\n".
|
||||
" \"{Libraries}Interface.o\" \xb6\n".
|
||||
" \"{Libraries}Navigation.far.o\" \xb6\n".
|
||||
" \"{Libraries}OpenTransport.o\" \xb6\n".
|
||||
" \"{Libraries}OpenTransportApp.o\" \xb6\n".
|
||||
" \"{Libraries}OpenTptInet.o\" \xb6\n".
|
||||
" \"{Libraries}UnicodeConverterLib.far.o\"\n".
|
||||
"\n".
|
||||
"Libs_CFM = \"{SharedLibraries}InterfaceLib\" \xb6\n".
|
||||
" \"{SharedLibraries}StdCLib\" \xb6\n".
|
||||
" \"{SharedLibraries}AppearanceLib\" \xb6\n".
|
||||
" -weaklib AppearanceLib \xb6\n".
|
||||
" \"{SharedLibraries}NavigationLib\" \xb6\n".
|
||||
" -weaklib NavigationLib \xb6\n".
|
||||
" \"{SharedLibraries}TextCommon\" \xb6\n".
|
||||
" -weaklib TextCommon \xb6\n".
|
||||
" \"{SharedLibraries}UnicodeConverter\" \xb6\n".
|
||||
" -weaklib UnicodeConverter\n".
|
||||
"\n".
|
||||
"Libs_CFM68K = {Libs_CFM} \xb6\n".
|
||||
" \"{CFM68KLibraries}NuMacRuntime.o\"\n".
|
||||
"\n".
|
||||
"Libs_PPC = {Libs_CFM} \xb6\n".
|
||||
" \"{SharedLibraries}ControlsLib\" \xb6\n".
|
||||
" -weaklib ControlsLib \xb6\n".
|
||||
" \"{SharedLibraries}WindowsLib\" \xb6\n".
|
||||
" -weaklib WindowsLib \xb6\n".
|
||||
" \"{SharedLibraries}OpenTransportLib\" \xb6\n".
|
||||
" -weaklib OTClientLib \xb6\n".
|
||||
" -weaklib OTClientUtilLib \xb6\n".
|
||||
" \"{SharedLibraries}OpenTptInternetLib\" \xb6\n".
|
||||
" -weaklib OTInetClientLib \xb6\n".
|
||||
" \"{PPCLibraries}StdCRuntime.o\" \xb6\n".
|
||||
" \"{PPCLibraries}PPCCRuntime.o\" \xb6\n".
|
||||
" \"{PPCLibraries}CarbonAccessors.o\" \xb6\n".
|
||||
" \"{PPCLibraries}OpenTransportAppPPC.o\" \xb6\n".
|
||||
" \"{PPCLibraries}OpenTptInetPPC.o\"\n".
|
||||
"\n".
|
||||
"Libs_Carbon = \"{PPCLibraries}CarbonStdCLib.o\" \xb6\n".
|
||||
" \"{PPCLibraries}StdCRuntime.o\" \xb6\n".
|
||||
" \"{PPCLibraries}PPCCRuntime.o\" \xb6\n".
|
||||
" \"{SharedLibraries}CarbonLib\" \xb6\n".
|
||||
" \"{SharedLibraries}StdCLib\"\n".
|
||||
"\n";
|
||||
print &splitline("all \xc4 " . join(" ", &progrealnames("M")), undef, "\xb6");
|
||||
print "\n\n";
|
||||
foreach $p (&prognames("M")) {
|
||||
@ -993,11 +1008,13 @@ foreach $arch (qw(PPC Carbon)) {
|
||||
}
|
||||
}
|
||||
select STDOUT; close OUT;
|
||||
}
|
||||
|
||||
if (defined $makefiles{'lcc'}) {
|
||||
##-- lcc makefile
|
||||
open OUT, ">Makefile.lcc"; select OUT;
|
||||
open OUT, ">$makefiles{'lcc'}"; select OUT;
|
||||
print
|
||||
"# Makefile for PuTTY under lcc.\n".
|
||||
"# Makefile for $project_name under lcc.\n".
|
||||
"#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
|
||||
"# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
|
||||
# lcc command line option is -D not /D
|
||||
@ -1027,28 +1044,22 @@ foreach $p (&prognames("GC")) {
|
||||
$objstr = &objects($p, "X.obj", "X.res", undef);
|
||||
print &splitline("$prog.exe: " . $objstr ), "\n";
|
||||
$subsystemtype = undef;
|
||||
if ($prog eq "pageant" || $prog eq "putty" ||$prog eq "puttygen" || $prog eq "puttytel") {
|
||||
$subsystemtype = "-subsystem windows"; }
|
||||
if ($type eq "G") { $subsystemtype = "-subsystem windows"; }
|
||||
my $libss = "shell32.lib wsock32.lib ws2_32.lib winspool.lib winmm.lib imm32.lib";
|
||||
print &splitline("\tlcclnk $subsystemtype -o $prog.exe $objstr $libss");
|
||||
print "\n\n";
|
||||
}
|
||||
|
||||
|
||||
foreach $d (&deps("X.obj", "X.res", "", "\\")) {
|
||||
print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})),
|
||||
"\n";
|
||||
}
|
||||
print
|
||||
"\n".
|
||||
"version.o: FORCE\n".
|
||||
"# Hack to force version.o to be rebuilt always\n".
|
||||
"FORCE:\n".
|
||||
"\tlcc \$(FWHACK) \$(VER) \$(CFLAGS) /c version.c\n\n".
|
||||
"clean:\n".
|
||||
print "\n";
|
||||
print $makefile_extra{'lcc'};
|
||||
print "\nclean:\n".
|
||||
"\t-del *.obj\n".
|
||||
"\t-del *.exe\n".
|
||||
"\t-del *.res\n";
|
||||
|
||||
select STDOUT; close OUT;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user