# Imakefile for building Athena Tools Library at MIT
# (in other words, use this Imakefile if you're building on Athena

# Use the config files under /source to create a Makefile

MOTIF_VERSION = M12

ATLIBDIR = `athdir /mit/atdev lib`
ATINCDIR = /mit/atdev/include
ATMANDIR = /mit/atdev/man

# Cpp define for the font metrics path.  This should be changed to the
# path to the Postscript font metrics files on your system.  Don't get
# rid of the quoted "s -- they're very important!
AFMPATH = 	\"/usr/athena/lib/ps\"

# INCLUDES = 	-I. -I/mit/motif/include -I/mit/x11/include
INCLUDES = 	-I. 
DEFINES	= 	$(INCLUDES) -D_AtDevelopment_ \
		-DAFMPATH=$(AFMPATH) -DX11R4_INTRINSICS $(PROTO)

TOP_INCLUDES =

#
# Move command
#
MV	= mv
AR	= ar cqu

HEADERS = \
	FontFamily.h\
	FontFamilyP.h\
	Text.h\
	Label.h\
	LabelP.h\
	Plotter.h\
	PlotterP.h\
	Axis.h\
	AxisP.h\
	Plot.h\
	PlotP.h\
	XYPlot.h\
	XYPlotP.h\
	Scale.h\
	TextPlot.h\
	TextPlotP.h\
	Barchart.h\
	BarchartP.h\
	XYErrorPlot.h\
	XYErrorPlotP.h\
	ContourPlot.h\
	ContourPlotP.h\
	Layout.h\
	LayoutP.h\
	Help.h\
	HelpP.h\
	dialog.h\
	MuMenu.h\
	MuMenuP.h\
	AtConverters.h\
	Parameter.h\
	ParameterP.h\
	Cli.h\
	CliP.h\
	MessageLine.h\
	MessageLineP.h\
	Help.h\
	HelpP.h\
	dialog.h

# Source files in the library.

SRCS = \
	FontFamily.c\
	FontFamilyPS.c\
	Text.c\
	TextPS.c\
	Label.c\
	Plotter.c\
	PlotterPS.c\
	Axis.c\
	AxisPS.c\
	Plot.c\
	XYPlot.c\
	Scale.c\
	TextPlot.c\
	Barchart.c\
	FBarchart.c\
	XYErrorPlot.c\
	ContourPlot.c\
	Layout.c\
	Help.c\
	dialog.c\
	MuMenu.c\
	AtConverters.c\
	Parameter.c\
	Cli.c\
	MessageLine.c\

# Object files for the library.

OBJS = \
	FontFamily.o\
	FontFamilyPS.o\
	Text.o\
	TextPS.o\
	Label.o\
	Plotter.o\
	PlotterPS.o\
	Axis.o\
	AxisPS.o\
	Plot.o\
	XYPlot.o\
	Scale.o\
	TextPlot.o\
	Barchart.o\
	FBarchart.o\
	XYErrorPlot.o\
	ContourPlot.o\
	Layout.o\
	Help.o\
	dialog.o\
	MuMenu.o\
	AtConverters.o\
	Parameter.o\
	Cli.o\
	MessageLine.o

MANS	= \
	AtAxis.3X\
	AtBarchart.3X\
	AtCli.3X\
	AtContourPlot.3X\
	AtDialog.3X\
	AtFontFamily.3X\
	AtHelp.3X\
	AtLabel.3X\
	AtLayout.3X\
	AtMessageLine.3X\
	AtParameter.3X\
	AtPlot.3X\
	AtPlotter.3X\
	AtText.3X\
	AtTextPlot.3X\
	AtXYErrorPlot.3X\
	AtXYPlot.3X

#
# Add debugging library target
#
all::
	if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi

.c.o:
	$(RM) $@ debugger/$@
	$(CC) -g -c $(CFLAGS) $*.c
	$(MV) $*.o debugger/$*.o
	$(CC) -c $(CFLAGS) $*.c

clean::
	-@if [ -d debugger ]; then echo "       $(RM) debugger/?*.o"; \
	$(RM) debugger/?*.o; else exit 0; fi

all:: libAt_d.a

libAt_d.a:  $(OBJS)
	$(RM) $@
	cd debugger; $(AR) $@  $(OBJS) && $(MV) $@ ..
	$(RANLIB) $@

install:: libAt_d.a
	$(INSTALL) -m 0644 libAt_d.a  $(ATLIBDIR)
	$(RANLIB) $(RANLIBINSTFLAGS)  $(ATLIBDIR)/libAt_d.a

AnsiCC()

.SUFFIXES:  .man .3X
.man.3X:
	tbl $*.man > $*.3X

SimpleLibrary(At,${OBJS},${ATLIBDIR})

install.man::
install.man::
	(cd $(ATMANDIR)/man3; $(RM) *.3X)
	-(cp ${MANS} ${ATMANDIR})

install.man::
	/usr/etc/catman -M $(ATMANDIR) 3

install.header::
	-(cd $(ATINCDIR)/At; $(RM) *.h)

install.header::
	-(cp ${HEADERS} ${ATINCDIR}/At)

