#
#  MakeFile for NLEQ_RES (part of NewtonLib)
#  Version 1.0
#  Latest Change     30th May 2006
#  Written by: Lutz Weimann
#

ARCH = $(shell uname)

#CFLAGS = -g $(DFLAGS) -DDEBUG
CFLAGS = -g $(DFLAGS)
F1FLAGS = -g $(DFLAGS)

ifeq ($(ARCH),SunOS)
CC = cc
#VECLIB = -lsunperf -lsunmath -lm -lF77 -lM77
#VECLIB = -lsunperf -lsunmath -lm
LD = $(FC)
#LDFLAGS = -Bstatic
FFLAGS = $(F1FLAGS)
endif    #ifeq ($(ARCH),SunOS)

ifeq ($(ARCH),Darwin)
#VECLIB = -framework vecLib
LD = $(FC)
FFLAGS = -qextname $(F1FLAGS)
ADDLIB = -lSystemStubs
endif    #ifeq ($(ARCH),Darwin)

ifeq ($(ARCH),Linux)
#VECLIB = -llapack -lblas
LD = $(FC)
FFLAGS = -fno-second-underscore $(F1FLAGS)
endif    #ifeq ($(ARCH),Linux)

VECLIB = lapack_and_blas.o

NLEQRESOBJS = test_nleqres.o nleq_res.o qnres.o utils.o jacobian_and_linalg.o
                 
test_nleqres: $(NLEQRESOBJS) $(VECLIB)
	$(LD) $(LDFLAGS) $(CFLAGS) $(NLEQRESOBJS) -o test_nleqres $(VECLIB) \
	$(ADDLIB)
	
clean: 
	rm -f *.o test_nleqres

*.o: nleq.h jacobian.h
