-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (56 loc) · 2.9 KB
/
Copy pathMakefile
File metadata and controls
72 lines (56 loc) · 2.9 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
68
69
70
71
72
# --------------------------------------------------------------------------- #
# #
# HermiteLBM: CUDA-based moment representation Lattice Boltzmann Method #
# Developed at UDESC - State University of Santa Catarina #
# Website: https://www.udesc.br #
# Github: https://github.com/Geoenergia-Lab/HermiteLBM #
# #
# --------------------------------------------------------------------------- #
# --------------------------------------------------------------------------- #
# Top-level Makefile #
# --------------------------------------------------------------------------- #
# Check if required environment variables are set
ifeq ($(HERMITELBM_BUILD_DIR),)
$(error HERMITELBM_BUILD_DIR is not set. Please run "source bashrc" in the project directory first)
endif
ifeq ($(HERMITELBM_BIN_DIR),)
$(error HERMITELBM_BIN_DIR is not set. Please run "source bashrc" in the project directory first)
endif
ifeq ($(HERMITELBM_INCLUDE_DIR),)
$(error HERMITELBM_INCLUDE_DIR is not set. Please run "source bashrc" in the project directory first)
endif
ifeq ($(HERMITELBM_CUDA_DIR),)
$(error HERMITELBM_CUDA_DIR is not set. Please run "source bashrc" in the project directory first)
endif
TOOL_SUBDIRS = applications/computeVersion applications/postProcessing/fieldConvert applications/postProcessing/fieldCalculate
GPU_SUBDIRS = applications/solvers/momentBasedD3Q19 applications/solvers/momentBasedD3Q27 applications/solvers/isothermalD3Q19 applications/solvers/isothermalD3Q27
SUBDIRS = $(TOOL_SUBDIRS) $(GPU_SUBDIRS)
.PHONY: all clean install uninstall $(SUBDIRS) directories
all: directories $(SUBDIRS)
# Create build directories
directories:
@ mkdir -p $(HERMITELBM_BUILD_DIR)
@ mkdir -p $(HERMITELBM_BIN_DIR)
@ mkdir -p $(HERMITELBM_INCLUDE_DIR)
# Compile and run computeVersion to generate hardware.info
$(HERMITELBM_INCLUDE_DIR)/hardware.info: directories
@ $(MAKE) -C applications/computeVersion install
@ computeVersion
# Compile computeVersion (tool subdirectories)
$(TOOL_SUBDIRS): directories
$(MAKE) -C $@
# Compile GPU applications only after hardware.info is generated
$(GPU_SUBDIRS): $(HERMITELBM_INCLUDE_DIR)/hardware.info
$(MAKE) -C $@
# Clean all projects
clean:
@ for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean; done
@ rm -rf $(HERMITELBM_BUILD_DIR)
# Install all projects
install: directories $(HERMITELBM_INCLUDE_DIR)/hardware.info
@ for dir in $(SUBDIRS); do $(MAKE) -C $$dir install; done
# Uninstall all projects
uninstall:
@ for dir in $(SUBDIRS); do $(MAKE) -C $$dir uninstall; done
@ rm -rf $(HERMITELBM_BIN_DIR) $(HERMITELBM_INCLUDE_DIR)
# --------------------------------------------------------------------------- #