# $Id: GNUmakefile,v 1.2 1992/04/27 23:07:27 steve Exp $

m4s		:= aix.m4	\
		   aux.m4	\
		   common.m4	\
		   convexos.m4	\
		   domainos.m4	\
		   hpux.m4	\
		   msoft.m4	\
		   next-absoft.m4	\
		   sunos.m4	\
		   ultrix.m4	\
		   unicos.m4	\
		   vms.m4

seds		:= post.sed pre1.sed pre2.sed
sedsrcs		:= $(addsuffix .src, $(seds))
manuals		:= fortc.1
srcs		:= test.src fortc.src $(sedsrcs)

MANIFEST	:= $(m4s) $(srcs) $(manuals)
BINFILES	:= fortc
LIBSUB		:= fortc/
LIBFILES	:= $(seds) $(m4s)
GARBAGE		:= fortc $(seds)

all::		$(GARBAGE)

THIS_DIR	:= ../
include $(THIS_DIR)GNUmakemaster

define replace
  inst_libdir=$(shell $(abspath) $(inst_libdir)fortc); sed "s;__LIBDIR__;$$inst_libdir;g;s/__DEFAULT_OS__/$(os_name)/g" $<
endef

pre1.sed	\
pre2.sed	\
post.sed:	%:		%.src
	$(replace) > $@

fortc:		fortc.src
	$(replace) > $@
	chmod +x $@
