#
#  MakeFile for NLEQ_ERR (part of NewtonLib)
#  Version 1.0
#  Latest Change     6th June 2017
#  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 = -fno-second-underscore $(F1FLAGS)
#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

NLEQERROBJS = test_nleqerr.o nleq_err.o qnerr.o utils.o jacobian_and_linalg.o
                 
test_nleqerr: $(NLEQERROBJS) $(VECLIB)
	$(LD) $(LDFLAGS) $(CFLAGS) $(NLEQERROBJS) -o test_nleqerr $(VECLIB) \
	$(ADDLIB)
	
clean: 
	rm -f *.o test_nleqerr test_nleq_err.out test_nleq_err.dat

*.o: nleq.h jacobian.h
