Update Makefile
authorFranklin S Cooper Jr <fcooper@ti.com>
Wed, 5 Feb 2014 21:18:11 +0000 (15:18 -0600)
committerFranklin S Cooper Jr <fcooper@ti.com>
Wed, 5 Feb 2014 21:18:11 +0000 (15:18 -0600)
* Update Makefile to throw an error if destination directory doesn't exist.
* By default only build release version
* Rename Makefile.build to Makefile
* Have qmake generate App-Makefile as the makefile name.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Makefile [new file with mode: 0644]
Makefile.build [deleted file]
ThermostatDemo.pro

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..c5bcee1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,50 @@
+-include ../../Rules.make
+
+ENV_SETUP ?= ../../linux-devkit/environment-setup
+DESTDIR ?= 
+MATRIX_APP_DIR ?= /usr/share/matrix-gui-2.0/apps/
+
+all: release
+
+.PHONY: qmake
+qmake : ThermostatDemo.pro
+       @. ${ENV_SETUP}; \
+       qmake2 CONFIG+=release ThermostatDemo.pro
+
+qmake_debug : ThermostatDemo.pro
+       @. ${ENV_SETUP}; \
+       qmake2 CONFIG+=debug ThermostatDemo.pro
+
+debug : qmake_debug
+       @. ${ENV_SETUP}; \
+       make -f App-Makefile debug
+
+release : qmake
+       @. ${ENV_SETUP}; \
+       make -f App-Makefile release
+
+clean :
+       @. ${ENV_SETUP}; \
+       make -f App-Makefile distclean
+
+install_common:
+       @install -d ${DESTDIR}/usr/bin 
+       @install -m 0755 ThermostatDemo ${DESTDIR}/usr/bin/ThermostatDemo
+       @install -d ${DESTDIR}${MATRIX_APP_DIR}/qt_tstat
+       @cp -rf matrix-files/*  ${DESTDIR}${MATRIX_APP_DIR}/qt_tstat
+
+install: release install_common
+       @if [ ! -d $(DESTDIR) ] ; then \
+               echo "The extracted target filesystem directory doesn't exist."; \
+               echo "Please run setup.sh in the SDK's root directory and then try again."; \
+               exit 1; \
+       fi
+       @echo "tstat release version installed."
+
+install_debug: debug install_common
+       @if [ ! -d $(DESTDIR) ] ; then \
+               echo "The extracted target filesystem directory doesn't exist."; \
+               echo "Please run setup.sh in the SDK's root directory and then try again."; \
+               exit 1; \
+       fi
+       @echo "tstat debug version installed."
diff --git a/Makefile.build b/Makefile.build
deleted file mode 100644 (file)
index 18892d4..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
--include ../../Rules.make
-
-ENV_SETUP ?= ../../linux-devkit/environment-setup
-DESTDIR ?= 
-PLATFORM ?= 
-MATRIX_APP_DIR ?= /usr/share/matrix-gui-2.0/apps/
-PLATFORM_DEFINE ?= "Platform_${PLATFORM}"
-
-SOURCES = main.cpp ThermostatDemo.pro
-
-all: debug release
-
-qmake : ThermostatDemo.pro
-       @. ${ENV_SETUP}; \
-       qmake2 CONFIG+=debug_and_release QMAKE_CXXFLAGS_DEBUG+=-D${PLATFORM_DEFINE} QMAKE_CXXFLAGS_RELEASE+=-D${PLATFORM_DEFINE} ThermostatDemo.pro
-
-debug : ${SOURCES} qmake
-       @. ${ENV_SETUP}; \
-       make -f Makefile debug
-
-release : ${SOURCES} qmake
-       @. ${ENV_SETUP}; \
-       make -f Makefile release
-
-clean : ${SOURCES} qmake
-       @. ${ENV_SETUP}; \
-       make -f Makefile distclean
-
-install_common:
-       @install -d ${DESTDIR}/usr/bin 
-       @install -m 0755 ThermostatDemo ${DESTDIR}/usr/bin/ThermostatDemo
-       @install -d ${DESTDIR}${MATRIX_APP_DIR}/qt_tstat
-       @cp -rf matrix-files/*  ${DESTDIR}${MATRIX_APP_DIR}/qt_tstat
-
-install: release install_common
-       @echo "tstat release version installed."
-
-install_debug: debug install_common
-       @echo "tstat debug version installed."
index 7cf7a2351393f38ea7449bcadac52f2c3398c626..7495f2e0b8059a638458dd3f0cd29cb14bbf19a9 100644 (file)
@@ -71,3 +71,6 @@ target.path += /home/root
 INSTALLS += target
 
 OTHER_FILES +=
+
+
+MAKEFILE = App-Makefile