-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (25 loc) · 736 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (25 loc) · 736 Bytes
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
# Convenience Makefile for common tasks
BUILD_DIR := build
CMAKE := cmake
CMAKE_BUILD := $(CMAKE) --build $(BUILD_DIR) -- -j
.PHONY: all configure build test run format tidy clean distclean
all: build
configure:
@mkdir -p $(BUILD_DIR)
$(CMAKE) -S . -B $(BUILD_DIR) -DHUGGINGFACE_HUB_ENABLE_TESTS=ON -DHUGGINGFACE_HUB_ENABLE_LOGGING=ON
build: configure
@$(CMAKE_BUILD)
test: build
@ctest --test-dir $(BUILD_DIR) --output-on-failure
run: build
@$(BUILD_DIR)/huggingface_hub_cli
format:
@if command -v clang-format >/dev/null 2>&1; then \
clang-format -i $(shell git ls-files '*.cpp' '*.h'); \
else \
echo "clang-format not found"; exit 1; \
fi
clean:
@rm -rf $(BUILD_DIR)/*
distclean: clean
@rm -rf $(BUILD_DIR)