1 # Copyright (C) 2013-2015 Czech Technical University in Prague
4 # - Michal Sojka <sojkam1@fel.cvut.cz>
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.
13 # This makefile tries to build all RPP projects in this repository.
15 TARGETS=$(sort $(notdir $(patsubst %/,%,$(dir $(wildcard build/*/Makefile.config)))))
17 SUBDIRS = $(foreach t,$(TARGETS),build/$(t)/Debug build/$(t)/apps/helloworld build/$(t)/apps/rpp-test-suite)
19 subdir-targets = $(SUBDIRS:%=subdir-%)
21 all: $(subdir-targets)
24 @echo "Building for targets: $(TARGETS)"
26 clean: $(subdir-targets)
28 lib: # Build only the library
29 $(MAKE) -C build/tms570_hydctr/Debug
31 doc: # Build API documentation (Doxygen)
32 $(MAKE) -C rpp/doc/api/
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
43 subdir-build/%: print-targets
44 $(MAKE) -C $(@:subdir-%=%) $(MAKECMDGOALS)
47 UNCRUSTIFY_FILES = $(shell git ls-files|git check-attr --stdin uncrustify|awk -F: '/uncrustify: set$$/ {print $$1}')
48 UNCRUSTIFY_CFG = etc/uncrustify.cfg
50 $(foreach i,$(UNCRUSTIFY_FILES),git show HEAD:$i | uncrustify -c $(UNCRUSTIFY_CFG) -o $i
54 # Usage: Run 'make uncrustify' and then 'git add -p' to commit the
55 # changes you agree with.
57 git diff --quiet # Check that the tree is clean
63 $(eval $(call release_rules,rpp-lib))
64 release: $(RELEASE_BASENAME).zip
68 git --git-dir=lwip/.git archive --prefix=$@/lwip/ $(RELEASE_COMMIT) | tar xf -
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