-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
61 lines (47 loc) · 1.22 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
##
## @file makefile
## @brief MDFort makefile.
## @author Rinku Mishra <[email protected]>
##
F95 = gfortran -w
LOCAL=local
INIFLAG=-I$(LOCAL)/include -L$(LOCAL)/lib -lcfgio
C_DIR := $(shell pwd)
# Definition of the Flags
OMPFLAGS = -O -fopenmp
EXEC = mdfort
SDIR = src
ODIR = src/obj
LDIR = lib
OUTDIR = output
SRC_ = main.f95# Additional CPP files
OBJ_ = $(SRC_:.f95=.o)
SRC = $(patsubst %,$(SDIR)/%,$(SRC_))
OBJ = $(patsubst %,$(ODIR)/%,$(OBJ_))
all: $(EXEC)
$(EXEC) : $(ODIR)/main.o $(OBJ)
@echo "Linking MDFort"
@$(F95) $^ -o $@ $(INIFLAG) $(OMPFLAGS)
@echo "MDFort is built"
@mkdir -p $(OUTDIR)
$(ODIR)/%.o: $(SDIR)/%.f95
@echo "Compiling $<"
@mkdir -p $(ODIR)
@$(F95) -c $< -o $@ $(INIFLAG) $(OMPFLAGS)
subsystems:
@cd $(LDIR)/iniparser && $(MAKE)
export PATH=$(C_DIR)/$(LOCAL)/bin
export C_INCLUDE_PATH=$(C_DIR)/$(LOCAL)/include
export LIBRARY_PATH=$(C_DIR)/$(LOCAL)/lib
clean:
@echo "Cleaning compiled files"
@echo "run make veryclean to remove executables"
@rm -f *~ $(ODIR)/*.o $(SDIR)/*.o $(SDIR)/*~
@rm -rf $(OUTDIR)
veryclean: clean
@echo "Cleaning executables and iniparser"
@rm -f $(EXEC)
@cd $(LDIR)/iniparser && $(MAKE) clean > /dev/null 2>&1
run:
@echo "Running MDFort"
./mdfort