roken.awk revision 55682
155682SmarkmBEGIN {
255682Smarkm	print "#include <stdio.h>"
355682Smarkm	print "#ifdef HAVE_CONFIG_H"
455682Smarkm	print "#include <config.h>"
555682Smarkm	print "#endif"
655682Smarkm	print ""
755682Smarkm	print "int main()"
855682Smarkm	print "{"
955682Smarkm	    print "puts(\"/* This is an OS dependent, generated file */\");"
1055682Smarkm	print "puts(\"\\n\");"
1155682Smarkm	print "puts(\"#ifndef __ROKEN_H__\");"
1255682Smarkm	print "puts(\"#define __ROKEN_H__\");"
1355682Smarkm	print "puts(\"\");"
1455682Smarkm}
1555682SmarkmEND {
1655682Smarkm	print "puts(\"#endif /* __ROKEN_H__ */\");"
1755682Smarkm	print "exit(0);"
1855682Smarkm	print "}"
1955682Smarkm}
2055682Smarkm
2155682Smarkm$1 == "\#ifdef" || $1 == "\#ifndef" || $1 == "\#if" || $1 == "\#else" || $1 == "\#elif" || $1 == "\#endif" || $1 == "#ifdef" || $1 == "#ifndef" || $1 == "#if" || $1 == "#else" || $1 == "#elif" || $1 == "#endif" {
2255682Smarkm	print $0;
2355682Smarkm	next
2455682Smarkm}
2555682Smarkm
2655682Smarkm{
2755682Smarkm	s = ""
2855682Smarkm	for(i = 1; i <= length; i++){
2955682Smarkm		x = substr($0, i, 1)
3055682Smarkm		if(x == "\"" || x == "\\")
3155682Smarkm			s = s "\\";
3255682Smarkm		s = s x;
3355682Smarkm	}
3455682Smarkm	print "puts(\"" s "\");"
3555682Smarkm}
36