-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (31 loc) · 1.15 KB
/
Copy pathMakefile
File metadata and controls
39 lines (31 loc) · 1.15 KB
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
# ---------------------------------------------------------------------------
# Convenience wrapper around the CMake build.
#
# make # configure + build both shared libraries and tests
# make test # build then run the C and C++ test suites
# make run # build then launch the GTK GUI
# make clean # remove the build tree
# ---------------------------------------------------------------------------
BUILD_DIR := build
# Prefer the system python (it ships PyGObject); fall back to python3.
PYTHON ?= $(shell command -v /usr/bin/python3 || command -v python3)
.PHONY: all build test run gui clean distclean
all: build
build:
@mkdir -p $(BUILD_DIR)
@cd $(BUILD_DIR) && cmake .. -DCMAKE_BUILD_TYPE=Release >/dev/null
@cmake --build $(BUILD_DIR) -j
test: build
@echo "== running test_crypto =="
@$(BUILD_DIR)/bin/test_crypto
@echo "== running test_engine =="
@$(BUILD_DIR)/bin/test_engine
run: build gui
gui:
@echo "Launching GUI with $(PYTHON) ..."
@$(PYTHON) src/gui/main.py
clean:
@cmake --build $(BUILD_DIR) --target clean 2>/dev/null || true
@rm -f $(BUILD_DIR)/bin/* $(BUILD_DIR)/lib/*
distclean:
@rm -rf $(BUILD_DIR)