xref: /plan9/sys/src/cmd/gs/src/catmake (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1#!/bin/sh
2# $Id: catmake,v 1.3 2002/02/21 22:24:51 giles Exp $
3# Expand 'includes' in makefiles.  Usage:
4#	catmake orig.mak > makefile
5
6awk '
7/^include / {
8	print "# INCLUDE OF", $2
9	while (getline x <$2 > 0)
10		if(x !~ /^#/)
11			print x
12	next
13}
14{print}
15' $1
16