-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
executable file
·87 lines (59 loc) · 1.78 KB
/
Makefile
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# This make file is part of the xdrf package.
#
# (C) 1995 Frans van Hoesel, hoesel@chem.rug.nl
# Define ARCH to be one the of architectures found in the conf directory.
# The names are the same as the ones used for compiling pvm, so you might
# want to use the value of PVM_ARCH.
ARCH = linux
# Set FORTRAN compiler and flags for ARCH
# if intel compilers are available use gfortran and gcc
F77 = gfortran
CC = gcc
#F77 = ifort
FFLAGS = -O3
CFLAGS = -O -D$(ARCH)
# Set C compiler and flags for ARCH
#CC = icc
# Set HASRANLIB to t if your system needs ranlib
HASRANLIB = f
# Set LIBS to libraries to link your c program with
# for SUN Solaris 2:
# LIBS = -lnsl
LIBS =
SHELL = /bin/sh
## RMCMD definition set ##
# set RM to rm -f if you want to remove the intermediate C source file
# generated for the FORTRAN interface library
#RMCMD = rm -f
# if we need to specify full paths we have to use different paths
# for linux or MacOS
# macOS
#RMCMD = /usr/bin/true
# linux
#RMCMD = /bin/true
# the definition below SHOULD work on both... hopefully!
RMCMD = true
M4 = m4
M4FILE = conf/$(ARCH).m4
LFOBS = libxdrf.o
LOBS = xdr3dfcoord.o
default: libxdrf.a ctest ftest
libxdrf.a: $(LFOBS) ftocstr.o
ar cr libxdrf.a $?
case x$(HASRANLIB) in xt ) echo ranlib; ranlib libxdrf.a ;; esac
ctest: ctest.c libxdrf.a
$(CC) -o ctest $(CFLAGS) ctest.c libxdrf.a -lm $(LIBS)
ftest: ftest.f libxdrf.a
$(F77) -o ftest $(FFLAGS) ftest.f libxdrf.a $(LIBS)
clean:
rm -f $(LFOBS) $(LOBS) ftocstr.o libxdrf.a ftest ctest
tidy:
rm -f $(LOBS) $(LFOBS)
ftocstr.o: ftocstr.c
$(CC) $(CFLAGS) -c ftocstr.c
libxdrf.o: libxdrf.m4 $(M4FILE)
$(M4) $(M4FILE) libxdrf.m4 > libxdrf.c
$(CC) $(CFLAGS) -c libxdrf.c
$(RMCMD) libxdrf.c
conf/.m4:
@echo "ERROR: you didn't set ARCH in the Makefile"