# 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","wce")) {
+ ("vc","vcproj","cygwin","borland","lcc","gtk","mpw","nestedvm","osx","wce")) {
return 1;
}
warn "$.:unknown makefile type '$type'\n";
"MAKEFILE = Makefile.vc\n".
"\n".
"# C compilation flags\n".
- "CFLAGS = /nologo /W3 /O1 /D_WINDOWS /D_WIN32_WINDOWS=0x401 /DWINVER=0x401\n".
+ "CFLAGS = /nologo /W3 /O1 /D_WINDOWS /D_WIN32_WINDOWS=0x401 /DWINVER=0x401 /I.\n".
"LFLAGS = /incremental:no /fixed\n".
"\n";
print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("G:C"));
"\n".
"# You can define this path to point at your tools if you need to\n".
"# TOOLPATH = /opt/gcc/bin\n".
- "CC = \$(TOOLPATH)cc\n".
+ "CC := \$(TOOLPATH)\$(CC)\n".
"# You can manually set this to `gtk-config' or `pkg-config gtk+-1.2'\n".
"# (depending on what works on your system) if you want to enforce\n".
"# building with GTK 1.2, or you can set it to `pkg-config gtk+-2.0'\n".
"# to 1.2 if it isn't found.\n".
"GTK_CONFIG = sh -c 'pkg-config gtk+-2.0 \$\$0 2>/dev/null || gtk-config \$\$0'\n".
"\n".
- &splitline("CFLAGS = -O2 -Wall -Werror -g " .
+ &splitline("CFLAGS := -O2 -Wall -Werror -ansi -pedantic -g " .
(join " ", map {"-I$dirpfx$_"} @srcdirs) .
- " `\$(GTK_CONFIG) --cflags`")."\n".
+ " `\$(GTK_CONFIG) --cflags` \$(CFLAGS)")."\n".
"XLDFLAGS = `\$(GTK_CONFIG) --libs`\n".
"ULDFLAGS =#\n".
"INSTALL=install\n",
select STDOUT; close OUT;
}
+if (defined $makefiles{'nestedvm'}) {
+ $mftyp = 'nestedvm';
+ $dirpfx = &dirpfx($makefiles{'nestedvm'}, "/");
+
+ ##-- NestedVM makefile
+ open OUT, ">$makefiles{'nestedvm'}"; select OUT;
+ print
+ "# Makefile for $project_name under NestedVM.\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".
+ "# This path points at the nestedvm root directory\n".
+ "NESTEDVM = /opt/nestedvm\n".
+ "# You can define this path to point at your tools if you need to\n".
+ "TOOLPATH = \$(NESTEDVM)/upstream/install/bin\n".
+ "CC = \$(TOOLPATH)/mips-unknown-elf-gcc\n".
+ "\n".
+ &splitline("CFLAGS = -O2 -Wall -Werror -DSLOW_SYSTEM -g " .
+ (join " ", map {"-I$dirpfx$_"} @srcdirs))."\n".
+ "\n";
+ print &splitline("all:" . join "", map { " $_.jar" } &progrealnames("X"));
+ print "\n\n";
+ foreach $p (&prognames("X")) {
+ ($prog, $type) = split ",", $p;
+ $objstr = &objects($p, "X.o", undef, undef);
+ $objstr =~ s/gtk\.o/nestedvm\.o/g;
+ print &splitline($prog . ".mips: " . $objstr), "\n";
+ $libstr = &objects($p, undef, undef, "-lX");
+ print &splitline("\t\$(CC)" . $mw . " \$(${type}LDFLAGS) -o \$@ " .
+ $objstr . " $libstr -lm", 69), "\n\n";
+ }
+ foreach $d (&deps("X.o", undef, $dirpfx, "/")) {
+ $oobjs = $d->{obj};
+ $ddeps= join " ", @{$d->{deps}};
+ $oobjs =~ s/gtk/nestedvm/g;
+ $ddeps =~ s/gtk/nestedvm/g;
+ print &splitline(sprintf("%s: %s", $oobjs, $ddeps)),
+ "\n";
+ $deflist = join "", map { " -D$_" } @{$d->{defs}};
+ print "\t\$(CC) \$(COMPAT) \$(FWHACK) \$(CFLAGS) \$(XFLAGS)$deflist" .
+ " -c \$< -o \$\@\n";
+ }
+ print "\n";
+ print $makefile_extra{'nestedvm'};
+ print "\nclean:\n".
+ "\trm -rf *.o *.mips *.class *.html *.jar org applet.manifest\n";
+ select STDOUT; close OUT;
+}
+
if (defined $makefiles{'osx'}) {
$mftyp = 'osx';
$dirpfx = &dirpfx($makefiles{'osx'}, "/");