# Ptolemy-style makefile for xgraph
# Version identification:
# @(#)make.template	1.4	4/14/93
# Copyright (c) 1991 The Regents of the University of California.
#                       All Rights Reserved.

# Root of Ptolemy directory
ROOT=../..
# Where we are
VPATH = ../../src/xgraph
# get configuration info
CONFIG=$(ROOT)/config-$(ARCH).mk
include $(CONFIG)

OBJS = xgraph.o xgX.o hard_devices.o dialog.o hpgl.o ps.o idraw.o xtb.o \
 st.o params.o

SRCS = $(OBJS:.o=.c)
HDRS = copyright.h general.h hard_devices.h params.h plotter.h st.h \
 xgout.h xgraph.h xtb.h

all:	makefile xgraph

xgraph:	$(OBJS)
	rm -f xgraph
	$(CC) $(X11LIBDIR) -o xgraph $(OBJS) $(LXEXT) $(LX11) -lm

OUT = $(BINDIR)/xgraph

$(OUT):	xgraph
	rm -f $(OUT)
	ln xgraph $(OUT)

install:	makefile $(OUT)

.c.o:
	$(CC) $(CFLAGS) $(X11INCL) -c $<

# "make clean" removes .o files and other cruft
clean:
		rm -f *.o core *~ *.bak *#

# "make sources" will do SCCS get on anything where SCCS file is newer.
sources:	$(SRCS) $(HDRS) make.template

depend:
		cd $(VPATH); \
		$(DEPEND) $(X11INCL) $(SRCS)|cat make.template - > makefile.n;\
		mv -f makefile.n makefile

makefile:	make.template
		cd $(VPATH); make -f make.template sources depend
		if [ ! -f makefile ]; then ln -s $(VPATH)/makefile makefile; fi
		@echo makefile remade -- you must rerun make.
		exit 1

sccsinfo:
		sccs info
xgraph.o : xgraph.c copyright.h xgout.h xgraph.h xtb.h hard_devices.h params.h 
xgX.o : xgX.c copyright.h xgout.h xgraph.h params.h bitmaps/dot.11 bitmaps/mark1.11 \
  bitmaps/mark2.11 bitmaps/mark3.11 bitmaps/mark4.11 bitmaps/mark5.11 bitmaps/mark6.11 \
  bitmaps/mark7.11 bitmaps/mark8.11 
hard_devices.o : hard_devices.c copyright.h xgout.h xgraph.h hard_devices.h \
  params.h 
dialog.o : dialog.c copyright.h xgout.h xgraph.h hard_devices.h xtb.h params.h 
hpgl.o : hpgl.c copyright.h xgout.h xgraph.h plotter.h 
ps.o : ps.c copyright.h xgout.h xgraph.h 
idraw.o : idraw.c hard_devices.h xgout.h xgraph.h 
xtb.o : xtb.c xtb.h copyright.h 
st.o : st.c copyright.h st.h xgraph.h 
params.o : params.c st.h params.h xgraph.h 
