-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
59 lines (43 loc) · 1.27 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
#!/bin/tcsh
# Choose compilers and options
FC = mpif90
CC = mpicc
# -fcheck=all
OPTFLAGS_COMPILE = -O3 -fallow-argument-mismatch -ffree-line-length-none -fimplicit-none -cpp
OPTFLAGS_LINK = -O3 -fallow-argument-mismatch -ffree-line-length-none -fimplicit-none
LIBS =
BUILD_DIR = ./build
$(shell mkdir -p $(BUILD_DIR))
SRC_DIR = ./src
# Define dependecies
EFILE = h3d
OBJS = $(BUILD_DIR)/param.of90 \
$(BUILD_DIR)/utils.of90\
$(BUILD_DIR)/int2char.ogcc \
$(BUILD_DIR)/func.of90 \
$(BUILD_DIR)/mesh.of90 \
$(BUILD_DIR)/injection.of90\
$(BUILD_DIR)/field.of90\
$(BUILD_DIR)/particle.of90 \
$(BUILD_DIR)/eta.of90 \
$(BUILD_DIR)/boundary.of90 \
$(BUILD_DIR)/io.of90\
$(BUILD_DIR)/restart.of90 \
$(BUILD_DIR)/diag.of90\
$(BUILD_DIR)/init.of90 \
$(BUILD_DIR)/h3d.of90
$(EFILE): $(OBJS)
@echo "linking..."
$(FC) $(OPTFLAGS_LINK) -o $(BUILD_DIR)/$(EFILE) $(OBJS) $(LIBS)
# Compile C files
$(BUILD_DIR)/%.ogcc: $(SRC_DIR)/%.c
$(CC) -o $@ -c $<
# Compile Fortran files
$(BUILD_DIR)/%.of90: $(SRC_DIR)/%.f90
$(FC) $(OPTFLAGS_COMPILE) -J$(BUILD_DIR) -o $@ -c $<
clean:
-rm $(BUILD_DIR)/*.mod
-rm $(BUILD_DIR)/*.of90
-rm $(BUILD_DIR)/*.o
-rm $(BUILD_DIR)/*.ogcc
-rm $(BUILD_DIR)/${EFILE}