Jesus Galan Lopez (yiyus)simpler handling of boot files in Makefrag600102316 years agoHistory
30 lines · 485 B · Text
RawDownload
#!/bin/sh echo '/* AUTOGENERATED BY mkbootinitc */ #include	"u.h"#include	"lib.h"#include	"mem.h"#include	"dat.h"#include	"fns.h" voidbootinit(void){' echo $* | awk '{	for(i = 1; i <= NF; i++){		a[i] = $i		# C var names cannot start with a digit		b[i] = ($i ~ /^[0-9]/) ? "_"$i : $i		print "	extern uchar "b[i]"code[];"		print "	extern long "b[i]"len;"	}	print ""	for(i = 1; i <= NF; i++){		print "	addbootfile(\""a[i]"\", "b[i]"code, "b[i]"len);"	}}'echo '}'