include ../../make.include

CFLAGS	= $(CCOPT) -I.
CXXFLAGS = $(CXXOPT) -I. -I.. -I../../include -I../frame -I../vector

SRC	= grf.C

CSRC	= \
	axis.c \
	channel.c \
	cmpframe.c \
	cmpmap.c \
	dsbspecframe.c \
	dssmap.c \
	err_null.c \
	error.c \
	fitschan.c \
	frame.c \
	frameset.c \
	grismmap.c \
	intramap.c \
	loader.c \
	lutmap.c \
	mapping.c \
	matrixmap.c \
	mathmap.c \
	memory.c \
	object.c \
	pcdmap.c \
	permmap.c \
	plot.c \
	pointset.c \
	polymap.c \
	proj.c \
	shiftmap.c \
	skyaxis.c \
	skyframe.c \
	slamap.c \
	specframe.c \
	specmap.c \
	sphmap.c \
	tpn.c \
	unit.c \
	unitmap.c \
	wcsmap.c \
	wcstrig.c \
	winmap.c \
	xml.c \
	xmlchan.c \
	zoommap.c

TAGS	= *.C *.c *.h

OBJS	= $(SRC:%.C=%.o)
COBJS	= $(CSRC:%.c=%.o)

all	: $(OBJS) $(COBJS)

clean	: FORCE
	rm -f core *~ *#

distclean : clean
	rm -f TAGS *.o

TAGS	: $(TAGS)
	etags $+

FORCE	:

ifndef DEPENDS
%.d: %.C
	set -e; $(CXX) -MM $(CXXFLAGS) $< \
	| sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
	[ -s $@ ] || rm -f $@

include $(SRC:.C=.d)

%.d: %.c
	set -e; $(CC) -MM $(CFLAGS) $< \
	| sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
	[ -s $@ ] || rm -f $@

include $(CSRC:.c=.d)
endif
