3 # macros.pl produce macros.c from standard.mac
5 # The Netwide Assembler is copyright (C) 1996 Simon Tatham and
6 # Julian Hall. All rights reserved. The software is
7 # redistributable under the licence given in the file "Licence"
8 # distributed in the NASM archive.
15 $fname = "standard.mac" unless $fname = $ARGV[0];
16 open INPUT,$fname || die "unable to open $fname\n";
17 open OUTPUT,">macros.c" || die "unable to open macros.c\n";
19 print OUTPUT "/* This file auto-generated from standard.mac by macros.pl" .
20 " - don't edit it */\n\nstatic char *stdmac[] = {\n";
25 if (m/^\s*((\s*([^"';\s]+|"[^"]*"|'[^']*'))*)\s*(;.*)?$/) {
30 print OUTPUT " \"$_\",\n";
32 if (m/__NASM_MAJOR__/) {
40 die "$fname:$line: error unterminated quote";
44 print OUTPUT " NULL\n};\n#define TASM_MACRO_COUNT $index\n"