diff options
author | Tan En De <ende.tan@linux.starfivetech.com> | 2022-10-13 04:26:23 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2022-10-23 08:17:40 +0300 |
commit | 0fee0bf826b86ceb05b04d82ddaa0d6eaf6713ba (patch) | |
tree | 85456f2466e0a56fac687754d50edf5ff1a4fe1e /Makefile | |
parent | d682a0afa1bc4d1491e1017a19a6320c90a5109c (diff) | |
download | opensbi-0fee0bf826b86ceb05b04d82ddaa0d6eaf6713ba.tar.xz |
Makefile: Add cscope support
Add cscope support so that running `make cscope` will generate/update
cscope files used for source code browsing, while running `make
distclean` will remove the cscope files.
Also add entry in .gitignore to ignore generated cscope files.
Signed-off-by: Tan En De <ende.tan@linux.starfivetech.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -623,6 +623,17 @@ install_firmwares: $(platform_build_dir)/lib/libplatsbi.a $(build_dir)/lib/libsb install_docs: $(build_dir)/docs/latex/refman.pdf $(call inst_file,$(install_root_dir)/$(install_docs_path)/refman.pdf,$(build_dir)/docs/latex/refman.pdf) +.PHONY: cscope +cscope: + $(CMD_PREFIX)find \ + "$(src_dir)/firmware" \ + "$(src_dir)/include" \ + "$(src_dir)/lib" \ + "$(platform_src_dir)" \ + -name "*.[chS]" -print > cscope.files + $(CMD_PREFIX)echo "$(KCONFIG_AUTOHEADER)" >> cscope.files + $(CMD_PREFIX)cscope -bkq -i cscope.files -f cscope.out + # Rule for "make clean" .PHONY: clean clean: @@ -652,6 +663,8 @@ ifeq ($(install_root_dir),$(install_root_dir_default)/usr) $(if $(V), @echo " RM $(install_root_dir_default)") $(CMD_PREFIX)rm -rf $(install_root_dir_default) endif + $(if $(V), @echo " RM $(src_dir)/cscope*") + $(CMD_PREFIX)rm -f $(src_dir)/cscope* .PHONY: FORCE FORCE: |