diff options
author | kmacy <kmacy@FreeBSD.org> | 2008-02-26 23:12:55 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2008-02-26 23:12:55 +0000 |
commit | 3ec0d10a5396be2a1d41df0b0e8a1515c42df778 (patch) | |
tree | b58acfb2886a496ae5a21fb2b4dde3d08e68d151 | |
parent | a7429d92be371dbaba3a8ffa4d2aa2a0f3def41a (diff) | |
download | FreeBSD-src-3ec0d10a5396be2a1d41df0b0e8a1515c42df778.zip FreeBSD-src-3ec0d10a5396be2a1d41df0b0e8a1515c42df778.tar.gz |
Parameterize for module name
-rw-r--r-- | sys/dev/cxgb/bin2h.pl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/cxgb/bin2h.pl b/sys/dev/cxgb/bin2h.pl index 01a97a3..3480bd1 100644 --- a/sys/dev/cxgb/bin2h.pl +++ b/sys/dev/cxgb/bin2h.pl @@ -12,7 +12,7 @@ unless ($success) { print "failed to open input\n"; exit 1; } -$success = open OUTPUT, ">$ARGV[1]"; +$success = open OUTPUT, ">$ARGV[1].h"; unless ($success) { print "failed to open output\n"; exit 1; @@ -64,13 +64,13 @@ my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, print OUTPUT "#define U (unsigned char)\n\n"; -print OUTPUT "static unsigned int t3fw_length = $size;\n"; -print OUTPUT "static unsigned char t3fw[$size] = {\n"; +print OUTPUT "static unsigned int $ARGV[1]_length = $size;\n"; +print OUTPUT "static unsigned char $ARGV[1]" . "[$size]" . " = {\n"; for (my $i = 0; $i < $size; $i += 4) { my $number_read = read(INPUT, $binary, 4); my ($a, $b, $c, $d) = unpack("C C C C", $binary); - $buf = sprintf("U 0x%02X, U 0x%02X, U 0x%02X, U 0x%02X, \n", $a, $b, $c, $d); + $buf = sprintf("\tU 0x%02X, U 0x%02X, U 0x%02X, U 0x%02X, \n", $a, $b, $c, $d); print OUTPUT $buf; } print OUTPUT "};\n"; |