-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtargets.mk
More file actions
45 lines (37 loc) · 1.98 KB
/
Copy pathtargets.mk
File metadata and controls
45 lines (37 loc) · 1.98 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
40
41
42
43
44
45
# Common CMake build targets for LFI benchmarks
# This file defines standard build targets for projects using CMake
#
# Required variables to be set in the including Makefile:
# TARGET_DIR - The source directory name
#
# Optional variables:
# CMAKE_FLAGS - Project-specific CMake flags (default: empty)
# CMAKE_SOURCE_DIR - CMake source directory (default: $(TARGET_DIR))
# CMAKE_INSTALL_PREFIX_LFI - LFI install prefix (default: --install-prefix $(LFI_INSTALL))
# CMAKE_INSTALL_PREFIX_STORES - LFI-stores install prefix (default: --install-prefix $(STORES_INSTALL))
# CMAKE_INSTALL_PREFIX_NATIVE - Native install prefix (default: --install-prefix $(NATIVE_INSTALL))
# Set default values if not specified
CMAKE_FLAGS ?=
CMAKE_SOURCE_DIR ?= $(TARGET_DIR)
CMAKE_INSTALL_PREFIX_LFI ?= --install-prefix $(LFI_INSTALL)
CMAKE_INSTALL_PREFIX_STORES ?= --install-prefix $(STORES_INSTALL)
CMAKE_INSTALL_PREFIX_NATIVE ?= --install-prefix $(NATIVE_INSTALL)
#---ADD NEW TARGETS HERE---
# Hyperfine benchmark targets (name:runner:build_dir)
# Common build targets
build-lfi: $(TARGET_DIR)
cmake -S $(CMAKE_SOURCE_DIR) $(CMAKE_FLAGS) -B build-lfi -DCMAKE_TOOLCHAIN_FILE=$(LFI_TOOLCHAIN) $(CMAKE_INSTALL_PREFIX_LFI) -DCMAKE_BUILD_TYPE=Release
cmake --build build-lfi -j $(JOBS)
build-lfi-stores: $(TARGET_DIR)
cmake -S $(CMAKE_SOURCE_DIR) $(CMAKE_FLAGS) -B build-lfi-stores -DCMAKE_TOOLCHAIN_FILE=$(STORES_TOOLCHAIN) $(CMAKE_INSTALL_PREFIX_STORES) -DCMAKE_BUILD_TYPE=Release
cmake --build build-lfi-stores -j $(JOBS)
build-native: $(TARGET_DIR)
cmake -S $(CMAKE_SOURCE_DIR) $(CMAKE_FLAGS) -B build-native -DCMAKE_TOOLCHAIN_FILE=$(NATIVE_TOOLCHAIN) $(CMAKE_INSTALL_PREFIX_NATIVE) -DCMAKE_BUILD_TYPE=Release
cmake --build build-native -j $(JOBS)
# Common install target
install: build-lfi build-lfi-stores build-native
cmake --install build-lfi
cmake --install build-lfi-stores
cmake --install build-native
# Standard clean pattern for build directories
.PHONY: build-lfi build-lfi-stores build-native install