include ../make.include
include ../make.pkgs

.NOTPARALLEL :

#--------------------------defines

CXXFLAGS = $(CXXOPT) -I../include -I$(X11INCLUDE)

DIRS	= widget frame colorbar panner magnifier vector list fitsy++ util

OBJS	= \
	widget/*.o \
	frame/*.o \
	colorbar/*.o \
	panner/*.o \
	magnifier/*.o \
	vector/*.o \
	list/*.o \
	fitsy++/*.o \
	util/*.o

LIB	= libsaotk.a

#--------------------------build

all	: $(LIB)
install	: all
	cp -f $(LIB) ../lib/.

#--------------------------items

$(LIB)	: $(DIRS)
	$(RM) $@
	$(AR) -cr $@ $(OBJS)

frame : FORCE
	cd frame; $(MAKE)

colorbar: FORCE
	cd colorbar; $(MAKE)

panner	: FORCE
	cd panner; $(MAKE)

magnifier: FORCE
	cd magnifier; $(MAKE)

widget	: FORCE
	cd widget; $(MAKE)

vector	: FORCE
	cd vector; $(MAKE)

list	: FORCE
	cd list; $(MAKE)

fitsy++	: FORCE
	cd fitsy++; $(MAKE)

util	: FORCE
	cd util; $(MAKE)

clean	: FORCE
	cd frame; $(MAKE) clean
	cd colorbar; $(MAKE) clean
	cd panner; $(MAKE) clean
	cd magnifier; $(MAKE) clean
	cd widget; $(MAKE) clean
	cd vector; $(MAKE) clean
	cd list; $(MAKE) clean
	cd fitsy++; $(MAKE) clean
	cd util; $(MAKE) clean

distclean : FORCE
	rm -f *.o *.a *.so
	cd frame; $(MAKE) distclean
	cd colorbar; $(MAKE) distclean
	cd panner; $(MAKE) distclean
	cd magnifier; $(MAKE) distclean
	cd widget; $(MAKE) distclean
	cd vector; $(MAKE) distclean
	cd list; $(MAKE) distclean
	cd fitsy++; $(MAKE) distclean
	cd util; $(MAKE) distclean

parsers	: FORCE
	cd frame; $(MAKE) parsers
	cd colorbar; $(MAKE) parsers
	cd panner; $(MAKE) parsers
	cd magnifier; $(MAKE) parsers
	cd fitsy++; $(MAKE) parsers

FORCE	:
