if ($_[0] eq "!specialobj" and &mfval($_[1])) { $specialobj{$_[1]}->{$_[2]} = 1; next;}
if ($_[0] eq "!begin") {
if (&mfval($_[1])) {
- $divert = \$makefile_extra{$_[1]};
+ $sect = $_[2] ? $_[2] : "end";
+ $divert = \($makefile_extra{$_[1]}->{$sect});
} else {
$divert = \$dummy;
}
next;
}
- # If we're gathering help text, keep doing so.
+ # If we're gathering help/verbatim text, keep doing so.
if (defined $divert) { ${$divert} .= "$_\n"; next; }
# Ignore blank lines.
next if scalar @_ == 0;
# added back on to @scanlist to be scanned in turn (if not already
# done).
#
-# Resource scripts (.rc) can also include a file by means of a line
-# ending `ICON "filename"'. Files included by this method are not
-# added to @scanlist because they can never include further files.
+# Resource scripts (.rc) can also include a file by means of:
+# - a line # ending `ICON "filename"';
+# - a line ending `RT_MANIFEST "filename"'.
+# Files included by this method are not added to @scanlist because
+# they can never include further files.
#
# In this pass we write out a hash %further which maps a source
# file name into a listref containing further source file names.
push @scanlist, $1;
next;
};
- /ICON\s+\"([^\"]+)\"\s*$/ and do {
- push @{$further{$file}}, $1;
+ /(RT_MANIFEST|ICON)\s+\"([^\"]+)\"\s*$/ and do {
+ push @{$further{$file}}, $2;
next;
}
}
# 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";
"\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".
".SUFFIXES:\n".
"\n";
}
}
print "\n";
- print $makefile_extra{'cygwin'};
+ print $makefile_extra{'cygwin'}->{'end'};
print "\nclean:\n".
"\trm -f *.o *.exe *.res.o *.map\n".
"\n";
"BCB = \$(MAKEDIR)\\..\n".
"!endif\n".
"\n".
+ $makefile_extra{'borland'}->{'vars'} .
+ "\n".
".c.obj:\n".
&splitline("\tbcc32 -w-aus -w-ccc -w-par -w-pia \$(COMPAT)".
" \$(XFLAGS) \$(CFLAGS) ".
"\n";
}
print "\n";
- print $makefile_extra{'borland'};
+ print $makefile_extra{'borland'}->{'end'};
print "\nclean:\n".
"\t-del *.obj\n".
"\t-del *.exe\n".
" /D_WINDOWS /D_WIN32_WINDOWS=0x401 /DWINVER=0x401\n".
"LFLAGS = /incremental:no /fixed\n".
"\n".
+ $makefile_extra{'vc'}->{'vars'} .
+ "\n".
"\n";
print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("G:C"));
print "\n\n";
}
}
print "\n";
- print $makefile_extra{'vc'};
+ print $makefile_extra{'vc'}->{'end'};
print "\nclean: tidy\n".
"\t-del *.exe\n\n".
"tidy:\n".
"mandir=\$(prefix)/man\n",
"man1dir=\$(mandir)/man1\n",
"\n".
+ $makefile_extra{'gtk'}->{'vars'} .
+ "\n".
".SUFFIXES:\n".
"\n".
"\n";
print &splitline("\t\$(CC) \$(COMPAT) \$(XFLAGS) \$(CFLAGS) -c $d->{deps}->[0]\n");
}
print "\n";
- print $makefile_extra{'gtk'};
+ print $makefile_extra{'gtk'}->{'end'};
+ print "\nclean:\n".
+ "\trm -f *.o". (join "", map { " $_" } &progrealnames("X:U")) . "\n";
+ 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;
"\n".
"\n".
"# Get include directory for resource compiler\n".
+ "\n".
+ $makefile_extra{'lcc'}->{'vars'} .
"\n";
print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("G:C"));
print "\n\n";
}
}
print "\n";
- print $makefile_extra{'lcc'};
+ print $makefile_extra{'lcc'}->{'end'};
print "\nclean:\n".
"\t-del *.obj\n".
"\t-del *.exe\n".
(join " ", map {"-I$dirpfx$_"} @srcdirs))."\n".
"MLDFLAGS = -framework Cocoa\n".
"ULDFLAGS =\n".
- &splitline("all:" . join "", map { " $_" } &progrealnames("MX:U")) .
"\n" .
- $makefile_extra{'osx'} .
+ $makefile_extra{'osx'}->{'vars'} .
+ "\n" .
+ &splitline("all:" . join "", map { " $_" } &progrealnames("MX:U")) .
"\n";
foreach $p (&prognames("MX")) {
($prog, $type) = split ",", $p;
print "\t\$(CC) -x objective-c \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) -c \$<\n";
}
}
+ print "\n".$makefile_extra{'osx'}->{'end'};
print "\nclean:\n".
- "\trm -f *.o *.dmg\n".
+ "\trm -f *.o *.dmg". (join "", map { " $_" } &progrealnames("U")) . "\n";
"\trm -rf *.app\n";
select STDOUT; close OUT;
}