X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/77603464f5b4231df69eb20ca278062bd7aae9fb..58070d221740f21df8c354ab653c49a184d37ebf:/mkfiles.pl diff --git a/mkfiles.pl b/mkfiles.pl index b48c0a79..8905c3fc 100755 --- a/mkfiles.pl +++ b/mkfiles.pl @@ -212,7 +212,7 @@ sub mfval($) { # 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","osx")) { + ("vc","vcproj","cygwin","borland","lcc","gtk","ac","mpw","osx")) { return 1; } warn "$.:unknown makefile type '$type'\n"; @@ -396,7 +396,7 @@ if (defined $makefiles{'cygwin'}) { "\n". "LDFLAGS = -mno-cygwin -s\n". &splitline("RCFLAGS = \$(RCINC) --define WIN32=1 --define _WIN32=1". - " --define WINVER=0x0400 --define MINGW32_FIX=1")."\n". + " --define WINVER=0x0400")."\n". "\n". $makefile_extra{'cygwin'}->{'vars'} . "\n". @@ -945,6 +945,64 @@ if (defined $makefiles{'gtk'}) { select STDOUT; close OUT; } +if (defined $makefiles{'ac'}) { + $dirpfx = &dirpfx($makefiles{'ac'}, "/"); + + ##-- Unix/autoconf makefile + open OUT, ">$makefiles{'ac'}"; select OUT; + print + "# Makefile.in for $project_name under Unix with Autoconf.\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 + ($_ = $help) =~ s/=\/D/=-D/gs; + print $_; + print + "\n". + "CC = \@CC\@\n". + "\n". + &splitline("CFLAGS = \@CFLAGS\@ \@CPPFLAGS\@ \@DEFS\@ \@GTK_CFLAGS\@ " . + (join " ", map {"-I$dirpfx$_"} @srcdirs))."\n". + "XLDFLAGS = \@LDFLAGS\@ \@LIBS\@ \@GTK_LIBS\@\n". + "ULDFLAGS = \@LDFLAGS\@ \@LIBS\@\n". + "INSTALL=\@INSTALL\@\n", + "INSTALL_PROGRAM=\$(INSTALL)\n", + "INSTALL_DATA=\$(INSTALL)\n", + "prefix=\@prefix\@\n", + "exec_prefix=\@exec_prefix\@\n", + "bindir=\@bindir\@\n", + "mandir=\@mandir\@\n", + "man1dir=\$(mandir)/man1\n", + "\n". + $makefile_extra{'gtk'}->{'vars'} . + "\n". + ".SUFFIXES:\n". + "\n". + "\n". + "all: \@all_targets\@\n". + &splitline("all-cli:" . join "", map { " $_" } &progrealnames("U"))."\n". + &splitline("all-gtk:" . join "", map { " $_" } &progrealnames("X"))."\n"; + print "\n"; + foreach $p (&prognames("X:U")) { + ($prog, $type) = split ",", $p; + $objstr = &objects($p, "X.o", undef, undef); + print &splitline($prog . ": " . $objstr), "\n"; + $libstr = &objects($p, undef, undef, "-lX"); + print &splitline("\t\$(CC)" . $mw . " \$(${type}LDFLAGS) -o \$@ " . + $objstr . " $libstr", 69), "\n\n"; + } + foreach $d (&deps("X.o", undef, $dirpfx, "/", "gtk")) { + print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})), + "\n"; + print &splitline("\t\$(CC) \$(COMPAT) \$(XFLAGS) \$(CFLAGS) -c $d->{deps}->[0]\n"); + } + print "\n"; + print $makefile_extra{'gtk'}->{'end'}; + print "\nclean:\n". + "\trm -f *.o". (join "", map { " $_" } &progrealnames("X:U")) . "\n"; + select STDOUT; close OUT; +} + if (defined $makefiles{'mpw'}) { ##-- MPW Makefile open OUT, ">$makefiles{'mpw'}"; select OUT;