X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/58de2f3c7d0312d782a9940c898399f473fb2a2b..c259a13d673caca062a1e2244c1d70ed60b1926c:/mkfiles.pl?ds=inline diff --git a/mkfiles.pl b/mkfiles.pl index f9c48c0a..b36edd35 100755 --- a/mkfiles.pl +++ b/mkfiles.pl @@ -336,6 +336,7 @@ foreach $p (&prognames("GC")) { my $mw = $type eq "G" ? " -mwindows" : ""; $libstr = &objects($p, undef, undef, "-lX"); print &splitline("\t\$(CC)" . $mw . " \$(LDFLAGS) -o \$@ " . + "-Wl,-Map,$prog.map " . $objstr . " $libstr", 69), "\n\n"; } foreach $d (&deps("X.o", "X.res.o", "", "/")) { @@ -349,7 +350,7 @@ print "FORCE:\n". "\t\$(CC) \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) \$(VER) -c version.c\n". "clean:\n". -"\trm -f *.o *.exe *.res.o\n". +"\trm -f *.o *.exe *.res.o *.map\n". "\n"; select STDOUT; close OUT; @@ -834,7 +835,11 @@ print "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". +"\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", @@ -988,3 +993,62 @@ foreach $arch (qw(PPC Carbon)) { } } select STDOUT; close OUT; + +##-- lcc makefile +open OUT, ">Makefile.lcc"; select OUT; +print +"# Makefile for PuTTY 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 +($_ = $help) =~ s/=\/D/=-D/gs; +print $_; +print +"\n". +"# If you rename this file to `Makefile', you should change this line,\n". +"# so that the .rsp files still depend on the correct makefile.\n". +"MAKEFILE = Makefile.lcc\n". +"\n". +"# C compilation flags\n". +"CFLAGS = -D_WINDOWS\n". +"\n". +"# Get include directory for resource compiler\n". +"\n". +".c.obj:\n". +&splitline("\tlcc -O -p6 \$(COMPAT) \$(FWHACK)". + " \$(XFLAGS) \$(CFLAGS) \$*.c",69)."\n". +".rc.res:\n". +&splitline("\tlrc \$(FWHACK) \$(RCFL) -r \$*.rc",69)."\n". +"\n"; +print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("GC")); +print "\n\n"; +foreach $p (&prognames("GC")) { + ($prog, $type) = split ",", $p; + $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"; } + 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". +"\t-del *.obj\n". +"\t-del *.exe\n". +"\t-del *.res\n"; + +select STDOUT; close OUT; +