-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmakefile
77 lines (59 loc) · 2.01 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
#
# Build everything for LANCELOT A
#
# version for Unix systems using gfortran
# Nick Gould, August 8th, 2019, for CGT Productions.
# Basic system commands
RM=rm -f
CP=cp
MV=mv
SED=sed
CHMOD=chmod
# Temporary directory for compilation
# ( do NOT use TMP = . which would cause file overwriting)
TMP=/tmp
# Default sizing program
SIZE=large
# Default precision
PRECISION=double
# Compiler flags (machine dependent)
FORTRAN=gfortran
FFLAGS= -O3 -ffixed-form
# The installation
lancelot:
echo "FORTRAN=" $(FORTRAN)
echo " FFLAGS=" $(FFLAGS)
cd ./src ; $(MAKE) install \
PRECISION=$(PRECISION) SIZE=$(SIZE) \
FORTRAN="$(FORTRAN)" FFLAGS="$(FFLAGS)" \
RM="$(RM)" CP="$(CP)" MV="$(MV)" TMP="$(TMP)"
$(SED) "s/^set FORTRAN=.*/set FORTRAN='$(FORTRAN)'/g" \
./bin/lan_default > $(TMP)/temporary_file
$(SED) "s/^set FFLAGS=.*/set FFLAGS='$(FFLAGS)'/g" \
$(TMP)/temporary_file > ./bin/lan
$(SED) "s/^FORTRAN=.*/FORTRAN=$(FORTRAN)/g" \
./bin/compil_default > $(TMP)/temporary_file
$(SED) "s/^FFLAGS=.*/FFLAGS=$(FFLAGS)/g" \
$(TMP)/temporary_file > ./bin/compil
$(CHMOD) a+x ./bin/lan
$(RM) $(TMP)/temporary_file
# HELP!
help:
@ echo "Possible choices are:"
@ echo " - help: this information"
@ echo " - lancelot: install LANCELOT A and its SIF file decoder"
@ echo " - options (default)"
@ echo " - FORTRAN=your fortran 77 compiler (gfortran)"
@ echo " - FFLAGS=your fortran compiler flags (-O3 -ffixed-form)"
@ echo " - SIZE=small medium large huge (large)"
@ echo " - PRECISION=single double (double)"
@ echo " - RM=rm command with force (/bin/rm -f)"
@ echo " - CP=cp command (/bin/cp)"
@ echo " - MV=mv command (/bin/mv)"
@ echo " - SED=sed command (/bin/sed)"
@ echo " - CHMOD=chmod command (/bin/chmod)"
@ echo " - TMP=temporary workspace directory, not ./ (/tmp)"
# Clean up afterwards
clean:
cd ./src ; $(MAKE) clean PRECISION=$(PRECISION)
cd ./bin ; $(RM) lan compil