XCOMM Imakefile for widget demo programs

#ifdef LinuxArchitecture
    CC = gcc
    EXTRA_DEFINES = -g -Wall
    CDEBUGFLAGS = -m486
    LESSTIF = -L/home/rob/src/lesstif/libXm
    HDOC = ~/public_html/hdoc
#endif
#ifdef AIXArchitecture
    CC = c89
    EXTRA_DEFINES = -g
    CDEBUGFLAGS = 
    HDOC = hdoc
#endif
#ifdef AlphaArchitecture
    CC = cc -std1
#endif

MOTIF = $(LESSTIF) -lXm

MOTIFDEPS = $(DEPXMLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
MOTIFLIBS = $(MOTIF) $(XMULIB) $(XTOOLLIB) $(XLIB)
SYS_LIBRARIES = -lm
CDEBUGFLAGS = 

WIDGET = SciPlot
PROGRAMS = sciplot realtime
TARFILE = sciplot

SRCS = SciPlot.c SciPlotUtil.c xyplot.c realtime.c
HDRS = SciPlot.h SciPlotP.h SciPlotUtil.h
OBJS = $(SRCS:.c=.o)
PLOTSRCS = SciPlot.c SciPlotUtil.c xyplot.c
PLOTOBJS= $(PLOTSRCS:.c=.o)
RTSRCS = SciPlot.c SciPlotUtil.c realtime.c
RTOBJS= $(RTSRCS:.c=.o)

DOCS = SciPlot. SciPlotProg. SciPlotDemo. gpl.
HOBJS = $(DOCS:.=.html)
HSRCS = $(DOCS:.=.hdoc)

INFOFILES = ANNOUNCE CHANGES LICENSE README Makefile.noImake Imakefile data.txt

MANPAGES = $(INFOFILES) $(HOBJS) *.gif

VERSION = $(SRCS) $(HDRS) $(MANPAGES)
TARFILES = $(VERSION) $(HSRCS)

XCOMM ##########################################################################
XCOMM Definitions for generating the documentation
.SUFFIXES:	.html .hdoc
.hdoc.html:
	$(HDOC) $*.hdoc > $*.html


AllTarget(sciplot realtime)

NormalProgramTarget(sciplot,$(PLOTOBJS),$(MOTIFDEPS),$(MOTIFLIBS),$(SYS_LIBRARIES))
NormalProgramTarget(realtime,$(RTOBJS),$(MOTIFDEPS),$(MOTIFLIBS),$(SYS_LIBRARIES))

doc:	$(HOBJS) $(HDOC)
	@echo "Updated html."

version:
	-@STUFF=../$(WIDGET)-`fgrep _WIDGET_VERSION $(WIDGET).h|cut -f2`;\
	echo Making version directory $$STUFF ;\
	mkdir $$STUFF ;\
	cp $(VERSION) $$STUFF ;\
	ls -l $$STUFF

tar:
	rm -f $(TARFILE).tar $(TARFILE).tar.gz
	tar cfv $(TARFILE).tar $(TARFILES)
	gzip $(TARFILE).tar

taz:	$(SRCS)
	rm -f $(TARFILE).tar $(TARFILE).tar.gz
	tar cfv $(TARFILE).tar $(TARFILES)
	compress $(TARFILE).tar

# Dependencies:

SciPlot.o: SciPlot.c SciPlotP.h SciPlot.h
SciPlotUtil.o: SciPlotUtil.c SciPlotUtil.h
xyplot.o: xyplot.c SciPlot.h SciPlotUtil.h
realtime.o: realtime.c SciPlot.h SciPlotUtil.h
