Browse Source

Add 'make ncc' target, for source code analysis.

ppa-0.6.1
Corné Plooy 7 years ago
committed by Christian Decker
parent
commit
94ef0a7fbf
  1. 8
      Makefile
  2. 11
      doc/HACKING.md

8
Makefile

@ -292,6 +292,11 @@ coverage/coverage.info: check pytest
coverage: coverage/coverage.info coverage: coverage/coverage.info
genhtml coverage/coverage.info --output-directory coverage genhtml coverage/coverage.info --output-directory coverage
# We make libwallycore.la a dependency, so that it gets built normally, without ncc.
# Ncc can't handle the libwally source code (yet).
ncc: external/libwally-core/src/libwallycore.la
CC="ncc -ncgcc -ncld -ncfabs" AR=nccar LD=nccld make
# Ignore test/ directories. # Ignore test/ directories.
TAGS: FORCE TAGS: FORCE
$(RM) TAGS; find * -name test -type d -prune -o -name '*.[ch]' -print | xargs etags --append $(RM) TAGS; find * -name test -type d -prune -o -name '*.[ch]' -print | xargs etags --append
@ -360,6 +365,7 @@ clean: wire-clean
$(RM) check-bolt tools/check-bolt tools/*.o $(RM) check-bolt tools/check-bolt tools/*.o
find . -name '*gcda' -delete find . -name '*gcda' -delete
find . -name '*gcno' -delete find . -name '*gcno' -delete
find . -name '*.nccout' -delete
update-mocks/%: % update-mocks/%: %
@tools/update-mocks.sh "$*" @tools/update-mocks.sh "$*"
@ -468,7 +474,7 @@ installcheck:
@rm -rf testinstall || true @rm -rf testinstall || true
.PHONY: installdirs install-program install-data install uninstall \ .PHONY: installdirs install-program install-data install uninstall \
installcheck installcheck ncc
ccan-breakpoint.o: $(CCANDIR)/ccan/breakpoint/breakpoint.c ccan-breakpoint.o: $(CCANDIR)/ccan/breakpoint/breakpoint.c
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<

11
doc/HACKING.md

@ -185,6 +185,17 @@ valgrind installed, and build with DEVELOPER=1.
Our Travis CI instance (see `.travis.yml`) runs all these for each Our Travis CI instance (see `.travis.yml`) runs all these for each
pull request. pull request.
Source code analysis
--------------------
An updated version of the NCC source code analysis tool is available at
https://github.com/bitonic-cjp/ncc
It can be used to analyze the lightningd source code by running
`make clean && make ncc`. The output (which is built in parallel with the
binaries) is stored in .nccout files. You can browse it, for instance, with
a command like `nccnav lightningd/lightningd.nccout`.
Subtleties Subtleties
---------- ----------

Loading…
Cancel
Save