]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - Makefile
Remove excessive lower layer files
[pes-rpp/rpp-lib.git] / Makefile
1 # Copyright (C) 2013-2014 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 SUBDIRS = Debug POSIX apps/rpp-test-suite/Debug apps/rpp-test-suite/POSIX
16
17 subdir-targets = $(SUBDIRS:%=subdir-%)
18
19 all: $(subdir-targets)
20
21 clean: $(subdir-targets)
22
23 lib: # Build only the library
24         $(MAKE) -C Debug
25
26 doc: # Build API documentation (Doxygen)
27         $(MAKE) -C rpp/doc/api/
28
29 .PHONY: all clean lib
30
31 # Multiple submakes are invoked in the same directory - e.g.
32 # rpp-test-suite/Debug/GNUmakefile invokes Debug/GNUmakefile. We don't
33 # want these targets to be invoked twice so we forbid parallel
34 # invocation in this Makefile. Note that the submakes still run in
35 # parallel.
36 .NOTPARALLEL:
37
38 subdir-% subdir-apps/%:
39         $(MAKE) -C $(@:subdir-%=%) $(MAKECMDGOALS)
40
41
42 UNCRUSTIFY_FILES = $(shell git ls-files|git check-attr --stdin uncrustify|awk -F: '/uncrustify: set$$/ {print $$1}')
43 UNCRUSTIFY_CFG = etc/uncrustify.cfg
44 define UNCRUSTIFY_ALL
45 $(foreach i,$(UNCRUSTIFY_FILES),git show HEAD:$i | uncrustify -c $(UNCRUSTIFY_CFG) -o $i
46 )
47 endef
48
49 # Usage: Run 'make uncrustify' and then 'git add -p' to commit the
50 # changes you agree with.
51 uncrustify:
52         git diff --quiet # Check that the tree is clean
53         $(UNCRUSTIFY_ALL)
54
55
56 RELEASE_PREFIX = rpp-lib
57 include common.mk
58
59 release: $(RELEASE_BASENAME).zip
60
61 $(RELEASE_BASENAME)::
62 # lwIP
63         git --git-dir=lwip/.git archive --prefix=$@/lwip/ $(RELEASE_COMMIT) | tar xf -
64 # API doc
65         rm -rf rpp/doc/api/html
66         $(MAKE) -C rpp/doc/api
67         mkdir -p $@/rpp/doc/api/html
68         cp -rT rpp/doc/api/html $@/rpp/doc/api/html