-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
62 lines (52 loc) · 1.87 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
# Build the Fortran IV/77 programs
#
# --- constants
FORTRAN=gfortran
###### Begin fix of issue #27
###### FFLAGS=-g -O2 -Wline-truncation -Wsurprising -Werror
###### ^^^^^^^^^^^^
FFLAGS=-g -O2 -Wline-truncation -Werror
###### End fix of issue #27
BIN=.
EXEC=.
SRC=.
FDEPENDS=$(SRC)/mercury.inc $(SRC)/swift.inc
# --- Help
help:
@echo
@echo 'Supported Makefile invocations:'
@echo 'make build - Build the Fortran programs'
@echo 'make unbuild - Remove all Fortran program executables'
@echo 'make gen-in - Generate input files by copying them from samples'
@echo 'make rm-gen - Remove all files generated by the Fortran programs'
@echo 'make rm-in - Remove all input files used by the Fortran programs'
@echo 'make clean - Remove all input files, generated files, and the executables'
@echo
# --- Build Fortran programs
build: $(BIN)/close6 $(BIN)/element6 $(BIN)/mercury6
$(BIN)/close6: $(FDEPENDS) $(SRC)/close6.for
$(FORTRAN) $(FFLAGS) -o $(BIN)/close6 $(SRC)/close6.for
$(BIN)/element6: $(FDEPENDS) $(SRC)/element6.for
$(FORTRAN) $(FFLAGS) -o $(BIN)/element6 $(SRC)/element6.for
$(BIN)/mercury6: $(FDEPENDS) $(SRC)/mercury6_2.for
$(FORTRAN) $(FFLAGS) -o $(BIN)/mercury6 $(SRC)/mercury6_2.for
# --- Remove executable files
unbuild:
rm -f $(BIN)/element6 $(BIN)/close6 $(BIN)/mercury6
# --- Generate input files from samples
# --- *.in copied from corresponding *.in.sample
gen-in:
for FILE in $(EXEC)/*.sample; do \
cp $$FILE `echo $$FILE | sed 's/.sample//g'`; \
done
# --- Remove files generated by Fortran programs
rm-gen:
rm -f $(EXEC)/{ *.dmp *.clo *.out *.tmp *.aei } 2> /dev/null
# --- Remove input files to the Fortran programs
rm-in:
rm -f $(EXEC)/*.in 2> /dev/null
clean:
rm -f $(EXEC)/{ *.dmp *.clo *.out *.tmp *.aei *.in } 2> /dev/null
rm -Rf ${EXEC}/*.dSYM 2> /dev/null
rm -f $(BIN)/element6 $(BIN)/close6 $(BIN)/mercury6
# --- end ---