# Copyright (C) 1992, Digital Equipment Corporation 
# All rights reserved.
# See the file COPYRIGHT for a full description.
#
# Last modified on Mon Oct 12 16:44:51 PDT 1992 by muller

all:: imake

imake: ../src/imake.c config
	n=`sed -n -e 's/^CPP[ \t]*=[ \t]*//p' -e 'd' < config`; \
	m=`sed -n -e 's/^CC[ \t]*=[ \t]*//p' -e 'd' < config`; \
	i=`sed -n -e 's/^IMAKEFLAGS[ \t]*=[ \t]*//p' -e 'd' < config`; \
	sed -e 's+M3_CPP+'$$n'+' ../src/imake.c > imake.c; \
	$$m $$i -o imake imake.c

all install scratch clean::
	@t=`sed -n -e 's/^TEMPLATE[ \t]*=[ \t*]//p' -e 'd' < config`; \
	  ./imake -I. -I../src -T../src/$$t -DFROM_DIR=../src \
	         -f../src/M3makefile -s.makefile.1; \
	  awk -f ../src/mklist.awk .makefile.1 > .makefile; \
	  rm -f .makefile.1; \
	  make -f .makefile $@

scratch clean::
	@rm -f imake
