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