]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - Makefile
mout: Make return value of rpp_mout_diag more consistent with other functions
[pes-rpp/rpp-lib.git] / Makefile
1 # Copyright (C) 2013-2015 Czech Technical University in Prague
2 #
3 # Authors:
4 #     - Michal Sojka <sojkam1@fel.cvut.cz>
5 #
6 # This document contains proprietary information belonging to Czech
7 # Technical University in Prague. Passing on and copying of this
8 # document, and communication of its contents is not permitted
9 # without prior written authorization.
10 #
11 # File : Makefile
12 # Abstract:
13 #        This makefile tries to build all RPP projects in this repository.
14
15 TARGETS=$(sort $(notdir $(patsubst %/,%,$(dir $(wildcard build/*/Makefile.config)))))
16
17 SUBDIRS = $(foreach t,$(TARGETS),build/$(t)/Debug build/$(t)/apps/helloworld build/$(t)/apps/rpp-test-suite)
18
19 subdir-targets = $(SUBDIRS:%=subdir-%)
20
21 all: $(subdir-targets)
22
23 print-targets:
24         @echo "Building for targets: $(TARGETS)"
25
26 clean: $(subdir-targets)
27
28 lib: # Build only the library
29         $(MAKE) -C build/tms570_hydctr/Debug
30
31 doc: # Build API documentation (Doxygen)
32         $(MAKE) -C rpp/doc/api/
33
34 .PHONY: all clean lib
35
36 # Multiple submakes are invoked in the same directory - e.g.
37 # rpp-test-suite/Debug/GNUmakefile invokes Debug/GNUmakefile. We don't
38 # want these targets to be invoked twice so we forbid parallel
39 # invocation in this Makefile. Note that the submakes still run in
40 # parallel.
41 .NOTPARALLEL:
42
43 subdir-build/%: print-targets
44         $(MAKE) -C $(@:subdir-%=%) $(MAKECMDGOALS)
45
46
47 UNCRUSTIFY_FILES = $(shell etc/git-ls-files-attr uncrustify)
48 UNCRUSTIFY_CFG = etc/uncrustify.cfg
49 define UNCRUSTIFY_ALL
50 $(foreach i,$(UNCRUSTIFY_FILES),git show HEAD:$i | uncrustify -c $(UNCRUSTIFY_CFG) -o $i
51 )
52 endef
53
54 # Usage: Run 'make uncrustify' and then 'git add -p' to commit the
55 # changes you agree with.
56 uncrustify:
57         git diff --quiet # Check that the tree is clean
58         $(UNCRUSTIFY_ALL)
59
60
61 include common.mk
62
63 $(eval $(call release_rules,rpp-lib))
64 release: $(RELEASE_BASENAME).zip
65
66 $(RELEASE_BASENAME)::
67 # lwIP
68         git --git-dir=lwip/.git archive --prefix=$@/lwip/ $(RELEASE_COMMIT) | tar xf -
69 # API doc
70         rm -rf rpp/doc/api/html
71         $(MAKE) -C rpp/doc/api
72         mkdir -p $@/rpp/doc/api/html
73         cp -rT rpp/doc/api/html $@/rpp/doc/api/html