-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (46 loc) · 1.08 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
### create directories
DIRECTORY = obj plots data mod
MKDIRP = mkdir -p
SRCDIR = ./src/
OBJDIR = ./obj/
MODDIR = ./mod/
### suffix rule
.SUFFIXES:
.SUFFIXES: .f90 .o
### compiler
F90 = f95
COMMONFLAGS = -O4
COMPFLAGS = -c $(COMMONFLAGS)
LINKFLAGS = $(COMMONFLAGS)
### objects
OBJ = IC2DReimann.o pad_fluxes.o saver.o primitives.o transforms.o fluxes.o \
WENO.o WENO52d.o main.o viscous_fluxes.o set_boundary.o \
compute_residual.o
OBJS = $(addprefix $(OBJDIR), $(OBJ))
### compile and link
all: $(DIRECTORY) output
### Create the obj directory
$(DIRECTORY):
$(MKDIRP) $@
### Creating the obj files
$(addprefix ./obj/, %.o): $(addprefix ./src/, %.f90)
$(F90) $(COMPFLAGS) $< -o $@ -J$(MODDIR)
# $< refers to file calling the statement, $@ refers to the file being created
### Linking and creating executable file
output: $(OBJS)
$(F90) -o $@ $(LINKFLAGS) $(OBJS)
clean:
rm -f *.o
rm -f output
rm -rf obj mod
rm -rf *.mod
cleanall:
rm -rf data
rm -rf plots
rm -f *.o
rm -f output
rm -rf obj mod
rm -rf *.mod
cleandat:
rm -rf data/*
rm -rf plots/*