File: makefile

package info (click to toggle)
python-pyclustering 0.10.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 11,128 kB
  • sloc: cpp: 38,888; python: 24,311; sh: 384; makefile: 105
file content (139 lines) | stat: -rwxr-xr-x 3,978 bytes parent folder | download | duplicates (2)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#
# @authors Andrei Novikov (pyclustering@yandex.ru)
# @date 2014-2020
# @copyright BSD-3-Clause
#


MAKE = make

NCORES = 1
UNAME = $(shell uname -s | tr '[:upper:]' '[:lower:]')
ifeq ($(findstring cygwin, $(UNAME)), cygwin)
	NCORES = $(shell grep -c ^processor /proc/cpuinfo)
else
	ifeq ($(UNAME), darwin)
		NCORES = $(shell sysctl -n hw.ncpu)
	else
		NCORES = $(shell grep -c ^processor /proc/cpuinfo)
	endif
endif


MKFLAG = -j$(NCORES) -f


default:
	@echo "List of targets:"
	@echo "ccore_64bit        - to build release shared pyclustering library (64-bit platform)."
	@echo "ccore_64bit_static - to build release static pyclustering library (64-bit platform)."
	@echo "ccore_64bit_clean  - to clean build files of pyclustering library (64-bit platform)."
	@echo "ccore_32bit        - to build release shared pyclustering library (32-bit platform)."
	@echo "ccore_32bit_static - to build release static pyclustering library (32-bit platform)."
	@echo "ccore_32bit_clean  - to clean build files of pyclustering library (32-bit platform)."
	@echo "ccore              - to build release shared pyclustering library using default compiler."
	@echo "ccore_clean        - to clean all build files of pyclustering library."
	@echo " "
	@echo "cppcheck           - to perform static analysis of source code."
	@echo "clang              - to perform compilation and static analysis using clang compiler."
	@echo " "
	@echo "ut                 - to build release unit-tests for pyclustering library."
	@echo "utdbg              - to build debug unit-tests for pyclustering library."
	@echo "utrun              - to run unit-tests of pyclustering library."
	@echo "utclean            - to clean build files of unit-tests of pyclustering library."
	@echo " "
	@echo "valgrind           - to build and run unit-tests for memory leak checking of pyclustering library."
	@echo "valgrind_shock     - to build and run shock scope of unit-tests for memory leak checking of pyclustering library."
	@echo " "
	@echo "clean              - to clean everything."


.PHONY: ccore_64bit
ccore_64bit:
	$(MAKE) $(MKFLAG) ccore.mk ccore PLATFORM="64-bit"


.PHONY: ccore_64bit_static
ccore_64bit_static:
	$(MAKE) $(MKFLAG) ccore.mk ccore_static PLATFORM="64-bit"


.PHONY: ccore_64bit_clean
ccore_64bit_clean:
	$(MAKE) $(MKFLAG) ccore.mk clean PLATFORM="64-bit"


.PHONY: ccore_32bit
ccore_32bit:
	$(MAKE) $(MKFLAG) ccore.mk ccore PLATFORM="32-bit"


.PHONY: ccore_32bit_static
ccore_32bit_static:
	$(MAKE) $(MKFLAG) ccore.mk ccore_static PLATFORM="32-bit"


.PHONY: ccore_32bit_clean
ccore_32bit_clean:
	$(MAKE) $(MKFLAG) ccore.mk clean PLATFORM="32-bit"


.PHONY: ccore
ccore:
	$(MAKE) $(MKFLAG) ccore.mk ccore


.PHONY: ccore_clean
ccore_clean:
	$(MAKE) $(MKFLAG) ccore.mk clean PLATFORM="64-bit"
	$(MAKE) $(MKFLAG) ccore.mk clean PLATFORM="32-bit"


.PHONY: cppcheck
cppcheck:
	$(MAKE) $(MKFLAG) ccore.mk cppcheck


.PHONY: clang
clang:
	$(MAKE) $(MKFLAG) ccore.mk ccore PLATFORM="64-bit" COMPILER="clang"


.PHONY: ut
ut:
	$(MAKE) $(MKFLAG) utcore.mk ut


.PHONY: utdbg
utdbg:
	$(MAKE) $(MKFLAG) utcore.mk ut CONFIG="debug"


.PHONY: utrun
utrun:
	cd tst/ && python3 ut-runner.py -e utcore


.PHONY: utclean
utclean:
	$(MAKE) $(MKFLAG) utcore.mk clean


.PHONE: valgrind
valgrind:
	$(MAKE) $(MKFLAG) utcore.mk ut CONFIG="valgrind"
	cd tst/ && valgrind --leak-check=full --leak-check=yes --max-threads=1000 --error-exitcode=1 ./utcore


.PHONE: valgrind_shock
valgrind_shock:
	$(MAKE) $(MKFLAG) utcore.mk ut CONFIG="valgrind" BUILD_VERSION="valgrind_shock"
	cd tst/ && valgrind --leak-check=full --leak-check=yes --max-threads=1000 --error-exitcode=1 ./utcore


.PHONY: clean
clean:
	$(MAKE) $(MKFLAG) ccore.mk clean
	$(MAKE) $(MKFLAG) ccore.mk clean PLATFORM="64-bit"
	$(MAKE) $(MKFLAG) ccore.mk clean PLATFORM="32-bit"
	$(MAKE) $(MKFLAG) utcore.mk clean