#$Id: Makefile 197 2011-02-15 12:49:21Z fhrouet $

## Using GNU compilers
FC   = gfortran
CC   = gcc
##Debug options
OPTF = -g -fbounds-check -fno-underscoring
FOPTL= -g
##Performance options
#OPTF = -O3 -fno-underscoring
#FOPTL= -O3
	
##Using Intel compilers
#FC   = ifort
#CC   = icc
#Debug options
#OPTF = -g -nus -check bounds -traceback
#FOPTL= -g
##Performance options
#OPTF = -O3 -nus
#FOPTL= -O3


LIBS  = libamd.a
OBJ  = amd_order.o amd_1.o amd_2.o amd_aat.o amd_global.o amd_postorder.o \
       amd_preprocess.o amd_valid.o amd_post_tree.o
RM   = rm

.SUFFIXES: .c .f .f90 .mod .o
#
all : $(LIBS)

$(LIBS): $(OBJ)
	ar -vr $@ $?
	ranlib $@ 

# compilation
%.o: %.f
	$(F90) $(OPTF) -c $<
%.o: %.f90
	$(F90) $(OPTF) -c $<
%.mod: %.f90
	$(F90)  -c $<
%.o : %.c
	$(CC) -c $<
# nettoyage
clean:
	$(RM) *.o  $(LIBS)

