#!/bin/sh
# $Id: catmake,v 1.2 2010/07/10 22:02:21 Arabidopsis Exp $
# 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
