]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - Makefile
Update uncrustify target in Makefile
[pes-rpp/rpp-lib.git] / Makefile
1 # This makefile tries to build all RPP projects in this repository.
2
3 SUBDIRS = Debug POSIX apps/rpp-test-suite/Debug apps/rpp-test-suite/POSIX
4
5 subdir-targets = $(SUBDIRS:%=subdir-%)
6
7 all: $(subdir-targets)
8
9 clean: $(subdir-targets)
10
11 lib: # Build only the library
12         $(MAKE) -C Debug
13
14 doc: # Build API documentation (Doxygen)
15         $(MAKE) -C rpp/doc/api/
16
17 .PHONY: all clean lib
18
19 # Multiple submakes are invoked in the same directory - e.g.
20 # rpp-test-suite/Debug/GNUmakefile invokes Debug/GNUmakefile. We don't
21 # want these targets to be invoked twice so we forbid parallel
22 # invocation in this Makefile. Note that the submakes still run in
23 # parallel.
24 .NOTPARALLEL:
25
26 subdir-% subdir-apps/%:
27         $(MAKE) -C $(@:subdir-%=%) $(MAKECMDGOALS)
28
29
30 C_H_FILES = $(shell git ls-files|grep -e '\.[ch]$$'|grep -v -E '^(os/|lwip/|rpp/include/ul/|rpp/include/sys/(ti_drv_|sys_)|rpp/src/sys/(ti_drv_|sys)|rpp/include/sys/std_nhet.h|rpp/include/sys/system.h|rpp/src/sys/phy_dp83848h.c)')
31 UNCRUSTIFY_CFG = $(dir $(lastword $(MAKEFILE_LIST)))/etc/uncrustify.cfg
32 define UNCRUSTIFY_ALL
33 $(foreach i,$(C_H_FILES),git show HEAD:$i | uncrustify -c $(UNCRUSTIFY_CFG) -o $i
34 )
35 endef
36
37 # Usage: Run 'make uncrustify' and then 'git add -p' to commit the
38 # changes you agree with.
39 uncrustify:
40         git diff --quiet # Check that the tree is clean
41         $(UNCRUSTIFY_ALL)