XCOMM Copyright 1995 INRIA -- See license conditions in file COPYRIGHT
XCOMM $Id: Imakefile,v 0.6 95/05/15 14:32:09 slavirot Exp $ 

#include "../project.config"

ULIB            = util
ULIBPATH        = ../Util

KLIB            = klone
KLIBPATH        = ../Klone

QTLIB           = qt
QTLIBPATH       = ../QThreads


EXTRA_INCLUDES	= -I. -I$(ULIBPATH) -I$(KLIBPATH) -I$(QTLIBPATH)
LOCAL_LDFLAGS	= -static
SYS_LIBRARIES	= -L. -L$(ULIBPATH) -l$(ULIB)  -L$(KLIBPATH) -l$(KLIB)\
                  -L$(QTLIBPATH) -l$(QTLIB) XtClientLibs


OBJS	        =  emath.o emattrib.o emcache.o emcomm.o emevent.o \
                   emgbox.o emgbbuild.o emgbfill.o emgbdraw.o \
                   emgroup.o emhash.o emkl.o emlink.o emrecord.o emres.o \
                   emselect.o emtp.o emtree.o emx.o Window.o

SRCS	        =  emath.c emattrib.c emcache.c emcomm.c emevent.c \
                   emgbox.c emgbbuild.c emgbfill.c emgbdraw.c \
                   emgroup.c emhash.c emkl.c emlink.c emrecord.c emres.c \
                   emselect.c emtp.c emtree.c emx.c Window.c

EXEC            = em


ComplexProgramTarget($(EXEC))

PUR_INCLUDES    = -I/usr/local/include -I/usr/include/X11R6/X11 -I/usr/include/X11R6
PUR_LIBS        = -L/usr/local/lib -L/usr/lib/X11R6

pur p: $(OBJS)
	purify $(CC) -o  $(EXEC) $(OBJS) $(CDEBUGFLAGS) $(EXTRA_INCLUDES) $(PUR_INCLUDES) $(LOCAL_LDFLAGS) $(SYS_LIBRARIES) $(PUR_LIBS)

TMPMANDIR       = ./TmpMan/
MANDIR          = ./Man/

emdoc d:
	@echo "Extract Emath Documentation..."
	@../cextractk -o $(TMPMANDIR) -k $(SRCS)

emman m: cleanman emdoc
	@echo "Building Emath Man..."
	@mkdirhier $(MANDIR)
	@for i in $(SRCS) ;\
	do \
	(echo "---- Generate Man for $$i" ;\
	c2man -o $(MANDIR) $(EXTRA_INCLUDES) $(PUR_INCLUDES) $(TMPMANDIR)$$i); \
	done
kldoc:
	@echo "Extract Emath Documentation for Klone AUTODOC..."
	@../cextractk -o $(TMPMANDIR) -d $(SRCS)


lprman:
	@echo "Printing Manuel Pages..."
	@touch allManPages.roff
	@for i in $(MANDIR)* ;\
	do \
	(echo "---- Add $$i to allManPages.roff" ;\
	cat $$i >> allManPages.roff ); \
	done
	@echo "---- Spool Man Pages..."
	@lprman allManPages.roff
	@lpq
	@rm -f allManPages.roff

cleanman cm:
	@echo "Cleaning Emath Man..."
	-@if [ -f $(MANDIR) ]; then @rm -f $(MANDIR)*.3; \
	@rmdir $(MANDIR); \
	fi
	-@if [ -f $(MANDIR) ]; then @rm -f $(TMPMANDIR)*.c; \
	@rmdir $(TMPMANDIR); \
	fi

clean:: cleanman
