catmake 255 B

123456789101112131415
  1. #!/bin/sh
  2. # $Id: catmake,v 1.1 2000/03/09 08:40:40 lpd Exp $
  3. # Expand 'includes' in makefiles. Usage:
  4. # catmake orig.mak > makefile
  5. awk '
  6. /^include / {
  7. print "# INCLUDE OF", $2
  8. while (getline x <$2 > 0)
  9. if(x !~ /^#/)
  10. print x
  11. next
  12. }
  13. {print}
  14. ' $1