-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (29 loc) · 677 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (29 loc) · 677 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
# Detect number of threads to build with.
ifndef CPU_COUNT
NUM_THREADS = 1
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
NUM_THREADS = $(shell nproc || 1)
endif
ifeq ($(UNAME_S),Darwin)
NUM_THREADS = $(shell sysctl -n hw.physicalcpu)
endif
ifeq ($(findstring MSYS_NT,$(UNAME_S)),MSYS_NT)
NUM_THREADS = ${NUMBER_OF_PROCESSORS}
endif
else
NUM_THREADS = $(CPU_COUNT)
endif
BUILD_CMD = python setup.py build_ext -j $(NUM_THREADS) --inplace
default:
$(BUILD_CMD)
dist:
python -m build
clean:
rm -rf build/ dist/
rm -rf cython_debug
rm -rf ngspice/ngspice.cpp
rm -rf ngspice/ngspice.*.so
rm -rf ngspice/ngspice.*.dll
realclean: clean
git clean -fX