-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
45 lines (35 loc) · 966 Bytes
/
makefile
File metadata and controls
45 lines (35 loc) · 966 Bytes
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
UNAME_S := $(shell uname -s 2>NUL)
ifeq ($(UNAME_S),Linux)
PYTHON := python3
else
PYTHON := python
endif
# User inputs
model ?=
base_temp ?= 318.5
CONFIG := src/configure.py
MAIN := ARTSim.py
# Detect flags (targets)
STEADY := $(findstring steady_state,$(MAKECMDGOALS))
TRANSIENT := $(findstring transient,$(MAKECMDGOALS))
# Validation
ifeq ($(STEADY)$(TRANSIENT),)
$(error ERROR: You must specify at least one of steady_state or transient)
endif
# Default target
.PHONY: run steady_state transient
run:
@echo Using Python: $(PYTHON)
@echo Model: $(model)
@echo baseTemp: $(base_temp)
@echo Steady-state simulation enabled: $(if $(STEADY),YES,NO)
@echo Transient simulation enabled: $(if $(TRANSIENT),YES,NO)
$(PYTHON) $(CONFIG) \
--model $(model) \
--base-temp $(base_temp) \
$(if $(STEADY),--steady-state,) \
$(if $(TRANSIENT),--transient,)
$(PYTHON) $(MAIN)
# Dummy phony targets for Makefile parsing
steady_state:
transient: