#define IHaveManPages
#include <psf_pre.imake>
#include <origreadtil.imake>
#include <psf_prototype.imake>
#include <psf_stdarg.imake>
#include <psf_standards.imake>
#include <psf_malloc.imake>
#include <psf_fopen.imake>
#include <trs.imake>
#include <prtilparts.imake>
#include <writetil.imake>
#include <parseterm.imake>
#include <env_variables.imake>
#include <installmanpage.imake>

#CDEBUGFLAGS = -g

SIMOBJ = main.o statecontrol.o simulate.o process.o headtail.o widgets.o \
	psfwid.o choosewid.o functionwid.o messagewid.o tracewid.o tinwid.o \
	specialwid.o mylist.o tilutil.o xutil.o simutil.o myrandom.o Dialog.o \
	freetil.o msprint.o alloccontrol.o summerge.o \
	tracein.o inputterm.o ownscanio.o procvar.o prio.o \
	sumport.o historywid.o history.o dialogwid.o tbinterface.o \
	heads.o

SIMINC = simoption.h patchlevel.h
TRSINC = eqm.h eqm_local.h

OBJS = $(SIMOBJ) $(PSF_INC_OBJ) $(PARSETERMOBJ)
OBJ = $(SIMOBJ)

XLIBS = -lXaw -lXmu -lXt -lXext -lX11

BITMAPS = select wait wait_mask leftdblarr rightdblarr updblarr downdblarr \
	gotomark menu12

/* DEFINES = -DVERBOSE -DDEBUG */
/* Add -DDEBUG_MEMUSE to see use of memory with process-status */

DEFINES = -DSUMMERGE -DOWNSCANIO=\"ownscanio.h\" $(PSF_INC_DEFINES) -DNEWFF \
 -DDEFPSFBINDIR=\"$(PSFBINDIR)\"

# LDLIBS is used by some systems, however LOCAL_LIBRARIES is not
# And USRLIBDIR shouldn't be messed with (if there are problems, the
# installation is wrong)
#LDLIBS= -L$(USRLIBDIR) $(XLIBS)
LOCAL_LIBRARIES = XawClientLibs

HDRS = $(OBJS:.o=.h)
SRCS = $(OBJS:.o=.c)
HDR = $(OBJ:.o=.h)
SRC = $(OBJ:.o=.c)

ComplexProgramTarget(sim)

sim.man: sim.man.tmpl
	sed -e s+@DEFPSFBINDIR@+$(PSFBINDIR)+g < sim.man.tmpl > sim.man

clean::
	$(RM) sim.man

PSFInstallManPage(trace_format,5)

ARCHIVE = Imakefile $(BITMAPS) $(SIMINC) \
	$(SIMOBJ:.o=.h) $(SIMOBJ:.o=.c) sim.man.tmpl trace_format.man

#include <psf_post.imake>

