-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
99 lines (83 loc) · 2.37 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
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
PROJECT_ROOT := $(shell pwd)
DART_SRC ?= $(PROJECT_ROOT)/dart
FHE_LIB_SRC ?= $(PROJECT_ROOT)/src/backend
FLUTTER_EXAMPLE ?= $(PROJECT_ROOT)/example
# Abstraction Layer, e.g. hello_world
FHE_BUILD_DIR ?= $(PROJECT_ROOT)/build
FHE_RELEASE_DIR ?= $(PROJECT_ROOT)/dist
# Clean up all artifacts for this project
.PHONY: clean
clean:
@echo "Cleaning project..."
@rm -rf $(FHE_BUILD_DIR)
@rm -rf $(FHE_RELEASE_DIR)
@echo "Cleaning dependencies..."
@cd $(FHE_LIB_SRC); $(MAKE) clean
# Retrive github submodules
.PHONY: trust-project
trust-project:
@echo "Trusting project...$(PROJECT_ROOT)"
@git config --global --add safe.directory $(PROJECT_ROOT)
@git submodule update --init --recursive
# Build helper, e.g hello_world
.PHONY: build-cmake
build-cmake: UNIT_TEST ?= ON
build-cmake: TARGET_DIR ?= $(FHE_BUILD_DIR)
build-cmake:
@echo "Building project..."
@cmake -S . -B $(TARGET_DIR) -DUNIT_TEST=$(UNIT_TEST)
@cmake --build $(TARGET_DIR)
# Install Dependencies and Build Project
.PHONY: build
build: trust-project build-cmake
# Generate html dart api docs
.PHONY: docs
docs:
@cd $(DART_SRC); $(MAKE) docs
# Publish dart package
.PHONY: publish
publish:
@cd $(DART_SRC); $(MAKE) publish
# Test Abstract Layer (AFHEL)
.PHONY: ctest
ctest:
@echo "Testing cpp..."
@cd $(FHE_BUILD_DIR); ctest
# Debug Abstract Layer (AFHEL)
.PHONY: ctest-debug
ctest-debug: build-cmake
@echo "Debugging cpp..."
@cd $(FHE_BUILD_DIR); ./seal_test
# SEAL Basics using the Abstraction Layer
.PHONY: seal-basics
seal-basics: build-cmake
@echo "SEAL basics..."
@cd $(FHE_BUILD_DIR); ./seal_basics
# Test Implementation Layer (FHE)
.PHONY: dtest
dtest:
@echo "Testing dart..."
@cd $(DART_SRC); $(MAKE) test FHEL_C_LIB_PREFIX=$(FHE_BUILD_DIR)
# Build the flutter example
.PHONY: apk
apk:
@cd $(FLUTTER_EXAMPLE); flutter build apk
# Automate testing for github workflows
.PHONY: ctest-ci
ctest-ci: build-cmake ctest
.PHONY: dtest-ci
dtest-ci: build-cmake
@git config --global --add safe.directory /tmp/flutter
@cd $(DART_SRC); $(MAKE) deps
$(MAKE) dtest
.PHONY: apk-ci
apk-ci: export ANDROID_SDK_ROOT ?= /tmp/android-sdk-linux
apk-ci: export FHEL_DISABLE_AUTO_BUILD = 1
apk-ci:
@git config --global --add safe.directory /tmp/flutter
$(MAKE) apk
# Publish dart package from github workflows
.PHONY: publish-ci
publish-ci:
@git config --global --add safe.directory /tmp/flutter
@cd $(DART_SRC); $(MAKE) publish-force