-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (35 loc) · 1.17 KB
/
Makefile
File metadata and controls
47 lines (35 loc) · 1.17 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
# Makefile for Flight_Sim
# Deactivate implicit rules
.SUFFIXES:
# Directories
SRC_DIR = src
COM_DIR = common
BIN_DIR = bin
# List common files (ordered based on dependency)
COMMON_FILES = json.f90 jsonx.f90 linalg.f90 micro_time.f90 database_m.f90 udp_windows_m.f90 connection_m.f90
COMMON_PATHS = $(addprefix $(COM_DIR)/, $(COMMON_FILES))
# List source files (ordered based on dependency)
SRC_FILES = goates.f90 atmosphere.f90 propulsion.f90 aircraft.f90 sim.f90
SRC_PATHS = $(addprefix $(SRC_DIR)/, $(SRC_FILES))
# Main
MAIN_PATH = src/main.f90
# Compiler
COMPILER = gfortran
# Flags
DEBUG_FLAGS = -fbounds-check -fbacktrace -g
OMP_FLAG = -fopenmp
FLAGS = -O2 -fdefault-real-8
# Program name
PROGRAM = sim.exe
# Default make
default:
$(COMPILER) $(FLAGS) $(COMMON_PATHS) $(SRC_PATHS) $(MAIN_PATH) -o $(PROGRAM) -lws2_32
# Debug option
debug:
$(COMPILER) $(FLAGS) $(OMP_FLAG) $(DEBUG_FLAGS) -o $(PROGRAM) $(COMMON_PATHS) $(SRC_PATHS) $(MAIN_PATH)
# Debug with all warnings
wall:
$(COMPILER) $(FLAGS) $(OMP_FLAG) $(DEBUG_FLAGS) -Wall -fcheck=all -o $(PROGRAM) $(COMMON_PATHS) $(SRC_PATHS) $(MAIN_PATH)
# Cleanup
clean:
rm -rf *.mod *.o *.dll *.exe $(SRC_DIR)/*.mod $(COM_DIR)/*.mod