Files
MagicSetEditor2/tools/gen.pl
T
twanvl f7b82e3f6b Implemented auto replace, including GUI
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@631 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-08-26 19:39:23 +00:00

31 lines
487 B
Perl

# Generate a header and source file
$file = $ARGV[0];
$macro = uc $file;
$macro =~ s@/@_@g;
# read templates
open F, "../src/code_template.hpp";
$hpp = join('',<F>);
close F;
open F, "../src/code_template.cpp";
$cpp = join('',<F>);
close F;
# insert stuff
$hpp =~ s/_\r?\n/_$macro\n/g;
$cpp =~ s@<util/prec.hpp>@<$file.hpp>@g;
# write files
open F, "> ../src/$file.hpp";
print F $hpp;
close F;
open F, "> ../src/$file.cpp";
print F $cpp;
close F;