]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - Makefile
Make configuration of SPI devices target dependent
[pes-rpp/rpp-lib.git] / Makefile
index f545947a79779f714944d139cdf7bed6a725e274..62551c761948f6fbbc88653bfea78352c4aa5b7a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,32 @@
-# This makefile tries to build all RPP projects in this repository.
-
-SUBDIRS = Debug POSIX apps/rpp-test-suite/Debug apps/rpp-test-suite/POSIX
+# 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.
+
+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,7 +40,7 @@ doc: # Build API documentation (Doxygen)
 # parallel.
 .NOTPARALLEL:
 
-subdir-% subdir-apps/%:
+subdir-build/%: print-targets
        $(MAKE) -C $(@:subdir-%=%) $(MAKECMDGOALS)
 
 
@@ -41,9 +58,9 @@ uncrustify:
        $(UNCRUSTIFY_ALL)
 
 
-RELEASE_PREFIX = rpp-lib
 include common.mk
 
+$(eval $(call release_rules,rpp-lib))
 release: $(RELEASE_BASENAME).zip
 
 $(RELEASE_BASENAME)::