-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·37 lines (27 loc) · 1004 Bytes
/
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
MAKEFLAGS += --no-print-directory
CPUS?=$(shell getconf _NPROCESSORS_ONLN || echo 1)
BUILD_DIR = build
.PHONY: all test clean single-header
all: $(BUILD_DIR)
@cd $(BUILD_DIR) && \
cmake --build . --parallel $(CPUS)
$(BUILD_DIR):
@conan install . -of=${BUILD_DIR} -b=missing -pr=default && \
cd $(BUILD_DIR) && \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DENABLE_EXEC=ON -DOPTIMIZE_FOR_NATIVE=ON ..
test: all
@cd $(BUILD_DIR) && \
ctest --output-on-failure
package:
conan create . -u
clean:
@rm -rf $(BUILD_DIR)
single-header: single-header/knapsack.hpp
single-header/knapsack.hpp:
@python3 -m quom --include_directory include include/all.hpp fhamonic_knapsack.hpp.tmp && \
mkdir -p single-header/fhamonic && \
echo "/*" > single-header/knapsack.hpp && \
cat LICENSE >> single-header/knapsack.hpp && \
echo "*/" >> single-header/knapsack.hpp && \
cat fhamonic_knapsack.hpp.tmp >> single-header/knapsack.hpp && \
rm fhamonic_knapsack.hpp.tmp