-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (41 loc) · 901 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
CC = gcc
CFLAGS = -Wall -g
FORMATTER = clang-format
SRCS = $(wildcard sys/**/*.c)
HEADERS = $(wildcard sys/**/*.h) $(wildcard tools/*.h)
OBJS = $(patsubst %.c,%.o,$(SRCS))
all: $(OBJS)
.PHONY: all
%.o: %.c
$(CC) $(CFLAGS) -o $@ $<
clean:
rm -rf $(OBJS)
.PHONY: clean
cformat:
@ if [ -z "$(shell which clang-format)" ]; then \
echo "Installing clang-format which is required to run this script."; \
sudo apt update; \
sudo apt install clang-format; \
clear; \
fi
$(FORMATTER) -i $(SRCS) $(HEADERS)
docs:
./scripts/copy_content
./scripts/build_sphinx
ifdef run
@echo "Running sphinx locally..."
./scripts/run_sphinx_locally
else
@echo "To run sphinx locally use run=1 with docs."
endif
.PHONY: docs
alias:
./scripts/add_alias
./scripts/add_alias_venv
.PHONY: alias
groff:
./scripts/groff
.PHONY: groff
pre-commit:
pre-commit run --all-files
.PHONY: pre-commit