#!/bin/sh # Expand 'includes' in makefiles. Usage: # catmake orig.mak > makefile awk ' /^include / { print "# INCLUDE OF", $2 while (getline x <$2 > 0) if(x !~ /^#/) print x next } {print} ' $1