shaderinclude.pl (310B)
1#!/usr/bin/env perl 2use strict; 3use warnings; 4 5my $file = shift; 6open FILE, "<", $file or die "open $file: $!"; 7my $name = $file; 8$name =~ s|.*/||; 9$name =~ s/[-.]/_/g; 10print "static GLchar ${name}_src[] =\n"; 11while (<FILE>) { 12 chomp; 13 printf " \"%s\\n\"\n", $_; 14} 15print " \"\\n\";\n"; 16close FILE;