feat(Makefile): adding rules to format the code with clang.
This commit is contained in:
parent
4829d28f4a
commit
54b8236625
1
.clang-format
Normal file
1
.clang-format
Normal file
@ -0,0 +1 @@
|
|||||||
|
BasedOnStyle: webkit
|
9
Makefile
9
Makefile
@ -54,6 +54,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
srcs+=$(wildcard ${src_dir}/*.c ${src_dir}/**/*.c)
|
srcs+=$(wildcard ${src_dir}/*.c ${src_dir}/**/*.c)
|
||||||
|
headers+=$(wildcard ${src_dir}/*.h ${src_dir}/**/*.h)
|
||||||
objs+=$(patsubst %.c,${build_dir}/%.o,${srcs})
|
objs+=$(patsubst %.c,${build_dir}/%.o,${srcs})
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
@ -122,6 +123,14 @@ ${build_dir}/%.o: %.c
|
|||||||
compile_flags.txt:
|
compile_flags.txt:
|
||||||
(echo "${CFLAGS} ${LDFLAGS}" | sed 's/ /\n/g') > compile_flags.txt
|
(echo "${CFLAGS} ${LDFLAGS}" | sed 's/ /\n/g') > compile_flags.txt
|
||||||
|
|
||||||
|
.PHONY: format
|
||||||
|
format:
|
||||||
|
clang-format -i ${srcs} ${headers}
|
||||||
|
|
||||||
|
.PHONY: check_format
|
||||||
|
check_format:
|
||||||
|
clang-format --dry-run --Werror ${srcs} ${headers}
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
${RM} -r build install
|
${RM} -r build install
|
||||||
|
Loading…
x
Reference in New Issue
Block a user