1i\
\#       This makefile is designed for DJGPP
1i\
SRCDIR=@SRCDIR@

s/@srcdir@/$(SRCDIR)/
s/@prefix@/$(DJDIR)/
s/@exec_prefix@/$(DJDIR)/
s!@bindir@!$(prefix)/bin!
s!@libdir@!$(prefix)/lib!
s/^SHELL/#&/
s/@AR@/ar/
s/@CC@/gcc/
s/@CC_FOR_BUILD@/$(CC)/
s/@CC_FOR_TARGET@/$(CC)/
s/@INSTALL@/install/
s/@INSTALL_DATA@/$(INSTALL)/
s/@INSTALL_PROGRAM@/$(INSTALL)/
s/@RANLIB@/ranlib/
s/@CFLAGS@/-O/
s/^MAKEINFO.*=.*$/MAKEINFO = makeinfo --no-split/
s/VPATH = @srcdir@/VPATH = $(srcdir)/
s/\(.*[ 	]\)[^ 	]*move-if-change/\1update/
s/; @true//
s/@PICLIST@//
s/"\([^ ]*=[^ ]*\)"/'\1'/
s/@PICFLAG@//
/\.c\.o:/,/^[^	]/{
  s/^	$(CC).*/__&/
  /^	.*$/d
  s/^\(__\)\(	$(CC).*\)/\2/
}
/config\.status.*:/,/^$/{
  /^$/{
    i\
	touch $@
  }
  s/config\.status.*:.*$/config.status:/
  /^	.*$/d
}
/stamp-h.*:.*$/,/^$/{
  s/stamp-h.*:.*$/& config.sed/
  /^	.*$/d
  /^$/{
    i\
	redir -o config.h-new sed -f config.sed $(srcdir)/config.in
    i\
	update config.h-new config.h
    i\
	touch stamp-h
  }
}
/^	.*if.*$(PICFLAG).*$/,/^	.*fi.*$/{
  /^	.*$/d
}
/subdir_do:/,/^$/{
s/subdir_do:.*$/subdir_do: $(addsuffix .sub,$(DODIRS))/
/^	.*$/d
/^$/{
i\

i\
%.sub: Makefile
i\
	$(MAKE) -C $* $(DO) $(FLAGS_TO_PASS)
i\

}
}
s/`cat ofiles`/$(OFILES)/
s/\($(TARGETLIB): .*\)ofiles.*$/\1/

# How to generate the Makefile
#/Makefile.*: /,/^$/{
#  s!Makefile.*: .*$!Makefile: $(srcdir)/Makefile.in makedos.sed!
#  /^	.*$/d
#  /^$/{
#  i\
#	redir -o Makefile.tmp sed -f makedos.sed $(srcdir)/Makefile.in
#  i\
#	update Makefile.tmp Makefile
#}
#}

/^Makefile.*:.*$/,/^$/{
/^Make.*$/d
/^	.*$/d
}
