makefile modifications:
authorJeff Lance <j-lance1@ti.com>
Wed, 5 Feb 2014 16:27:51 +0000 (10:27 -0600)
committerJeff Lance <j-lance1@ti.com>
Wed, 5 Feb 2014 16:32:34 +0000 (10:32 -0600)
* verify target filesystem exists. If no target filesystem, then warn
the builder to run the setup.sh script to create the target filesystem.
* also moved install logic to the lower level makefiles to be consistent.

Signed-off-by: Jeff Lance <j-lance1@ti.com>
Makefile
mem_util/makefile

index b21706bcf4d3671b57b7389526cb464ed0a234bf..5ecfcc69d2badc8ecd995a82bccd9e78ddd91b23 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,19 +19,11 @@ clean:
        done
 
 install:
-       @install -d $(DESTDIR)/usr/bin
-       @if [ -e mem_util/Release/mem_util.elf ] ; then \
-               install mem_util/Release/mem_util.elf $(DESTDIR)/usr/bin/mem_util ; \
-               echo "mem_util release version installed."; \
-       else \
-               echo "mem_util release version not built - nothing to install!"; \
-       fi
+       for dir in $(DIRS); do \
+                make -C $$dir install; \
+       done
 
 install_debug:
-       @install -d $(DESTDIR)/usr/bin
-       @if [ -e mem_util/Debug/mem_util.elf ] ; then \
-               install mem_util/Debug/mem_util.elf $(DESTDIR)/usr/bin/mem_util ; \
-               echo "mem_util debug version installed."; \
-       else \
-               echo "mem_util debug version not built - nothing to install!"; \
-       fi
+       for dir in $(DIRS); do \
+                make -C $$dir install_debug; \
+       done
index d10bafa6f699da1e957642285c2ed28bc5c39083..8eba4395e411f6420de1382d00dd75517fba5acc 100644 (file)
@@ -117,3 +117,32 @@ clean:
        @rm -rf $(OBJDIR_D)
        @rm -rf $(OBJDIR_R)
 
+.PHONY: install
+install:
+       @if [ ! -d $(DESTDIR) ] ; then \
+               echo "The extracted target filesystem directory doesn't exist."; \
+               echo "Please run setup.sh"; \
+               exit 1; \
+       fi
+       @install -d $(DESTDIR)/usr/bin
+       @if [ -e Release/mem_util ] ; then \
+               install Release/mem_util $(DESTDIR)/usr/bin/mem_util ; \
+               echo "mem_util release version installed."; \
+       else \
+               echo "mem_util release version not built - nothing to install!"; \
+       fi
+
+.PHONY: install_debug
+install_debug:
+       @if [ ! -d $(DESTDIR) ] ; then \
+               echo "The extracted target filesystem directory doesn't exist."; \
+               echo "Please run setup.sh"; \
+               exit 1; \
+       fi
+       @install -d $(DESTDIR)/usr/bin
+       @if [ -e Debug/mem_util ] ; then \
+               install Debug/mem_util $(DESTDIR)/usr/bin/mem_util ; \
+               echo "mem_util debug version installed."; \
+       else \
+               echo "mem_util debug version not built - nothing to install!"; \
+       fi