Repository navigation
Expand file tree
/
Copy pathmakefile
More file actions
68 lines (44 loc) · 1.33 KB
/
Copy pathmakefile
File metadata and controls
68 lines (44 loc) · 1.33 KB
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
64
65
66
67
###########################################################
## USER SPECIFIC DIRECTORIES ##
##########################################################
## CC COMPILER OPTIONS ##
# CC compiler options:
CC=/usr/bin/g++
CC_FLAGS= -O3 -std=c++17
CC_LIBS= -lstdc++fs
##########################################################
LFLAGS= -lm
##########################################################
## Project file structure ##
# Source file directory:
SRC_DIR = src
# Object file directory:
OBJ_DIR = bin
# Include header file diretory:
INC_DIR = include
##########################################################
## Make variables ##
# Target executable name:
# make samples
#EXE = compress
# run dynamics
EXE = runNVE
#EXE = runNVT
# testing
#EXE = test
# Object files:
OBJS = $(OBJ_DIR)/$(EXE).o $(OBJ_DIR)/simSoft.o $(OBJ_DIR)/FIRE.o $(OBJ_DIR)/Integrator.o
##########################################################
## Compile ##
# Link C++ compiled object files to target executable:
$(EXE) : $(OBJS)
$(CC) $(OBJS) -o $@ $(CC_LIBS)
# Compile main .cpp file to object files:
$(OBJ_DIR)/$(EXE).o : $(EXE).cpp
$(CC) $(CC_FLAGS) -c $< -o $@
# Compile C++ source files to object files:
$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp $(INC_DIR)/%.h
$(CC) $(CC_FLAGS) -c $< -o $@
# Clean objects in object directory.
clean:
rm -f $(OBJ_DIR)/*.o $(EXE)