-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgcc.mak
71 lines (59 loc) · 1.77 KB
/
gcc.mak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#==============================================================================
# Makefile for fsc (GCC)
#
# Author: Scott Collis
#
# Revised: 2-20-2020
#
#==============================================================================
#
# If you have Numerical Recipes with a valid licence you can activate
# this. Of course, this commercial code is not distributed with FSC
# To use you must supply the needed routines in numrec.f and you must
# have a valid license to use that code.
#
# Note: This is completely optional as inline integration routines work
# well. This is just provided for historical reference.
#
SHELL := /bin/bash
ifdef USE_NR
DEFINES += -DUSE_NR
#NROBJ = nr_runge.o
NRLIB = -L../NR-utilities -lnr
endif
#
NAME = fsc
DEBUG =
OPT = -O2
FFLAGS = -cpp -ffixed-line-length-120 -freal-4-real-8 -fdefault-real-8 \
-fdefault-integer-8 -std=legacy $(DEFINES) $(OPT) $(DEBUG)
F90FLAGS = -cpp -freal-4-real-8 -fdefault-real-8 -fdefault-integer-8 \
$(DEFINES) $(OPT) $(DEBUG)
OFLAGS = $(OPT) $(DEBUG) -o $(NAME)
LIB = $(NRLIB)
FC = gfortran
F77 = gfortran
.SUFFIXES: .f90
OBJECTS = fsc.o $(NROBJ) bslib1.o bslib2.o util.o
ATTACH = attach.o $(NROBJ) bslib1.o bslib2.o util.o
all: fsc attach
$(NAME): $(OBJECTS)
$(FC) $(OFLAGS) $(OBJECTS) $(LIB)
attach: $(ATTACH)
$(FC) $(OPT) $(DEBUG) $(ATTACH) $(LIB) -o attach
.f90.o:
$(FC) $(F90FLAGS) -c $*.f90
.f.o:
$(F77) $(FFLAGS) -c $*.f
clean:
$(RM) *.o *.mod fsc attach
distclean:
make clean
./cleanup.sh
check:
./fsc < test.inp && \
ndiff --absolute-error 1e-8 --relative-error 1e-8 cprofile.dat cprofile.ref && \
ndiff --absolute-error 1e-8 --relative-error 1e-8 sprofile.dat sprofile.ref; \
STATUS=$$?;\
echo "ndiff existed with $$STATUS"; \
exit $$STATUS