1i\
ifeq ($(RHIDESRC),)
1i\
error You must set the environment variable RHIDESRC
1i\
endif
1i\
\#       This makefile is designed for DJGPP
1i\
SRCDIR=@SRCDIR@
1i\
programs=$(wildcard $(SRCDIR)/*.exe) $(subst .exe,,$(wildcard $(SRCDIR)/*.exe))
1i\
src_files=$(notdir $(filter-out $(programs),$(filter-out %.a,$(filter-out %.o,$(wildcard $(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/@RANLIB@/ranlib/
s/@CFLAGS@/-O/
s/VPATH = @srcdir@/VPATH = $(srcdir)/
s/\(.*[ 	]\)[^ 	]*move-if-change/\1update/
s/; @true//
s/@PICLIST@//
s/"\([^ ]*=[^ ]*\)"/'\1'/
s/@PICFLAG@//
/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.*: /,/^$/{
/^Ma.*$/d
/^	.*$/d
s!^$!include $(RHIDESRC)/common.mak!
}
s/@PACKAGE@/gettext/
s/@VERSION@/0.10.23/
s!@top_srcdir@!$(srcdir)/..!
s/@DEFS@/-DHAVE_CONFIG_H/
s/@DATADIRNAME@/data/
