Skip to content

Commit f140493

Browse files
committed
[Build] Add make format target
1 parent a08a264 commit f140493

File tree

5 files changed

+22
-1
lines changed

5 files changed

+22
-1
lines changed

LibOS/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ GLIBC_TARGET = $(addprefix $(BUILD_DIR)/,libc.so.6 ld-linux-x86-64.so.2 libpthre
1212
all: $(GLIBC_TARGET)
1313
$(MAKE) -C $(SHIM_DIR) all
1414

15+
.PHONY: format
16+
format:
17+
$(MAKE) -C $(SHIM_DIR) format
18+
1519
ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
1620

1721
.INTERMEDIATE: $(BUILD_DIR)/Build.success

LibOS/shim/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ endif
1212
$(targets):
1313
make $@ -C src
1414
make $@ -C test
15+
16+
.PHONY: format
17+
format:
18+
clang-format -i $(shell find . -path ./test/apps -prune -o \( -name '*.h' -o -name '*.c' \) -print)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SYS ?= $(shell gcc -dumpmachine)
22
export SYS
33

4-
targets = all clean
4+
targets = all clean format
55

66
.PHONY: $(targets)
77
$(targets):

Pal/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ endif
5959
test:
6060
$(MAKE) -C test test
6161

62+
.PHONY: format
63+
format:
64+
clang-format -i $(shell find . -path ./linux-kernel -prune -o \
65+
-path ./lib/crypto/mbedtls -prune -o \
66+
-path ./lib/crypto/udivmodti4.c -prune -o \
67+
-path ./src/host/Linux-SGX/sgx-driver -prune -o \
68+
-path ./src/security/Linux/bpf-helper.h -prune -o \
69+
-path ./src/security/Linux/bpf_helper.c -prune -o \
70+
\( -name '*.h' -o -name '*.c' \) -print)
71+
6272
.PHONY: pack
6373
pack:
6474
$(MAKE) -C test pack

Runtime/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ clean:
55
.PHONY: all
66
all:
77

8+
.PHONY: format
9+
format:
10+
811
.PHONY: pack
912
pack:

0 commit comments

Comments
 (0)