#------------------------------------------------------------------------------
# General Settings
#------------------------------------------------------------------------------

TOPDIR = ../..

include $(TOPDIR)/Makefile.defs
include $(TOPDIR)/mf/common.defs

.SUFFIXES: .c .o
.PHONY: all install clean


# Object files
OBJS = \
	services.o \
	cartesian.o \
	cnode.o \
	cube.o \
	machine.o \
	metric.o \
	node.o \
	process.o \
	region.o \
	thread.o 

# Installed header files
USER_HDRS = \
	cartesian.h \
	cnode.h \
	cube.h \
	machine.h \
	metric.h \
	node.h \
	process.h \
	region.h \
	thread.h \
	services.h


#------------------------------------------------------------------------------
# Rules
#------------------------------------------------------------------------------

all: libcubew3.a 

install: all
	$(MKDIR) -m 755 $(LIBDIR)
	$(INSTALL) -c -m 644 libcubew3.a $(LIBDIR)
	$(MKDIR) -m 755 $(INCDIR)/cubew3
	@list='$(USER_HDRS)'; for p in $$list; do \
		echo "$(INSTALL) -c -m 644 $$p $(INCDIR)/cubew3" ; \
		eval "$(INSTALL) -c -m 644 $$p $(INCDIR)/cubew3" ; \
	done

clean:
	-rm -f libcubew3.a $(OBJS)


.c.o:
	$(CCC) $(CCFLAGS) -c $<
	
libcubew3.a: $(OBJS)
	$(AR) $(ARFLAGS) $@ $?
	@echo "*** $@ built"


#------------------------------------------------------------------------------
# Dependencies
#
# Generated by:
#   gcc -MM *.c
#------------------------------------------------------------------------------

cartesian.o: cartesian.c cartesian.h machine.h node.h process.h thread.h \
  vector.h
cnode.o: cnode.c cnode.h region.h vector.h
cube.o: cube.c cube.h cartesian.h machine.h node.h process.h thread.h \
  cnode.h metric.h region.h vector.h
machine.o: machine.c machine.h node.h process.h thread.h vector.h
metric.o: metric.c metric.h vector.h
node.o: node.c node.h process.h thread.h machine.h vector.h
process.o: process.c process.h thread.h node.h vector.h
region.o: region.c region.h cnode.h vector.h
thread.o: thread.c thread.h process.h vector.h
services.o: services.c services.h
