mkbootrules 344 B

1234567891011121314151617181920212223242526
  1. #!/bin/rc
  2. awk -v 'objtype='$objtype '
  3. /^$/{
  4. next;
  5. }
  6. /^#/{
  7. next;
  8. }
  9. collect && /^[^ \t]/{
  10. collect = 0;
  11. }
  12. collect && section ~ "bootdir"{
  13. x = $1;
  14. gsub(/[^a-zA-Z0-9_]/, "_", x);
  15. printf "%s.root.s: %s\n\t../port/mkroot %s %s\n", x, $1, $1, x;
  16. }
  17. $0 ~ /^[^ \t]/{
  18. if($0 ~ "bootdir"){
  19. section = $0;
  20. collect = 1;
  21. }
  22. next;
  23. }
  24. ' $*