-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (28 loc) · 1.04 KB
/
Makefile
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
device=cpu
# ?= sets a variable value only if not previously set
FELTOR_PATH ?=../feltor
#configure machine
include $(FELTOR_PATH)/config/default.mk
include $(FELTOR_PATH)/config/*.mk
include $(FELTOR_PATH)/config/devices/devices.mk
# use nlohmann/json because jsoncpp made problems
JSONLIB=-DDG_USE_JSONHPP
INCLUDE+=-I$(FELTOR_PATH)/inc/
# Here is some Makefile magic to build the targets that live in another directory
PRE=pyfeltor/dg/geo/
TARGETS= geometries polynomial solovev guenter circular flux mod toroidal utility
SUFFIX=$(shell python3-config --extension-suffix)
TARGETS_=$(addsuffix $(SUFFIX),$(TARGETS))
ALL=$(addprefix $(PRE),$(TARGETS_))
#$(info TARGETS is $(TARGETS) )
#$(info SUFFIX is $(SUFFIX) )
#$(info ALL is $(ALL) )
all: $(ALL)
# the cpp file can have different name, the so file needs the name of the python module
$(PRE)%$(SUFFIX): $(PRE)%.cpp
$(CC) $(OPT) $(CFLAGS) -shared -fPIC $$(python3 -m pybind11 --includes) $< -o $@ $(JSONLIB) $(INCLUDE) -g
install:
python3 -m pip install -e .
.PHONY: clean
clean:
rm -f $(ALL)