#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 <env_variables.imake>
#include <installmanpage.imake>

#CDEBUGFLAGS = -g

SIMOBJ = main.o statecontrol.o simulate.o process.o headtail.o \
	tilutil.o simutil.o \
	freetil.o msprint.o alloccontrol.o summerge.o \
	prio.o \
	sumport.o history.o interface.o \
	heads.o filedisplay.o choose.o startprocess.o

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

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

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

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

DEFINES = -DSUMMERGE $(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
# for linking without X11
CCENVSETUP=
LDPRELIBS=

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

AllTarget(simkernel)
NormalProgramTarget(simkernel,$(OBJS),$(DEPLIBS),$(LOCALLIBS),$(SYSLIBS))
InstallProgram(simkernel, $(DESTINATION)/lib/tbsim)

clean::
	$(RM) sim.man

ARCHIVE = Imakefile $(SIMINC) \
	$(SIMOBJ:.o=.h) $(SIMOBJ:.o=.c)

#include <psf_post.imake>

