-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (23 loc) · 1 KB
/
Makefile
File metadata and controls
31 lines (23 loc) · 1 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
SHELL = /bin/sh
.RECIPEPREFIX = >
###################################################################################################
# One-command-build invoking CMake (meant for developers, should not be part of the distribution)
###################################################################################################
.PHONY: grid mesh test build clean
SELECTED_TARGETS := $(shell printf '%s' '$(MAKECMDGOALS)' | tr '[:lower:]' '[:upper:]')
grid mesh test: build
build:
> @cmake -S . -B build \
> -DGRID=OFF -DMESH=OFF -DTEST=OFF \
> $(foreach VARIANT,$(if $(SELECTED_TARGETS),$(SELECTED_TARGETS),GRID MESH),-D$(VARIANT)=ON) \
> -DCMAKE_INSTALL_PREFIX=${PWD} \
> -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
> -DBUILDCMD_POST=$(BUILDCMD_POST) \
> -DBUILDCMD_PRE=$(BUILDCMD_PRE) \
> -DOPTIMIZATION=$(OPTIMIZATION) \
> -DOPENMP=$(OPENMP)
> @cmake --build build --parallel --target install
clean:
> @rm -rf build
.DEFAULT:
> @echo "Error: unknown target '$@'. Valid targets: [grid, mesh, test]"; exit 2