]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - Makefile
din: Update documentation
[pes-rpp/rpp-lib.git] / Makefile
index 9988f1ea2484034c00400efb71bb8b636300e41f..16188fe1bcfc2684866b4672ddd5414e50c0a0a4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,32 @@
-# This makefile tries to build all RPP projects in this repository.
+# Copyright (C) 2013-2015 Czech Technical University in Prague
+#
+# Authors:
+#     - Michal Sojka <sojkam1@fel.cvut.cz>
+#
+# This document contains proprietary information belonging to Czech
+# Technical University in Prague. Passing on and copying of this
+# document, and communication of its contents is not permitted
+# without prior written authorization.
+#
+# File : Makefile
+# Abstract:
+#       This makefile tries to build all RPP projects in this repository.
 
-SUBDIRS = Debug POSIX apps/rpp-test-suite/Debug apps/rpp-test-suite/POSIX
+TARGETS=$(sort $(notdir $(patsubst %/,%,$(dir $(wildcard build/*/Makefile.config)))))
+
+SUBDIRS = $(foreach t,$(TARGETS),build/$(t)/Debug build/$(t)/apps/helloworld build/$(t)/apps/rpp-test-suite)
 
 subdir-targets = $(SUBDIRS:%=subdir-%)
 
 all: $(subdir-targets)
 
+print-targets:
+       @echo "Building for targets: $(TARGETS)"
+
 clean: $(subdir-targets)
 
 lib: # Build only the library
-       $(MAKE) -C Debug
+       $(MAKE) -C build/tms570_hydctr/Debug
 
 doc: # Build API documentation (Doxygen)
        $(MAKE) -C rpp/doc/api/
@@ -23,14 +40,14 @@ doc: # Build API documentation (Doxygen)
 # parallel.
 .NOTPARALLEL:
 
-subdir-% subdir-apps/%:
+subdir-build/%: print-targets
        $(MAKE) -C $(@:subdir-%=%) $(MAKECMDGOALS)
 
 
-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)')
-UNCRUSTIFY_CFG = $(dir $(lastword $(MAKEFILE_LIST)))/etc/uncrustify.cfg
+UNCRUSTIFY_FILES = $(shell etc/git-ls-files-attr uncrustify)
+UNCRUSTIFY_CFG = etc/uncrustify.cfg
 define UNCRUSTIFY_ALL
-$(foreach i,$(C_H_FILES),git show HEAD:$i | uncrustify -c $(UNCRUSTIFY_CFG) -o $i
+$(foreach i,$(UNCRUSTIFY_FILES),git show HEAD:$i | uncrustify -c $(UNCRUSTIFY_CFG) -o $i
 )
 endef
 
@@ -39,3 +56,18 @@ endef
 uncrustify:
        git diff --quiet # Check that the tree is clean
        $(UNCRUSTIFY_ALL)
+
+
+include common.mk
+
+$(eval $(call release_rules,rpp-lib))
+release: $(RELEASE_BASENAME).zip
+
+$(RELEASE_BASENAME)::
+# lwIP
+       git --git-dir=lwip/.git archive --prefix=$@/lwip/ $(RELEASE_COMMIT) | tar xf -
+# API doc
+       rm -rf rpp/doc/api/html
+       $(MAKE) -C rpp/doc/api
+       mkdir -p $@/rpp/doc/api/html
+       cp -rT rpp/doc/api/html $@/rpp/doc/api/html