-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·63 lines (54 loc) · 1.47 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
RUN_srcs:=Integrate.f90 \
Generate_Initial_Conditions.f90 \
Dumbbell_util.f90 \
main.f90
RUN_objs=$(patsubst %.f90,%.o,$(RUN_srcs))
TEST_srcs:=Integrate.f90 \
Generate_Initial_Conditions.f90 \
Dumbbell_util.f90 \
Dumbbell_Validation_Tests.f90 \
fruit.f90
TEST_objs=$(patsubst %.f90,%.o,$(TEST_srcs))
SRC_DIR = src/
RUN_DIR = run/
TEST_DIR = tests/
FC = ifort
FFLAGS = -O3 -fopenmp
run: $(RUN_objs)
@mkdir -p $(RUN_DIR)
$(FC) -o $(RUN_DIR)main.out $(FFLAGS) $(RUN_objs)
@cp inputs/*.inp $(RUN_DIR)
test: $(TEST_objs)
@mkdir -p $(TEST_DIR)
$(FC) -o $(TEST_DIR)tests.out $(FFLAGS) $(TEST_objs)
clean:
rm *.mod *.o
#%.o : %.f90
# $(FC) -c $(FFLAGS) $< -o $@
# Dependencies of files
Dumbbell_Validation_Tests.o: \
$(SRC_DIR)Dumbbell_Validation_Tests.f90 \
Dumbbell_util.o \
fruit.o \
Generate_Initial_Conditions.o \
Integrate.o
$(FC) -c $(SRC_DIR)Dumbbell_Validation_Tests.f90 $(FFLAGS)
fruit.o: $(SRC_DIR)fruit.f90
$(FC) -c $(SRC_DIR)fruit.f90 $(FFLAGS)
Integrate.o: \
$(SRC_DIR)Integrate.f90 \
Dumbbell_util.o
$(FC) -c $(SRC_DIR)Integrate.f90 $(FFLAGS)
Generate_Initial_Conditions.o: \
$(SRC_DIR)Generate_Initial_Conditions.f90 \
Dumbbell_util.o
$(FC) -c $(SRC_DIR)Generate_Initial_Conditions.f90 $(FFLAGS)
Dumbbell_util.o: \
$(SRC_DIR)Dumbbell_util.f90
$(FC) -c $(SRC_DIR)Dumbbell_util.f90 $(FFLAGS)
main.o: \
$(SRC_DIR)main.f90 \
Dumbbell_util.o \
Generate_Initial_Conditions.o \
Integrate.o
$(FC) -c $(SRC_DIR)main.f90 $(FFLAGS)