Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

some more fixes for android + universal makefile for android + linux

  • Loading branch information...
commit 94b87c80bf47882b29c15b12db8f0a617f62804b 1 parent 0816be9
@arturoc arturoc authored
Showing with 8,768 additions and 7,015 deletions.
  1. +1 −0  .gitignore
  2. +0 −3,633 addons/.cproject
  3. +0 −73 addons/.project
  4. +3 −0  addons/ofxAndroid/src/ofxAndroidSoundStream.cpp
  5. +7 −0 addons/ofxAndroid/src/ofxAndroidUtils.h
  6. +0 −83 addons/ofxOpenCv/libs/opencv/include_android/cv.h
  7. +0 −52 addons/ofxOpenCv/libs/opencv/include_android/cv.hpp
  8. +0 −65 addons/ofxOpenCv/libs/opencv/include_android/cvaux.h
  9. +0 −51 addons/ofxOpenCv/libs/opencv/include_android/cvaux.hpp
  10. +0 −46 addons/ofxOpenCv/libs/opencv/include_android/cvwimage.h
  11. +0 −53 addons/ofxOpenCv/libs/opencv/include_android/cxcore.h
  12. +0 −52 addons/ofxOpenCv/libs/opencv/include_android/cxcore.hpp
  13. +0 −6 addons/ofxOpenCv/libs/opencv/include_android/cxmisc.h
  14. +0 −50 addons/ofxOpenCv/libs/opencv/include_android/highgui.h
  15. +0 −48 addons/ofxOpenCv/libs/opencv/include_android/ml.h
  16. BIN  addons/ofxOpenCv/libs/opencv/lib/android/libcv.a
  17. BIN  addons/ofxOpenCv/libs/opencv/lib/android/libcvaux.a
  18. BIN  addons/ofxOpenCv/libs/opencv/lib/android/libcxcore.a
  19. BIN  addons/ofxOpenCv/libs/opencv/lib/android/libopencv_lapack.a
  20. +148 −36 apps/addonsExamples/3DModelLoaderExample/makefile
  21. +148 −36 apps/addonsExamples/allAddonsExample/makefile
  22. +148 −36 apps/addonsExamples/dirListExample/makefile
  23. +148 −36 apps/addonsExamples/networkTcpClientExample/makefile
  24. +148 −36 apps/addonsExamples/networkTcpServerExample/makefile
  25. +148 −36 apps/addonsExamples/networkUdpReceiverExample/makefile
  26. +148 −36 apps/addonsExamples/networkUdpSenderExample/makefile
  27. +346 −0 apps/addonsExamples/ofxAssimpExample/makefile
  28. +346 −0 apps/addonsExamples/ofxCvHaarFinderExample/makefile
  29. +346 −0 apps/addonsExamples/ofxSynthExample/makefile
  30. +346 −0 apps/addonsExamples/ofxSynthSequencingExample/makefile
  31. +148 −36 apps/addonsExamples/opencvExample/makefile
  32. +148 −36 apps/addonsExamples/oscReceiveExample/makefile
  33. +148 −36 apps/addonsExamples/oscSenderExample/makefile
  34. +149 −29 apps/addonsExamples/threadedImageLoaderExample/makefile
  35. +148 −36 apps/addonsExamples/vectorGraphicsExample/makefile
  36. +148 −36 apps/addonsExamples/xmlSettingsExample/makefile
  37. +17 −5 apps/androidExamples/androidAudioExample/makefile
  38. +17 −5 apps/androidExamples/androidCameraExample/makefile
  39. +17 −5 apps/androidExamples/androidEmptyExample/makefile
  40. +17 −5 apps/androidExamples/androidFontExample/makefile
  41. +17 −5 apps/androidExamples/androidImageExample/makefile
  42. +17 −5 apps/androidExamples/androidOpenCVExample/makefile
  43. +17 −5 apps/androidExamples/androidTouchExample/makefile
  44. +1 −0  apps/devApps/linux/copyMakefile.sh
  45. +148 −36 apps/devApps/linux/makefile
  46. +346 −0 apps/examples/advanced3dExample/makefile
  47. +148 −36 apps/examples/advancedEventsExample/makefile
  48. +148 −36 apps/examples/audioInputExample/makefile
  49. +148 −36 apps/examples/audioOutputExample/makefile
  50. +346 −0 apps/examples/blendingExample/makefile
  51. +346 −0 apps/examples/dragDropExample/makefile
  52. +148 −36 apps/examples/easyCamExample/makefile
  53. +148 −36 apps/examples/emptyExample/makefile
  54. +148 −36 apps/examples/eventsExample/makefile
  55. +148 −36 apps/examples/firmataExample/makefile
  56. +148 −36 apps/examples/fontShapesExample/makefile
  57. +148 −36 apps/examples/fontsExample/makefile
  58. +346 −0 apps/examples/geometryShaderExample/makefile
  59. +148 −36 apps/examples/graphicsExample/makefile
  60. +148 −36 apps/examples/imageLoaderExample/makefile
  61. +148 −36 apps/examples/imageSaverExample/makefile
  62. +148 −36 apps/examples/movieGrabberExample/makefile
  63. +148 −36 apps/examples/moviePlayerExample/makefile
  64. +346 −0 apps/examples/ofBoxExample/makefile
  65. +148 −36 apps/examples/polygonExample/makefile
  66. +148 −36 apps/examples/serialExample/makefile
  67. +148 −36 apps/examples/soundPlayerExample/makefile
  68. +148 −36 apps/examples/soundPlayerFFTExample/makefile
  69. +148 −36 apps/examples/textureExample/makefile
  70. +148 −36 apps/examples/textureScreengrabExample/makefile
  71. +148 −36 apps/examples/vectorMathExample/makefile
  72. +148 −36 apps/examples/windowExample/makefile
  73. 0  libs/FreeImage/lib/android/{arm7 → armeabi-v7a}/libfreeimage.a
  74. 0  libs/FreeImage/lib/android/{ → armeabi}/libfreeimage.a
  75. 0  libs/freetype/lib/android/{arm7 → armeabi-v7a}/libfreetype.a
  76. 0  libs/freetype/lib/android/{ → armeabi}/libfreetype.a
  77. 0  libs/glu/lib/android/{arm7 → armeabi-v7a}/libGLU.a
  78. 0  libs/glu/lib/android/{ → armeabi}/libGLU.a
  79. +11 −1,368 libs/openFrameworks/.cproject
  80. +1 −2  libs/openFrameworks/graphics/ofTrueTypeFont.h
  81. +1 −1  libs/openFrameworks/sound/ofSoundStream.h
  82. +104 −87 libs/openFrameworksCompiled/project/linux/makefile
  83. +77 −21 libs/openFrameworksCompiled/project/linux64/makefile
  84. 0  libs/poco/lib/android/{arm7 → armeabi-v7a}/libPocoData.a
  85. 0  libs/poco/lib/android/{arm7 → armeabi-v7a}/libPocoFoundation.a
  86. 0  libs/poco/lib/android/{arm7 → armeabi-v7a}/libPocoNet.a
  87. 0  libs/poco/lib/android/{arm7 → armeabi-v7a}/libPocoSQLite.a
  88. 0  libs/poco/lib/android/{arm7 → armeabi-v7a}/libPocoUtil.a
  89. 0  libs/poco/lib/android/{arm7 → armeabi-v7a}/libPocoXML.a
  90. 0  libs/poco/lib/android/{arm7 → armeabi-v7a}/libPocoZip.a
  91. 0  libs/poco/lib/android/{ → armeabi}/libPocoFoundation.a
  92. 0  libs/poco/lib/android/{ → armeabi}/libPocoNet.a
  93. 0  libs/poco/lib/android/{ → armeabi}/libPocoUtil.a
  94. 0  libs/poco/lib/android/{ → armeabi}/libPocoXML.a
  95. 0  libs/poco/lib/android/{ → armeabi}/libPocoZip.a
View
1  .gitignore
@@ -66,3 +66,4 @@ apps/*/*/Release_arm7
apps/*/*/test link
apps/*/*/obj
apps/*/*/bin
+.csettings
View
3,633 addons/.cproject
0 additions, 3,633 deletions not shown
View
73 addons/.project
@@ -3,82 +3,9 @@
<name>addons</name>
<comment></comment>
<projects>
- <project>libs</project>
- <project>openFrameworks</project>
</projects>
<buildSpec>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
- <triggers>clean,full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>?name?</key>
- <value></value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.append_environment</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
- <value>all</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.buildArguments</key>
- <value></value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.buildCommand</key>
- <value>make</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.buildLocation</key>
- <value>${workspace_loc:/androidGraphicsExample/Debug}</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
- <value>clean</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.contents</key>
- <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
- <value>false</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableFullBuild</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
- <value>all</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.stopOnError</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
- <value>true</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
- <nature>org.eclipse.cdt.core.cnature</nature>
- <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
- <nature>org.eclipse.cdt.core.ccnature</nature>
- <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
</natures>
</projectDescription>
View
3  addons/ofxAndroid/src/ofxAndroidSoundStream.cpp
@@ -80,6 +80,9 @@ void ofSoundStreamStart(){
}
+void ofSoundStreamClose(){
+}
+
void ofSoundStreamListDevices(){
View
7 addons/ofxAndroid/src/ofxAndroidUtils.h
@@ -10,6 +10,7 @@
#include <jni.h>
#include "ofxAndroidApp.h"
+#include "ofSoundStream.h"
JavaVM * ofGetJavaVMPtr();
JNIEnv * ofGetJNIEnv();
@@ -30,4 +31,10 @@ void ofUnloadAllFontTextures();
void ofReloadAllFontTextures();
void ofUpdateBitmapCharacterTexture();
+
+
+//this is just to fix a problem with undefined symbols
+inline void ofFixSoundStreamInclude(){
+ ofSoundStreamClose();
+}
#endif /* OFANDROIDUTILS_H_ */
View
83 addons/ofxOpenCv/libs/opencv/include_android/cv.h
@@ -1,83 +0,0 @@
-/*M///////////////////////////////////////////////////////////////////////////////////////
-//
-// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-//
-// By downloading, copying, installing or using the software you agree to this license.
-// If you do not agree to this license, do not download, install,
-// copy or use the software.
-//
-//
-// License Agreement
-// For Open Source Computer Vision Library
-//
-// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
-// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
-// Third party copyrights are property of their respective owners.
-//
-// Redistribution and use in source and binary forms, with or without modification,
-// are permitted provided that the following conditions are met:
-//
-// * Redistribution's of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// * Redistribution's in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// * The name of the copyright holders may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// This software is provided by the copyright holders and contributors "as is" and
-// any express or implied warranties, including, but not limited to, the implied
-// warranties of merchantability and fitness for a particular purpose are disclaimed.
-// In no event shall the Intel Corporation or contributors be liable for any direct,
-// indirect, incidental, special, exemplary, or consequential damages
-// (including, but not limited to, procurement of substitute goods or services;
-// loss of use, data, or profits; or business interruption) however caused
-// and on any theory of liability, whether in contract, strict liability,
-// or tort (including negligence or otherwise) arising in any way out of
-// the use of this software, even if advised of the possibility of such damage.
-//
-//M*/
-
-#ifndef __OPENCV_OLD_CV_H__
-#define __OPENCV_OLD_CV_H__
-
-#if defined(_MSC_VER)
- #define CV_DO_PRAGMA(x) __pragma(x)
- #define __CVSTR2__(x) #x
- #define __CVSTR1__(x) __CVSTR2__(x)
- #define __CVMSVCLOC__ __FILE__ "("__CVSTR1__(__LINE__)") : "
- #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (__CVMSVCLOC__ _msg))
-#elif defined(__GNUC__)
- #define CV_DO_PRAGMA(x) _Pragma (#x)
- #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (_msg))
-#else
- #define CV_DO_PRAGMA(x)
- #define CV_MSG_PRAGMA(_msg)
-#endif
-#define CV_WARNING(x) CV_MSG_PRAGMA("Warning: " #x)
-
-//CV_WARNING("This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module")
-
-#include "opencv2/core/core_c.h"
-#include "opencv2/core/core.hpp"
-#include "opencv2/imgproc/imgproc_c.h"
-#include "opencv2/imgproc/imgproc.hpp"
-#include "opencv2/video/tracking.hpp"
-#include "opencv2/features2d/features2d.hpp"
-#include "opencv2/flann/flann.hpp"
-#include "opencv2/calib3d/calib3d.hpp"
-#include "opencv2/objdetect/objdetect.hpp"
-#include "opencv2/legacy/compat.hpp"
-
-#if !defined(CV_IMPL)
-#define CV_IMPL extern "C"
-#endif //CV_IMPL
-
-#if defined(__cplusplus)
-#include "opencv2/core/internal.hpp"
-#endif //__cplusplus
-
-#endif // __OPENCV_OLD_CV_H_
-
View
52 addons/ofxOpenCv/libs/opencv/include_android/cv.hpp
@@ -1,52 +0,0 @@
-/*M///////////////////////////////////////////////////////////////////////////////////////
-//
-// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-//
-// By downloading, copying, installing or using the software you agree to this license.
-// If you do not agree to this license, do not download, install,
-// copy or use the software.
-//
-//
-// License Agreement
-// For Open Source Computer Vision Library
-//
-// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
-// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
-// Third party copyrights are property of their respective owners.
-//
-// Redistribution and use in source and binary forms, with or without modification,
-// are permitted provided that the following conditions are met:
-//
-// * Redistribution's of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// * Redistribution's in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// * The name of the copyright holders may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// This software is provided by the copyright holders and contributors "as is" and
-// any express or implied warranties, including, but not limited to, the implied
-// warranties of merchantability and fitness for a particular purpose are disclaimed.
-// In no event shall the Intel Corporation or contributors be liable for any direct,
-// indirect, incidental, special, exemplary, or consequential damages
-// (including, but not limited to, procurement of substitute goods or services;
-// loss of use, data, or profits; or business interruption) however caused
-// and on any theory of liability, whether in contract, strict liability,
-// or tort (including negligence or otherwise) arising in any way out of
-// the use of this software, even if advised of the possibility of such damage.
-//
-//M*/
-
-#ifndef __OPENCV_OLD_CV_HPP__
-#define __OPENCV_OLD_CV_HPP__
-
-//#if defined(__GNUC__)
-//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
-//#endif
-
-#include <cv.h>
-
-#endif
View
65 addons/ofxOpenCv/libs/opencv/include_android/cvaux.h
@@ -1,65 +0,0 @@
-/*M///////////////////////////////////////////////////////////////////////////////////////
-//
-// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-//
-// By downloading, copying, installing or using the software you agree to this license.
-// If you do not agree to this license, do not download, install,
-// copy or use the software.
-//
-//
-// Intel License Agreement
-// For Open Source Computer Vision Library
-//
-// Copyright (C) 2000, Intel Corporation, all rights reserved.
-// Third party copyrights are property of their respective owners.
-//
-// Redistribution and use in source and binary forms, with or without modification,
-// are permitted provided that the following conditions are met:
-//
-// * Redistribution's of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// * Redistribution's in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// * The name of Intel Corporation may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// This software is provided by the copyright holders and contributors "as is" and
-// any express or implied warranties, including, but not limited to, the implied
-// warranties of merchantability and fitness for a particular purpose are disclaimed.
-// In no event shall the Intel Corporation or contributors be liable for any direct,
-// indirect, incidental, special, exemplary, or consequential damages
-// (including, but not limited to, procurement of substitute goods or services;
-// loss of use, data, or profits; or business interruption) however caused
-// and on any theory of liability, whether in contract, strict liability,
-// or tort (including negligence or otherwise) arising in any way out of
-// the use of this software, even if advised of the possibility of such damage.
-//
-//M*/
-
-#ifndef __OPENCV_OLD_AUX_H__
-#define __OPENCV_OLD_AUX_H__
-
-//#if defined(__GNUC__)
-//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
-//#endif
-
-#include "opencv2/core/core_c.h"
-#include "opencv2/core/core.hpp"
-#include "opencv2/imgproc/imgproc_c.h"
-#include "opencv2/imgproc/imgproc.hpp"
-#include "opencv2/video/tracking.hpp"
-#include "opencv2/video/background_segm.hpp"
-#include "opencv2/features2d/features2d.hpp"
-#include "opencv2/calib3d/calib3d.hpp"
-#include "opencv2/objdetect/objdetect.hpp"
-#include "opencv2/legacy/legacy.hpp"
-#include "opencv2/legacy/compat.hpp"
-#include "opencv2/legacy/blobtrack.hpp"
-#include "opencv2/contrib/contrib.hpp"
-
-#endif
-
-/* End of file. */
View
51 addons/ofxOpenCv/libs/opencv/include_android/cvaux.hpp
@@ -1,51 +0,0 @@
-/*M///////////////////////////////////////////////////////////////////////////////////////
-//
-// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-//
-// By downloading, copying, installing or using the software you agree to this license.
-// If you do not agree to this license, do not download, install,
-// copy or use the software.
-//
-//
-// Intel License Agreement
-// For Open Source Computer Vision Library
-//
-// Copyright (C) 2000, Intel Corporation, all rights reserved.
-// Third party copyrights are property of their respective owners.
-//
-// Redistribution and use in source and binary forms, with or without modification,
-// are permitted provided that the following conditions are met:
-//
-// * Redistribution's of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// * Redistribution's in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// * The name of Intel Corporation may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// This software is provided by the copyright holders and contributors "as is" and
-// any express or implied warranties, including, but not limited to, the implied
-// warranties of merchantability and fitness for a particular purpose are disclaimed.
-// In no event shall the Intel Corporation or contributors be liable for any direct,
-// indirect, incidental, special, exemplary, or consequential damages
-// (including, but not limited to, procurement of substitute goods or services;
-// loss of use, data, or profits; or business interruption) however caused
-// and on any theory of liability, whether in contract, strict liability,
-// or tort (including negligence or otherwise) arising in any way out of
-// the use of this software, even if advised of the possibility of such damage.
-//
-//M*/
-
-#ifndef __OPENCV_OLD_AUX_HPP__
-#define __OPENCV_OLD_AUX_HPP__
-
-//#if defined(__GNUC__)
-//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
-//#endif
-
-#include <cvaux.h>
-
-#endif
View
46 addons/ofxOpenCv/libs/opencv/include_android/cvwimage.h
@@ -1,46 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-//
-// By downloading, copying, installing or using the software you agree to
-// this license. If you do not agree to this license, do not download,
-// install, copy or use the software.
-//
-// License Agreement
-// For Open Source Computer Vision Library
-//
-// Copyright (C) 2008, Google, all rights reserved.
-// Third party copyrights are property of their respective owners.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// * Redistribution's of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// * Redistribution's in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// * The name of Intel Corporation or contributors may not be used to endorse
-// or promote products derived from this software without specific
-// prior written permission.
-//
-// This software is provided by the copyright holders and contributors "as is"
-// and any express or implied warranties, including, but not limited to, the
-// implied warranties of merchantability and fitness for a particular purpose
-// are disclaimed. In no event shall the Intel Corporation or contributors be
-// liable for any direct, indirect, incidental, special, exemplary, or
-// consequential damages
-// (including, but not limited to, procurement of substitute goods or services;
-// loss of use, data, or profits; or business interruption) however caused
-// and on any theory of liability, whether in contract, strict liability,
-// or tort (including negligence or otherwise) arising in any way out of
-// the use of this software, even if advised of the possibility of such damage.
-
-
-#ifndef __OPENCV_OLD_WIMAGE_HPP__
-#define __OPENCV_OLD_WIMAGE_HPP__
-
-#include "opencv2/core/wimage.hpp"
-
-#endif
View
53 addons/ofxOpenCv/libs/opencv/include_android/cxcore.h
@@ -1,53 +0,0 @@
-/*M///////////////////////////////////////////////////////////////////////////////////////
-//
-// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-//
-// By downloading, copying, installing or using the software you agree to this license.
-// If you do not agree to this license, do not download, install,
-// copy or use the software.
-//
-//
-// License Agreement
-// For Open Source Computer Vision Library
-//
-// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
-// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
-// Third party copyrights are property of their respective owners.
-//
-// Redistribution and use in source and binary forms, with or without modification,
-// are permitted provided that the following conditions are met:
-//
-// * Redistribution's of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// * Redistribution's in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// * The name of the copyright holders may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// This software is provided by the copyright holders and contributors "as is" and
-// any express or implied warranties, including, but not limited to, the implied
-// warranties of merchantability and fitness for a particular purpose are disclaimed.
-// In no event shall the Intel Corporation or contributors be liable for any direct,
-// indirect, incidental, special, exemplary, or consequential damages
-// (including, but not limited to, procurement of substitute goods or services;
-// loss of use, data, or profits; or business interruption) however caused
-// and on any theory of liability, whether in contract, strict liability,
-// or tort (including negligence or otherwise) arising in any way out of
-// the use of this software, even if advised of the possibility of such damage.
-//
-//M*/
-
-#ifndef __OPENCV_OLD_CXCORE_H__
-#define __OPENCV_OLD_CXCORE_H__
-
-//#if defined(__GNUC__)
-//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
-//#endif
-
-#include "opencv2/core/core_c.h"
-#include "opencv2/core/core.hpp"
-
-#endif
View
52 addons/ofxOpenCv/libs/opencv/include_android/cxcore.hpp
@@ -1,52 +0,0 @@
-/*M///////////////////////////////////////////////////////////////////////////////////////
-//
-// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-//
-// By downloading, copying, installing or using the software you agree to this license.
-// If you do not agree to this license, do not download, install,
-// copy or use the software.
-//
-//
-// License Agreement
-// For Open Source Computer Vision Library
-//
-// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
-// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
-// Third party copyrights are property of their respective owners.
-//
-// Redistribution and use in source and binary forms, with or without modification,
-// are permitted provided that the following conditions are met:
-//
-// * Redistribution's of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// * Redistribution's in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// * The name of the copyright holders may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// This software is provided by the copyright holders and contributors "as is" and
-// any express or implied warranties, including, but not limited to, the implied
-// warranties of merchantability and fitness for a particular purpose are disclaimed.
-// In no event shall the Intel Corporation or contributors be liable for any direct,
-// indirect, incidental, special, exemplary, or consequential damages
-// (including, but not limited to, procurement of substitute goods or services;
-// loss of use, data, or profits; or business interruption) however caused
-// and on any theory of liability, whether in contract, strict liability,
-// or tort (including negligence or otherwise) arising in any way out of
-// the use of this software, even if advised of the possibility of such damage.
-//
-//M*/
-
-#ifndef __OPENCV_OLD_CXCORE_HPP__
-#define __OPENCV_OLD_CXCORE_HPP__
-
-//#if defined(__GNUC__)
-//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
-//#endif
-
-#include <cxcore.h>
-
-#endif
View
6 addons/ofxOpenCv/libs/opencv/include_android/cxmisc.h
@@ -1,6 +0,0 @@
-#ifndef __OPENCV_OLD_CXMISC_H__
-#define __OPENCV_OLD_CXMISC_H__
-
-#include "opencv2/core/internal.hpp"
-
-#endif
View
50 addons/ofxOpenCv/libs/opencv/include_android/highgui.h
@@ -1,50 +0,0 @@
-/*M///////////////////////////////////////////////////////////////////////////////////////
-//
-// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-//
-// By downloading, copying, installing or using the software you agree to this license.
-// If you do not agree to this license, do not download, install,
-// copy or use the software.
-//
-//
-// Intel License Agreement
-// For Open Source Computer Vision Library
-//
-// Copyright (C) 2000, Intel Corporation, all rights reserved.
-// Third party copyrights are property of their respective owners.
-//
-// Redistribution and use in source and binary forms, with or without modification,
-// are permitted provided that the following conditions are met:
-//
-// * Redistribution's of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// * Redistribution's in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// * The name of Intel Corporation may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// This software is provided by the copyright holders and contributors "as is" and
-// any express or implied warranties, including, but not limited to, the implied
-// warranties of merchantability and fitness for a particular purpose are disclaimed.
-// In no event shall the Intel Corporation or contributors be liable for any direct,
-// indirect, incidental, special, exemplary, or consequential damages
-// (including, but not limited to, procurement of substitute goods or services;
-// loss of use, data, or profits; or business interruption) however caused
-// and on any theory of liability, whether in contract, strict liability,
-// or tort (including negligence or otherwise) arising in any way out of
-// the use of this software, even if advised of the possibility of such damage.
-//
-//M*/
-
-#ifndef __OPENCV_OLD_HIGHGUI_H__
-#define __OPENCV_OLD_HIGHGUI_H__
-
-#include "opencv2/core/core_c.h"
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui_c.h"
-#include "opencv2/highgui/highgui.hpp"
-
-#endif
View
48 addons/ofxOpenCv/libs/opencv/include_android/ml.h
@@ -1,48 +0,0 @@
-/*M///////////////////////////////////////////////////////////////////////////////////////
-//
-// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-//
-// By downloading, copying, installing or using the software you agree to this license.
-// If you do not agree to this license, do not download, install,
-// copy or use the software.
-//
-//
-// Intel License Agreement
-//
-// Copyright (C) 2000, Intel Corporation, all rights reserved.
-// Third party copyrights are property of their respective owners.
-//
-// Redistribution and use in source and binary forms, with or without modification,
-// are permitted provided that the following conditions are met:
-//
-// * Redistribution's of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// * Redistribution's in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// * The name of Intel Corporation may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// This software is provided by the copyright holders and contributors "as is" and
-// any express or implied warranties, including, but not limited to, the implied
-// warranties of merchantability and fitness for a particular purpose are disclaimed.
-// In no event shall the Intel Corporation or contributors be liable for any direct,
-// indirect, incidental, special, exemplary, or consequential damages
-// (including, but not limited to, procurement of substitute goods or services;
-// loss of use, data, or profits; or business interruption) however caused
-// and on any theory of liability, whether in contract, strict liability,
-// or tort (including negligence or otherwise) arising in any way out of
-// the use of this software, even if advised of the possibility of such damage.
-//
-//M*/
-
-#ifndef __OPENCV_OLD_ML_H__
-#define __OPENCV_OLD_ML_H__
-
-#include "opencv2/core/core_c.h"
-#include "opencv2/core/core.hpp"
-#include "opencv2/ml/ml.hpp"
-
-#endif
View
BIN  addons/ofxOpenCv/libs/opencv/lib/android/libcv.a
Binary file not shown
View
BIN  addons/ofxOpenCv/libs/opencv/lib/android/libcvaux.a
Binary file not shown
View
BIN  addons/ofxOpenCv/libs/opencv/lib/android/libcxcore.a
Binary file not shown
View
BIN  addons/ofxOpenCv/libs/opencv/lib/android/libopencv_lapack.a
Binary file not shown
View
184 apps/addonsExamples/3DModelLoaderExample/makefile
@@ -25,7 +25,17 @@
# edit the following vars to customize the makefile
-COMPILER_OPTIMIZATION = -march=native -mtune=native -O3
+ifeq ($(findstring Android,$(MAKECMDGOALS)),Android)
+ ARCH = android
+endif
+
+ifeq ($(ARCH),android)
+ COMPILER_OPTIMIZATION = -O3
+ HOST_PLATFORM = linux-x86
+ NDK_PLATFORM = android-9
+else
+ COMPILER_OPTIMIZATION = -march=native -mtune=native -O3
+endif
EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj"
USER_CFLAGS =
USER_LD_FLAGS =
@@ -38,13 +48,32 @@ USER_LIBS =
SHELL = /bin/sh
-CXX = g++
-
-ARCH = $(shell uname -m)
-ifeq ($(ARCH),x86_64)
- LIBSPATH=linux64
+ifneq ($(ARCH),android)
+ CXX = g++
+ ARCH = $(shell uname -m)
+ ifeq ($(ARCH),x86_64)
+ LIBSPATH=linux64
+ else
+ LIBSPATH=linux
+ endif
else
- LIBSPATH=linux
+ ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
+ LIBSPATH =android/armeabi-v7a
+ else
+ LIBSPATH =android/armeabi
+ endif
+ NDK_ROOT = $(shell cat ../../../libs/openFrameworksCompiled/project/android/ndk_path.make)
+ SDK_ROOT = $(shell cat ../../../libs/openFrameworksCompiled/project/android/sdk_path.make)
+ TOOLCHAIN=arm-linux-androideabi-4.4.3
+ TOOLCHAIN_PATH=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/
+ ANDROID_PREFIX=arm-linux-androideabi-
+ CC=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)gcc
+ CXX=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)g++
+ AR=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)ar
+ SYSROOT=$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/
+ CFLAGS += -nostdlib --sysroot=$(SYSROOT) -fno-short-enums
+ CFLAGS += -I"$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/usr/include" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/include/" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include"
+ CFLAGS += -DANDROID
endif
NODEPS = clean
@@ -55,42 +84,60 @@ OBJFILES = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES)))
APPNAME = $(shell basename `pwd`)
CORE_INCLUDES = $(shell find ../../../libs/openFrameworks/ -type d)
CORE_INCLUDE_FLAGS = $(addprefix -I,$(CORE_INCLUDES))
-INCLUDES = $(shell find ../../../libs/*/include -type d)
+INCLUDES = $(shell find ../../../libs/*/include -type d | grep -v glu)
INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))
+ifeq ($(ARCH),android)
+ INCLUDES_FLAGS += -I../../../libs/glu/include_android
+else
+ INCLUDES_FLAGS += -I../../../libs/glu/include
+ INCLUDES_FLAGS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --cflags)
+ #check if gtk exists and add it
+ GTK = $(shell pkg-config gtk+-2.0 --exists; echo $$?)
+ ifeq ($(GTK),0)
+ CFLAGS += $(shell pkg-config gtk+-2.0 --cflags) -DOF_USING_GTK
+ LIBS += $(shell pkg-config gtk+-2.0 --libs)
+ endif
+endif
LIB_STATIC = $(shell ls ../../../libs/*/lib/$(LIBSPATH)/*.a | grep -v openFrameworksCompiled | grep -v poco| sed "s/.*\\/lib\([^/]*\)\.a/-l\1/")
LIB_SHARED = $(shell ls ../../../libs/*/lib/$(LIBSPATH)/*.so | grep -v openFrameworksCompiled| sed "s/.*\\/lib\([^/]*\)\.so/-l\1/")
LIB_STATIC += ../../../libs/poco/lib/$(LIBSPATH)/libPocoNet.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoXML.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoUtil.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoFoundation.a
LIB_PATHS_FLAGS = $(shell ls -d ../../../libs/*/lib/$(LIBSPATH) | sed "s/\(\.*\)/-L\1/")
+ifeq ($(ARCH),android)
+ LIB_PATHS_FLAGS += -L../../../libs/openFrameworksCompiled/lib/android
+endif
-CFLAGS = -Wall -fexceptions
+CFLAGS += -Wall -fexceptions
CFLAGS += -I.
CFLAGS += $(INCLUDES_FLAGS)
CFLAGS += $(CORE_INCLUDE_FLAGS)
-CFLAGS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --cflags)
-LDFLAGS = $(LIB_PATHS_FLAGS) -Wl,-rpath=./libs
LIBS = $(LIB_SHARED)
LIBS += $(LIB_STATIC)
-LIBS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --libs)
-LIBS += -lglut -lGL -lGLU -lasound
-
-#check if gtk exists and add it
-GTK = $(shell pkg-config gtk+-2.0 --exists; echo $$?)
-ifeq ($(GTK),0)
- CFLAGS += $(shell pkg-config gtk+-2.0 --cflags) -DOF_USING_GTK
- LIBS += $(shell pkg-config gtk+-2.0 --libs)
+ifeq ($(ARCH),android)
+ LDFLAGS = $(LIB_PATHS_FLAGS) --sysroot=$(SYSROOT) -nostdlib -L"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi"
+ LIBS += -lstdc++ -lsupc++ -lGLU -lgcc -lz -lGLESv1_CM -llog -ldl -lm -lc
+else
+ LDFLAGS = $(LIB_PATHS_FLAGS) -Wl,-rpath=./libs
+ LIBS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --libs)
+ LIBS += -lglut -lGL -lGLU -lasound
endif
+
ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
ADDONS_INCLUDES = $(shell find ../../../addons/*/src/ -type d)
ADDONS_INCLUDES += $(shell find ../../../addons/*/libs/ -type d)
ADDONSCFLAGS = $(addprefix -I,$(ADDONS_INCLUDES))
- ADDONS_LIBS_STATICS = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.a)
+ ifeq ($(findstring libsorder.make,$(wildcard ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make)),libsorder.make)
+ ADDONS_LIBS_W_ORDER = $(addprefix -l,$(shell cat ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make))
+ endif
+
+ ADDONS_LIBS_STATICS = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.a | grep -v $(ADDONS_LIBS_W_ORDER))
+ ADDONS_LIBS_STATICS += $(ADDONS_LIBS_W_ORDER)
+ ADDONS_LIBS_STATICS += $(addprefix -L, $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make | sed s/libsorder.make//g))
ADDONS_LIBS_SHARED = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.so)
-
ADDONSLIBS = $(ADDONS_LIBS_STATICS)
ADDONSLIBS += $(ADDONS_LIBS_SHARED)
@@ -105,29 +152,61 @@ ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
endif
-
ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
TARGET_CFLAGS = -g
TARGET_LIBS = -lopenFrameworksDebug
TARGET_NAME = Debug
- BIN_NAME = $(APPNAME)_debug
- TARGET = bin/$(BIN_NAME)
endif
ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)
TARGET_LIBS = -lopenFrameworks
TARGET_NAME = Release
- BIN_NAME = $(APPNAME)
- TARGET = bin/$(BIN_NAME)
endif
-ifeq ($(MAKECMDGOALS),)
- TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)
- TARGET_LIBS = -lopenFrameworks
- TARGET_NAME = Release
- BIN_NAME = $(APPNAME)
- TARGET = bin/$(BIN_NAME)
+ifeq ($(ARCH),android)
+ ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
+ TARGET = libs/armeabi/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworksDebug
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
+ TARGET = libs/armeabi/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworks
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
+ TARGET_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfp
+ TARGET = libs/armeabi-v7a/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworks_arm7
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring TestLink,$(MAKECMDGOALS)),TestLink)
+ TARGET_NAME = Debug
+ TARGET_LIBS = -lopenFrameworksDebug
+ LDFLAGS += -Wl,--entry=main
+ BIN_NAME = $(APPNAME)
+ TARGET = obj/$(BIN_NAME)
+ endif
+else
+ ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
+ BIN_NAME = $(APPNAME)_debug
+ TARGET = bin/$(BIN_NAME)
+ endif
+
+ ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
+ BIN_NAME = $(APPNAME)
+ TARGET = bin/$(BIN_NAME)
+ endif
+
+ ifeq ($(MAKECMDGOALS),)
+ TARGET_NAME = Release
+ BIN_NAME = $(APPNAME)
+ TARGET = bin/$(BIN_NAME)
+ endif
endif
ifeq ($(MAKECMDGOALS),clean)
@@ -143,7 +222,7 @@ ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
DEPFILES += $(patsubst %.o,%.d,$(ADDONS_OBJS))
endif
-.PHONY: Debug Release all after
+.PHONY: Debug Release all after afterDebugAndroid afterReleaseAndroid
Release: $(TARGET) after
@@ -151,6 +230,24 @@ Debug: $(TARGET) after
all:
make Release
+
+
+
+DebugAndroid: $(TARGET)
+
+ReleaseAndroid: $(TARGET)
+
+Release_arm7Android: $(TARGET) afterReleaseAndroid
+
+TestLinkAndroid: $(TARGET) afterDebugAndroid
+
+AndroidDebug:
+ make DebugAndroid
+ make TestLinkAndroid
+
+AndroidRelease:
+ make ReleaseAndroid
+ make Release_arm7Android
#This rule does the compilation
@@ -177,12 +274,12 @@ $(OBJ_OUTPUT)%.o: ../../../%.c
$(CC) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $<
$(TARGET): $(OBJS) $(ADDONS_OBJS)
- @echo "linking" $(TARGET) $(GTK)
- $(CXX) -o $@ $(OBJS) $(ADDONS_OBJS) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(LIBS) $(ADDONSLIBS) $(USER_LIBS)
+ @echo "linking" $(TARGET)
+ $(CXX) -o $@ $(OBJS) $(ADDONS_OBJS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(ADDONSLIBS) $(USER_LIBS) $(LIBS)
-include $(DEPFILES)
-.PHONY: clean CleanDebug CleanRelease
+.PHONY: clean CleanDebug CleanRelease CleanAndroid
clean:
rm -Rf obj
rm -f -v $(TARGET)
@@ -191,8 +288,23 @@ clean:
$(CLEANTARGET):
rm -Rf -v $(OBJ_OUTPUT)
rm -f -v $(TARGET)
+
+CleanAndroid:
+ rm -Rf obj
+ rm -f -v libs/armeabi_v7a/libOFAndroidApp.so
+ rm -f -v libs/armeabi/libOFAndroidApp.so
+ rm -f -v obj/$(APPNAME)
+afterDebugAndroid:
+ if [ -f libs/armeabi_v7a/libOFAndroidApp.so ]; then rm libs/armeabi_v7a/libOFAndroidApp.so; fi
+ if [ -f obj/$(BINNAME) ]; then rm obj/$(BINNAME); fi
+ touch AndroidManifest.xml
+
+afterReleaseAndroid:
+ if [ -f obj/$(BINNAME) ]; then rm obj/$(BINNAME); fi
+ touch AndroidManifest.xml
+
after:
cp -r ../../../export/$(LIBSPATH)/libs bin/
@echo
View
184 apps/addonsExamples/allAddonsExample/makefile
@@ -25,7 +25,17 @@
# edit the following vars to customize the makefile
-COMPILER_OPTIMIZATION = -march=native -mtune=native -O3
+ifeq ($(findstring Android,$(MAKECMDGOALS)),Android)
+ ARCH = android
+endif
+
+ifeq ($(ARCH),android)
+ COMPILER_OPTIMIZATION = -O3
+ HOST_PLATFORM = linux-x86
+ NDK_PLATFORM = android-9
+else
+ COMPILER_OPTIMIZATION = -march=native -mtune=native -O3
+endif
EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj"
USER_CFLAGS =
USER_LD_FLAGS =
@@ -38,13 +48,32 @@ USER_LIBS =
SHELL = /bin/sh
-CXX = g++
-
-ARCH = $(shell uname -m)
-ifeq ($(ARCH),x86_64)
- LIBSPATH=linux64
+ifneq ($(ARCH),android)
+ CXX = g++
+ ARCH = $(shell uname -m)
+ ifeq ($(ARCH),x86_64)
+ LIBSPATH=linux64
+ else
+ LIBSPATH=linux
+ endif
else
- LIBSPATH=linux
+ ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
+ LIBSPATH =android/armeabi-v7a
+ else
+ LIBSPATH =android/armeabi
+ endif
+ NDK_ROOT = $(shell cat ../../../libs/openFrameworksCompiled/project/android/ndk_path.make)
+ SDK_ROOT = $(shell cat ../../../libs/openFrameworksCompiled/project/android/sdk_path.make)
+ TOOLCHAIN=arm-linux-androideabi-4.4.3
+ TOOLCHAIN_PATH=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/
+ ANDROID_PREFIX=arm-linux-androideabi-
+ CC=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)gcc
+ CXX=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)g++
+ AR=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)ar
+ SYSROOT=$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/
+ CFLAGS += -nostdlib --sysroot=$(SYSROOT) -fno-short-enums
+ CFLAGS += -I"$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/usr/include" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/include/" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include"
+ CFLAGS += -DANDROID
endif
NODEPS = clean
@@ -55,42 +84,60 @@ OBJFILES = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES)))
APPNAME = $(shell basename `pwd`)
CORE_INCLUDES = $(shell find ../../../libs/openFrameworks/ -type d)
CORE_INCLUDE_FLAGS = $(addprefix -I,$(CORE_INCLUDES))
-INCLUDES = $(shell find ../../../libs/*/include -type d)
+INCLUDES = $(shell find ../../../libs/*/include -type d | grep -v glu)
INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))
+ifeq ($(ARCH),android)
+ INCLUDES_FLAGS += -I../../../libs/glu/include_android
+else
+ INCLUDES_FLAGS += -I../../../libs/glu/include
+ INCLUDES_FLAGS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --cflags)
+ #check if gtk exists and add it
+ GTK = $(shell pkg-config gtk+-2.0 --exists; echo $$?)
+ ifeq ($(GTK),0)
+ CFLAGS += $(shell pkg-config gtk+-2.0 --cflags) -DOF_USING_GTK
+ LIBS += $(shell pkg-config gtk+-2.0 --libs)
+ endif
+endif
LIB_STATIC = $(shell ls ../../../libs/*/lib/$(LIBSPATH)/*.a | grep -v openFrameworksCompiled | grep -v poco| sed "s/.*\\/lib\([^/]*\)\.a/-l\1/")
LIB_SHARED = $(shell ls ../../../libs/*/lib/$(LIBSPATH)/*.so | grep -v openFrameworksCompiled| sed "s/.*\\/lib\([^/]*\)\.so/-l\1/")
LIB_STATIC += ../../../libs/poco/lib/$(LIBSPATH)/libPocoNet.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoXML.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoUtil.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoFoundation.a
LIB_PATHS_FLAGS = $(shell ls -d ../../../libs/*/lib/$(LIBSPATH) | sed "s/\(\.*\)/-L\1/")
+ifeq ($(ARCH),android)
+ LIB_PATHS_FLAGS += -L../../../libs/openFrameworksCompiled/lib/android
+endif
-CFLAGS = -Wall -fexceptions
+CFLAGS += -Wall -fexceptions
CFLAGS += -I.
CFLAGS += $(INCLUDES_FLAGS)
CFLAGS += $(CORE_INCLUDE_FLAGS)
-CFLAGS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --cflags)
-LDFLAGS = $(LIB_PATHS_FLAGS) -Wl,-rpath=./libs
LIBS = $(LIB_SHARED)
LIBS += $(LIB_STATIC)
-LIBS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --libs)
-LIBS += -lglut -lGL -lGLU -lasound
-
-#check if gtk exists and add it
-GTK = $(shell pkg-config gtk+-2.0 --exists; echo $$?)
-ifeq ($(GTK),0)
- CFLAGS += $(shell pkg-config gtk+-2.0 --cflags) -DOF_USING_GTK
- LIBS += $(shell pkg-config gtk+-2.0 --libs)
+ifeq ($(ARCH),android)
+ LDFLAGS = $(LIB_PATHS_FLAGS) --sysroot=$(SYSROOT) -nostdlib -L"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi"
+ LIBS += -lstdc++ -lsupc++ -lGLU -lgcc -lz -lGLESv1_CM -llog -ldl -lm -lc
+else
+ LDFLAGS = $(LIB_PATHS_FLAGS) -Wl,-rpath=./libs
+ LIBS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --libs)
+ LIBS += -lglut -lGL -lGLU -lasound
endif
+
ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
ADDONS_INCLUDES = $(shell find ../../../addons/*/src/ -type d)
ADDONS_INCLUDES += $(shell find ../../../addons/*/libs/ -type d)
ADDONSCFLAGS = $(addprefix -I,$(ADDONS_INCLUDES))
- ADDONS_LIBS_STATICS = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.a)
+ ifeq ($(findstring libsorder.make,$(wildcard ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make)),libsorder.make)
+ ADDONS_LIBS_W_ORDER = $(addprefix -l,$(shell cat ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make))
+ endif
+
+ ADDONS_LIBS_STATICS = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.a | grep -v $(ADDONS_LIBS_W_ORDER))
+ ADDONS_LIBS_STATICS += $(ADDONS_LIBS_W_ORDER)
+ ADDONS_LIBS_STATICS += $(addprefix -L, $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make | sed s/libsorder.make//g))
ADDONS_LIBS_SHARED = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.so)
-
ADDONSLIBS = $(ADDONS_LIBS_STATICS)
ADDONSLIBS += $(ADDONS_LIBS_SHARED)
@@ -105,29 +152,61 @@ ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
endif
-
ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
TARGET_CFLAGS = -g
TARGET_LIBS = -lopenFrameworksDebug
TARGET_NAME = Debug
- BIN_NAME = $(APPNAME)_debug
- TARGET = bin/$(BIN_NAME)
endif
ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)
TARGET_LIBS = -lopenFrameworks
TARGET_NAME = Release
- BIN_NAME = $(APPNAME)
- TARGET = bin/$(BIN_NAME)
endif
-ifeq ($(MAKECMDGOALS),)
- TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)
- TARGET_LIBS = -lopenFrameworks
- TARGET_NAME = Release
- BIN_NAME = $(APPNAME)
- TARGET = bin/$(BIN_NAME)
+ifeq ($(ARCH),android)
+ ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
+ TARGET = libs/armeabi/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworksDebug
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
+ TARGET = libs/armeabi/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworks
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
+ TARGET_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfp
+ TARGET = libs/armeabi-v7a/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworks_arm7
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring TestLink,$(MAKECMDGOALS)),TestLink)
+ TARGET_NAME = Debug
+ TARGET_LIBS = -lopenFrameworksDebug
+ LDFLAGS += -Wl,--entry=main
+ BIN_NAME = $(APPNAME)
+ TARGET = obj/$(BIN_NAME)
+ endif
+else
+ ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
+ BIN_NAME = $(APPNAME)_debug
+ TARGET = bin/$(BIN_NAME)
+ endif
+
+ ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
+ BIN_NAME = $(APPNAME)
+ TARGET = bin/$(BIN_NAME)
+ endif
+
+ ifeq ($(MAKECMDGOALS),)
+ TARGET_NAME = Release
+ BIN_NAME = $(APPNAME)
+ TARGET = bin/$(BIN_NAME)
+ endif
endif
ifeq ($(MAKECMDGOALS),clean)
@@ -143,7 +222,7 @@ ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
DEPFILES += $(patsubst %.o,%.d,$(ADDONS_OBJS))
endif
-.PHONY: Debug Release all after
+.PHONY: Debug Release all after afterDebugAndroid afterReleaseAndroid
Release: $(TARGET) after
@@ -151,6 +230,24 @@ Debug: $(TARGET) after
all:
make Release
+
+
+
+DebugAndroid: $(TARGET)
+
+ReleaseAndroid: $(TARGET)
+
+Release_arm7Android: $(TARGET) afterReleaseAndroid
+
+TestLinkAndroid: $(TARGET) afterDebugAndroid
+
+AndroidDebug:
+ make DebugAndroid
+ make TestLinkAndroid
+
+AndroidRelease:
+ make ReleaseAndroid
+ make Release_arm7Android
#This rule does the compilation
@@ -177,12 +274,12 @@ $(OBJ_OUTPUT)%.o: ../../../%.c
$(CC) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $<
$(TARGET): $(OBJS) $(ADDONS_OBJS)
- @echo "linking" $(TARGET) $(GTK)
- $(CXX) -o $@ $(OBJS) $(ADDONS_OBJS) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(LIBS) $(ADDONSLIBS) $(USER_LIBS)
+ @echo "linking" $(TARGET)
+ $(CXX) -o $@ $(OBJS) $(ADDONS_OBJS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(ADDONSLIBS) $(USER_LIBS) $(LIBS)
-include $(DEPFILES)
-.PHONY: clean CleanDebug CleanRelease
+.PHONY: clean CleanDebug CleanRelease CleanAndroid
clean:
rm -Rf obj
rm -f -v $(TARGET)
@@ -191,8 +288,23 @@ clean:
$(CLEANTARGET):
rm -Rf -v $(OBJ_OUTPUT)
rm -f -v $(TARGET)
+
+CleanAndroid:
+ rm -Rf obj
+ rm -f -v libs/armeabi_v7a/libOFAndroidApp.so
+ rm -f -v libs/armeabi/libOFAndroidApp.so
+ rm -f -v obj/$(APPNAME)
+afterDebugAndroid:
+ if [ -f libs/armeabi_v7a/libOFAndroidApp.so ]; then rm libs/armeabi_v7a/libOFAndroidApp.so; fi
+ if [ -f obj/$(BINNAME) ]; then rm obj/$(BINNAME); fi
+ touch AndroidManifest.xml
+
+afterReleaseAndroid:
+ if [ -f obj/$(BINNAME) ]; then rm obj/$(BINNAME); fi
+ touch AndroidManifest.xml
+
after:
cp -r ../../../export/$(LIBSPATH)/libs bin/
@echo
View
184 apps/addonsExamples/dirListExample/makefile
@@ -25,7 +25,17 @@
# edit the following vars to customize the makefile
-COMPILER_OPTIMIZATION = -march=native -mtune=native -O3
+ifeq ($(findstring Android,$(MAKECMDGOALS)),Android)
+ ARCH = android
+endif
+
+ifeq ($(ARCH),android)
+ COMPILER_OPTIMIZATION = -O3
+ HOST_PLATFORM = linux-x86
+ NDK_PLATFORM = android-9
+else
+ COMPILER_OPTIMIZATION = -march=native -mtune=native -O3
+endif
EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj"
USER_CFLAGS =
USER_LD_FLAGS =
@@ -38,13 +48,32 @@ USER_LIBS =
SHELL = /bin/sh
-CXX = g++
-
-ARCH = $(shell uname -m)
-ifeq ($(ARCH),x86_64)
- LIBSPATH=linux64
+ifneq ($(ARCH),android)
+ CXX = g++
+ ARCH = $(shell uname -m)
+ ifeq ($(ARCH),x86_64)
+ LIBSPATH=linux64
+ else
+ LIBSPATH=linux
+ endif
else
- LIBSPATH=linux
+ ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
+ LIBSPATH =android/armeabi-v7a
+ else
+ LIBSPATH =android/armeabi
+ endif
+ NDK_ROOT = $(shell cat ../../../libs/openFrameworksCompiled/project/android/ndk_path.make)
+ SDK_ROOT = $(shell cat ../../../libs/openFrameworksCompiled/project/android/sdk_path.make)
+ TOOLCHAIN=arm-linux-androideabi-4.4.3
+ TOOLCHAIN_PATH=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/
+ ANDROID_PREFIX=arm-linux-androideabi-
+ CC=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)gcc
+ CXX=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)g++
+ AR=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)ar
+ SYSROOT=$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/
+ CFLAGS += -nostdlib --sysroot=$(SYSROOT) -fno-short-enums
+ CFLAGS += -I"$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/usr/include" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/include/" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include"
+ CFLAGS += -DANDROID
endif
NODEPS = clean
@@ -55,42 +84,60 @@ OBJFILES = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES)))
APPNAME = $(shell basename `pwd`)
CORE_INCLUDES = $(shell find ../../../libs/openFrameworks/ -type d)
CORE_INCLUDE_FLAGS = $(addprefix -I,$(CORE_INCLUDES))
-INCLUDES = $(shell find ../../../libs/*/include -type d)
+INCLUDES = $(shell find ../../../libs/*/include -type d | grep -v glu)
INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))
+ifeq ($(ARCH),android)
+ INCLUDES_FLAGS += -I../../../libs/glu/include_android
+else
+ INCLUDES_FLAGS += -I../../../libs/glu/include
+ INCLUDES_FLAGS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --cflags)
+ #check if gtk exists and add it
+ GTK = $(shell pkg-config gtk+-2.0 --exists; echo $$?)
+ ifeq ($(GTK),0)
+ CFLAGS += $(shell pkg-config gtk+-2.0 --cflags) -DOF_USING_GTK
+ LIBS += $(shell pkg-config gtk+-2.0 --libs)
+ endif
+endif
LIB_STATIC = $(shell ls ../../../libs/*/lib/$(LIBSPATH)/*.a | grep -v openFrameworksCompiled | grep -v poco| sed "s/.*\\/lib\([^/]*\)\.a/-l\1/")
LIB_SHARED = $(shell ls ../../../libs/*/lib/$(LIBSPATH)/*.so | grep -v openFrameworksCompiled| sed "s/.*\\/lib\([^/]*\)\.so/-l\1/")
LIB_STATIC += ../../../libs/poco/lib/$(LIBSPATH)/libPocoNet.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoXML.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoUtil.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoFoundation.a
LIB_PATHS_FLAGS = $(shell ls -d ../../../libs/*/lib/$(LIBSPATH) | sed "s/\(\.*\)/-L\1/")
+ifeq ($(ARCH),android)
+ LIB_PATHS_FLAGS += -L../../../libs/openFrameworksCompiled/lib/android
+endif
-CFLAGS = -Wall -fexceptions
+CFLAGS += -Wall -fexceptions
CFLAGS += -I.
CFLAGS += $(INCLUDES_FLAGS)
CFLAGS += $(CORE_INCLUDE_FLAGS)
-CFLAGS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --cflags)
-LDFLAGS = $(LIB_PATHS_FLAGS) -Wl,-rpath=./libs
LIBS = $(LIB_SHARED)
LIBS += $(LIB_STATIC)
-LIBS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --libs)
-LIBS += -lglut -lGL -lGLU -lasound
-
-#check if gtk exists and add it
-GTK = $(shell pkg-config gtk+-2.0 --exists; echo $$?)
-ifeq ($(GTK),0)
- CFLAGS += $(shell pkg-config gtk+-2.0 --cflags) -DOF_USING_GTK
- LIBS += $(shell pkg-config gtk+-2.0 --libs)
+ifeq ($(ARCH),android)
+ LDFLAGS = $(LIB_PATHS_FLAGS) --sysroot=$(SYSROOT) -nostdlib -L"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi"
+ LIBS += -lstdc++ -lsupc++ -lGLU -lgcc -lz -lGLESv1_CM -llog -ldl -lm -lc
+else
+ LDFLAGS = $(LIB_PATHS_FLAGS) -Wl,-rpath=./libs
+ LIBS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --libs)
+ LIBS += -lglut -lGL -lGLU -lasound
endif
+
ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
ADDONS_INCLUDES = $(shell find ../../../addons/*/src/ -type d)
ADDONS_INCLUDES += $(shell find ../../../addons/*/libs/ -type d)
ADDONSCFLAGS = $(addprefix -I,$(ADDONS_INCLUDES))
- ADDONS_LIBS_STATICS = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.a)
+ ifeq ($(findstring libsorder.make,$(wildcard ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make)),libsorder.make)
+ ADDONS_LIBS_W_ORDER = $(addprefix -l,$(shell cat ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make))
+ endif
+
+ ADDONS_LIBS_STATICS = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.a | grep -v $(ADDONS_LIBS_W_ORDER))
+ ADDONS_LIBS_STATICS += $(ADDONS_LIBS_W_ORDER)
+ ADDONS_LIBS_STATICS += $(addprefix -L, $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make | sed s/libsorder.make//g))
ADDONS_LIBS_SHARED = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.so)
-
ADDONSLIBS = $(ADDONS_LIBS_STATICS)
ADDONSLIBS += $(ADDONS_LIBS_SHARED)
@@ -105,29 +152,61 @@ ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
endif
-
ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
TARGET_CFLAGS = -g
TARGET_LIBS = -lopenFrameworksDebug
TARGET_NAME = Debug
- BIN_NAME = $(APPNAME)_debug
- TARGET = bin/$(BIN_NAME)
endif
ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)
TARGET_LIBS = -lopenFrameworks
TARGET_NAME = Release
- BIN_NAME = $(APPNAME)
- TARGET = bin/$(BIN_NAME)
endif
-ifeq ($(MAKECMDGOALS),)
- TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)
- TARGET_LIBS = -lopenFrameworks
- TARGET_NAME = Release
- BIN_NAME = $(APPNAME)
- TARGET = bin/$(BIN_NAME)
+ifeq ($(ARCH),android)
+ ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
+ TARGET = libs/armeabi/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworksDebug
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
+ TARGET = libs/armeabi/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworks
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
+ TARGET_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfp
+ TARGET = libs/armeabi-v7a/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworks_arm7
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring TestLink,$(MAKECMDGOALS)),TestLink)
+ TARGET_NAME = Debug
+ TARGET_LIBS = -lopenFrameworksDebug
+ LDFLAGS += -Wl,--entry=main
+ BIN_NAME = $(APPNAME)
+ TARGET = obj/$(BIN_NAME)
+ endif
+else
+ ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
+ BIN_NAME = $(APPNAME)_debug
+ TARGET = bin/$(BIN_NAME)
+ endif
+
+ ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
+ BIN_NAME = $(APPNAME)
+ TARGET = bin/$(BIN_NAME)
+ endif
+
+ ifeq ($(MAKECMDGOALS),)
+ TARGET_NAME = Release
+ BIN_NAME = $(APPNAME)
+ TARGET = bin/$(BIN_NAME)
+ endif
endif
ifeq ($(MAKECMDGOALS),clean)
@@ -143,7 +222,7 @@ ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
DEPFILES += $(patsubst %.o,%.d,$(ADDONS_OBJS))
endif
-.PHONY: Debug Release all after
+.PHONY: Debug Release all after afterDebugAndroid afterReleaseAndroid
Release: $(TARGET) after
@@ -151,6 +230,24 @@ Debug: $(TARGET) after
all:
make Release
+
+
+
+DebugAndroid: $(TARGET)
+
+ReleaseAndroid: $(TARGET)
+
+Release_arm7Android: $(TARGET) afterReleaseAndroid
+
+TestLinkAndroid: $(TARGET) afterDebugAndroid
+
+AndroidDebug:
+ make DebugAndroid
+ make TestLinkAndroid
+
+AndroidRelease:
+ make ReleaseAndroid
+ make Release_arm7Android
#This rule does the compilation
@@ -177,12 +274,12 @@ $(OBJ_OUTPUT)%.o: ../../../%.c
$(CC) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $<
$(TARGET): $(OBJS) $(ADDONS_OBJS)
- @echo "linking" $(TARGET) $(GTK)
- $(CXX) -o $@ $(OBJS) $(ADDONS_OBJS) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(LIBS) $(ADDONSLIBS) $(USER_LIBS)
+ @echo "linking" $(TARGET)
+ $(CXX) -o $@ $(OBJS) $(ADDONS_OBJS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(ADDONSLIBS) $(USER_LIBS) $(LIBS)
-include $(DEPFILES)
-.PHONY: clean CleanDebug CleanRelease
+.PHONY: clean CleanDebug CleanRelease CleanAndroid
clean:
rm -Rf obj
rm -f -v $(TARGET)
@@ -191,8 +288,23 @@ clean:
$(CLEANTARGET):
rm -Rf -v $(OBJ_OUTPUT)
rm -f -v $(TARGET)
+
+CleanAndroid:
+ rm -Rf obj
+ rm -f -v libs/armeabi_v7a/libOFAndroidApp.so
+ rm -f -v libs/armeabi/libOFAndroidApp.so
+ rm -f -v obj/$(APPNAME)
+afterDebugAndroid:
+ if [ -f libs/armeabi_v7a/libOFAndroidApp.so ]; then rm libs/armeabi_v7a/libOFAndroidApp.so; fi
+ if [ -f obj/$(BINNAME) ]; then rm obj/$(BINNAME); fi
+ touch AndroidManifest.xml
+
+afterReleaseAndroid:
+ if [ -f obj/$(BINNAME) ]; then rm obj/$(BINNAME); fi
+ touch AndroidManifest.xml
+
after:
cp -r ../../../export/$(LIBSPATH)/libs bin/
@echo
View
184 apps/addonsExamples/networkTcpClientExample/makefile
@@ -25,7 +25,17 @@
# edit the following vars to customize the makefile
-COMPILER_OPTIMIZATION = -march=native -mtune=native -O3
+ifeq ($(findstring Android,$(MAKECMDGOALS)),Android)
+ ARCH = android
+endif
+
+ifeq ($(ARCH),android)
+ COMPILER_OPTIMIZATION = -O3
+ HOST_PLATFORM = linux-x86
+ NDK_PLATFORM = android-9
+else
+ COMPILER_OPTIMIZATION = -march=native -mtune=native -O3
+endif
EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj"
USER_CFLAGS =
USER_LD_FLAGS =
@@ -38,13 +48,32 @@ USER_LIBS =
SHELL = /bin/sh
-CXX = g++
-
-ARCH = $(shell uname -m)
-ifeq ($(ARCH),x86_64)
- LIBSPATH=linux64
+ifneq ($(ARCH),android)
+ CXX = g++
+ ARCH = $(shell uname -m)
+ ifeq ($(ARCH),x86_64)
+ LIBSPATH=linux64
+ else
+ LIBSPATH=linux
+ endif
else
- LIBSPATH=linux
+ ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
+ LIBSPATH =android/armeabi-v7a
+ else
+ LIBSPATH =android/armeabi
+ endif
+ NDK_ROOT = $(shell cat ../../../libs/openFrameworksCompiled/project/android/ndk_path.make)
+ SDK_ROOT = $(shell cat ../../../libs/openFrameworksCompiled/project/android/sdk_path.make)
+ TOOLCHAIN=arm-linux-androideabi-4.4.3
+ TOOLCHAIN_PATH=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/
+ ANDROID_PREFIX=arm-linux-androideabi-
+ CC=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)gcc
+ CXX=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)g++
+ AR=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)ar
+ SYSROOT=$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/
+ CFLAGS += -nostdlib --sysroot=$(SYSROOT) -fno-short-enums
+ CFLAGS += -I"$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/usr/include" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/include/" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include"
+ CFLAGS += -DANDROID
endif
NODEPS = clean
@@ -55,42 +84,60 @@ OBJFILES = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES)))
APPNAME = $(shell basename `pwd`)
CORE_INCLUDES = $(shell find ../../../libs/openFrameworks/ -type d)
CORE_INCLUDE_FLAGS = $(addprefix -I,$(CORE_INCLUDES))
-INCLUDES = $(shell find ../../../libs/*/include -type d)
+INCLUDES = $(shell find ../../../libs/*/include -type d | grep -v glu)
INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))
+ifeq ($(ARCH),android)
+ INCLUDES_FLAGS += -I../../../libs/glu/include_android
+else
+ INCLUDES_FLAGS += -I../../../libs/glu/include
+ INCLUDES_FLAGS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --cflags)
+ #check if gtk exists and add it
+ GTK = $(shell pkg-config gtk+-2.0 --exists; echo $$?)
+ ifeq ($(GTK),0)
+ CFLAGS += $(shell pkg-config gtk+-2.0 --cflags) -DOF_USING_GTK
+ LIBS += $(shell pkg-config gtk+-2.0 --libs)
+ endif
+endif
LIB_STATIC = $(shell ls ../../../libs/*/lib/$(LIBSPATH)/*.a | grep -v openFrameworksCompiled | grep -v poco| sed "s/.*\\/lib\([^/]*\)\.a/-l\1/")
LIB_SHARED = $(shell ls ../../../libs/*/lib/$(LIBSPATH)/*.so | grep -v openFrameworksCompiled| sed "s/.*\\/lib\([^/]*\)\.so/-l\1/")
LIB_STATIC += ../../../libs/poco/lib/$(LIBSPATH)/libPocoNet.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoXML.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoUtil.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoFoundation.a
LIB_PATHS_FLAGS = $(shell ls -d ../../../libs/*/lib/$(LIBSPATH) | sed "s/\(\.*\)/-L\1/")
+ifeq ($(ARCH),android)
+ LIB_PATHS_FLAGS += -L../../../libs/openFrameworksCompiled/lib/android
+endif
-CFLAGS = -Wall -fexceptions
+CFLAGS += -Wall -fexceptions
CFLAGS += -I.
CFLAGS += $(INCLUDES_FLAGS)
CFLAGS += $(CORE_INCLUDE_FLAGS)
-CFLAGS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --cflags)
-LDFLAGS = $(LIB_PATHS_FLAGS) -Wl,-rpath=./libs
LIBS = $(LIB_SHARED)
LIBS += $(LIB_STATIC)
-LIBS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --libs)
-LIBS += -lglut -lGL -lGLU -lasound
-
-#check if gtk exists and add it
-GTK = $(shell pkg-config gtk+-2.0 --exists; echo $$?)
-ifeq ($(GTK),0)
- CFLAGS += $(shell pkg-config gtk+-2.0 --cflags) -DOF_USING_GTK
- LIBS += $(shell pkg-config gtk+-2.0 --libs)
+ifeq ($(ARCH),android)
+ LDFLAGS = $(LIB_PATHS_FLAGS) --sysroot=$(SYSROOT) -nostdlib -L"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi"
+ LIBS += -lstdc++ -lsupc++ -lGLU -lgcc -lz -lGLESv1_CM -llog -ldl -lm -lc
+else
+ LDFLAGS = $(LIB_PATHS_FLAGS) -Wl,-rpath=./libs
+ LIBS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --libs)
+ LIBS += -lglut -lGL -lGLU -lasound
endif
+
ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
ADDONS_INCLUDES = $(shell find ../../../addons/*/src/ -type d)
ADDONS_INCLUDES += $(shell find ../../../addons/*/libs/ -type d)
ADDONSCFLAGS = $(addprefix -I,$(ADDONS_INCLUDES))
- ADDONS_LIBS_STATICS = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.a)
+ ifeq ($(findstring libsorder.make,$(wildcard ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make)),libsorder.make)
+ ADDONS_LIBS_W_ORDER = $(addprefix -l,$(shell cat ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make))
+ endif
+
+ ADDONS_LIBS_STATICS = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.a | grep -v $(ADDONS_LIBS_W_ORDER))
+ ADDONS_LIBS_STATICS += $(ADDONS_LIBS_W_ORDER)
+ ADDONS_LIBS_STATICS += $(addprefix -L, $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make | sed s/libsorder.make//g))
ADDONS_LIBS_SHARED = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.so)
-
ADDONSLIBS = $(ADDONS_LIBS_STATICS)
ADDONSLIBS += $(ADDONS_LIBS_SHARED)
@@ -105,29 +152,61 @@ ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
endif
-
ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
TARGET_CFLAGS = -g
TARGET_LIBS = -lopenFrameworksDebug
TARGET_NAME = Debug
- BIN_NAME = $(APPNAME)_debug
- TARGET = bin/$(BIN_NAME)
endif
ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)
TARGET_LIBS = -lopenFrameworks
TARGET_NAME = Release
- BIN_NAME = $(APPNAME)
- TARGET = bin/$(BIN_NAME)
endif
-ifeq ($(MAKECMDGOALS),)
- TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)
- TARGET_LIBS = -lopenFrameworks
- TARGET_NAME = Release
- BIN_NAME = $(APPNAME)
- TARGET = bin/$(BIN_NAME)
+ifeq ($(ARCH),android)
+ ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
+ TARGET = libs/armeabi/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworksDebug
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
+ TARGET = libs/armeabi/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworks
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
+ TARGET_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfp
+ TARGET = libs/armeabi-v7a/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworks_arm7
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring TestLink,$(MAKECMDGOALS)),TestLink)
+ TARGET_NAME = Debug
+ TARGET_LIBS = -lopenFrameworksDebug
+ LDFLAGS += -Wl,--entry=main
+ BIN_NAME = $(APPNAME)
+ TARGET = obj/$(BIN_NAME)
+ endif
+else
+ ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
+ BIN_NAME = $(APPNAME)_debug
+ TARGET = bin/$(BIN_NAME)
+ endif
+
+ ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
+ BIN_NAME = $(APPNAME)
+ TARGET = bin/$(BIN_NAME)
+ endif
+
+ ifeq ($(MAKECMDGOALS),)
+ TARGET_NAME = Release
+ BIN_NAME = $(APPNAME)
+ TARGET = bin/$(BIN_NAME)
+ endif
endif
ifeq ($(MAKECMDGOALS),clean)
@@ -143,7 +222,7 @@ ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
DEPFILES += $(patsubst %.o,%.d,$(ADDONS_OBJS))
endif
-.PHONY: Debug Release all after
+.PHONY: Debug Release all after afterDebugAndroid afterReleaseAndroid
Release: $(TARGET) after
@@ -151,6 +230,24 @@ Debug: $(TARGET) after
all:
make Release
+
+
+
+DebugAndroid: $(TARGET)
+
+ReleaseAndroid: $(TARGET)
+
+Release_arm7Android: $(TARGET) afterReleaseAndroid
+
+TestLinkAndroid: $(TARGET) afterDebugAndroid
+
+AndroidDebug:
+ make DebugAndroid
+ make TestLinkAndroid
+
+AndroidRelease:
+ make ReleaseAndroid
+ make Release_arm7Android
#This rule does the compilation
@@ -177,12 +274,12 @@ $(OBJ_OUTPUT)%.o: ../../../%.c
$(CC) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $<
$(TARGET): $(OBJS) $(ADDONS_OBJS)
- @echo "linking" $(TARGET) $(GTK)
- $(CXX) -o $@ $(OBJS) $(ADDONS_OBJS) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(LIBS) $(ADDONSLIBS) $(USER_LIBS)
+ @echo "linking" $(TARGET)
+ $(CXX) -o $@ $(OBJS) $(ADDONS_OBJS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(ADDONSLIBS) $(USER_LIBS) $(LIBS)
-include $(DEPFILES)
-.PHONY: clean CleanDebug CleanRelease
+.PHONY: clean CleanDebug CleanRelease CleanAndroid
clean:
rm -Rf obj
rm -f -v $(TARGET)
@@ -191,8 +288,23 @@ clean:
$(CLEANTARGET):
rm -Rf -v $(OBJ_OUTPUT)
rm -f -v $(TARGET)
+
+CleanAndroid:
+ rm -Rf obj
+ rm -f -v libs/armeabi_v7a/libOFAndroidApp.so
+ rm -f -v libs/armeabi/libOFAndroidApp.so
+ rm -f -v obj/$(APPNAME)
+afterDebugAndroid:
+ if [ -f libs/armeabi_v7a/libOFAndroidApp.so ]; then rm libs/armeabi_v7a/libOFAndroidApp.so; fi
+ if [ -f obj/$(BINNAME) ]; then rm obj/$(BINNAME); fi
+ touch AndroidManifest.xml
+
+afterReleaseAndroid:
+ if [ -f obj/$(BINNAME) ]; then rm obj/$(BINNAME); fi
+ touch AndroidManifest.xml
+
after:
cp -r ../../../export/$(LIBSPATH)/libs bin/
@echo
View
184 apps/addonsExamples/networkTcpServerExample/makefile
@@ -25,7 +25,17 @@
# edit the following vars to customize the makefile
-COMPILER_OPTIMIZATION = -march=native -mtune=native -O3
+ifeq ($(findstring Android,$(MAKECMDGOALS)),Android)
+ ARCH = android
+endif
+
+ifeq ($(ARCH),android)
+ COMPILER_OPTIMIZATION = -O3
+ HOST_PLATFORM = linux-x86
+ NDK_PLATFORM = android-9
+else
+ COMPILER_OPTIMIZATION = -march=native -mtune=native -O3
+endif
EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj"
USER_CFLAGS =
USER_LD_FLAGS =
@@ -38,13 +48,32 @@ USER_LIBS =
SHELL = /bin/sh
-CXX = g++
-
-ARCH = $(shell uname -m)
-ifeq ($(ARCH),x86_64)
- LIBSPATH=linux64
+ifneq ($(ARCH),android)
+ CXX = g++
+ ARCH = $(shell uname -m)
+ ifeq ($(ARCH),x86_64)
+ LIBSPATH=linux64
+ else
+ LIBSPATH=linux
+ endif
else
- LIBSPATH=linux
+ ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
+ LIBSPATH =android/armeabi-v7a
+ else
+ LIBSPATH =android/armeabi
+ endif
+ NDK_ROOT = $(shell cat ../../../libs/openFrameworksCompiled/project/android/ndk_path.make)
+ SDK_ROOT = $(shell cat ../../../libs/openFrameworksCompiled/project/android/sdk_path.make)
+ TOOLCHAIN=arm-linux-androideabi-4.4.3
+ TOOLCHAIN_PATH=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/
+ ANDROID_PREFIX=arm-linux-androideabi-
+ CC=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)gcc
+ CXX=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)g++
+ AR=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)ar
+ SYSROOT=$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/
+ CFLAGS += -nostdlib --sysroot=$(SYSROOT) -fno-short-enums
+ CFLAGS += -I"$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/usr/include" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/include/" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include"
+ CFLAGS += -DANDROID
endif
NODEPS = clean
@@ -55,42 +84,60 @@ OBJFILES = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES)))
APPNAME = $(shell basename `pwd`)
CORE_INCLUDES = $(shell find ../../../libs/openFrameworks/ -type d)
CORE_INCLUDE_FLAGS = $(addprefix -I,$(CORE_INCLUDES))
-INCLUDES = $(shell find ../../../libs/*/include -type d)
+INCLUDES = $(shell find ../../../libs/*/include -type d | grep -v glu)
INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))
+ifeq ($(ARCH),android)
+ INCLUDES_FLAGS += -I../../../libs/glu/include_android
+else
+ INCLUDES_FLAGS += -I../../../libs/glu/include
+ INCLUDES_FLAGS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --cflags)
+ #check if gtk exists and add it
+ GTK = $(shell pkg-config gtk+-2.0 --exists; echo $$?)
+ ifeq ($(GTK),0)
+ CFLAGS += $(shell pkg-config gtk+-2.0 --cflags) -DOF_USING_GTK
+ LIBS += $(shell pkg-config gtk+-2.0 --libs)
+ endif
+endif
LIB_STATIC = $(shell ls ../../../libs/*/lib/$(LIBSPATH)/*.a | grep -v openFrameworksCompiled | grep -v poco| sed "s/.*\\/lib\([^/]*\)\.a/-l\1/")
LIB_SHARED = $(shell ls ../../../libs/*/lib/$(LIBSPATH)/*.so | grep -v openFrameworksCompiled| sed "s/.*\\/lib\([^/]*\)\.so/-l\1/")
LIB_STATIC += ../../../libs/poco/lib/$(LIBSPATH)/libPocoNet.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoXML.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoUtil.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoFoundation.a
LIB_PATHS_FLAGS = $(shell ls -d ../../../libs/*/lib/$(LIBSPATH) | sed "s/\(\.*\)/-L\1/")
+ifeq ($(ARCH),android)
+ LIB_PATHS_FLAGS += -L../../../libs/openFrameworksCompiled/lib/android
+endif
-CFLAGS = -Wall -fexceptions
+CFLAGS += -Wall -fexceptions
CFLAGS += -I.
CFLAGS += $(INCLUDES_FLAGS)
CFLAGS += $(CORE_INCLUDE_FLAGS)
-CFLAGS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --cflags)
-LDFLAGS = $(LIB_PATHS_FLAGS) -Wl,-rpath=./libs
LIBS = $(LIB_SHARED)
LIBS += $(LIB_STATIC)
-LIBS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --libs)
-LIBS += -lglut -lGL -lGLU -lasound
-
-#check if gtk exists and add it
-GTK = $(shell pkg-config gtk+-2.0 --exists; echo $$?)
-ifeq ($(GTK),0)
- CFLAGS += $(shell pkg-config gtk+-2.0 --cflags) -DOF_USING_GTK
- LIBS += $(shell pkg-config gtk+-2.0 --libs)
+ifeq ($(ARCH),android)
+ LDFLAGS = $(LIB_PATHS_FLAGS) --sysroot=$(SYSROOT) -nostdlib -L"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi"
+ LIBS += -lstdc++ -lsupc++ -lGLU -lgcc -lz -lGLESv1_CM -llog -ldl -lm -lc
+else
+ LDFLAGS = $(LIB_PATHS_FLAGS) -Wl,-rpath=./libs
+ LIBS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --libs)
+ LIBS += -lglut -lGL -lGLU -lasound
endif
+
ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
ADDONS_INCLUDES = $(shell find ../../../addons/*/src/ -type d)
ADDONS_INCLUDES += $(shell find ../../../addons/*/libs/ -type d)
ADDONSCFLAGS = $(addprefix -I,$(ADDONS_INCLUDES))
- ADDONS_LIBS_STATICS = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.a)
+ ifeq ($(findstring libsorder.make,$(wildcard ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make)),libsorder.make)
+ ADDONS_LIBS_W_ORDER = $(addprefix -l,$(shell cat ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make))
+ endif
+
+ ADDONS_LIBS_STATICS = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.a | grep -v $(ADDONS_LIBS_W_ORDER))
+ ADDONS_LIBS_STATICS += $(ADDONS_LIBS_W_ORDER)
+ ADDONS_LIBS_STATICS += $(addprefix -L, $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/libsorder.make | sed s/libsorder.make//g))
ADDONS_LIBS_SHARED = $(shell ls ../../../addons/*/libs/*/lib/$(LIBSPATH)/*.so)
-
ADDONSLIBS = $(ADDONS_LIBS_STATICS)
ADDONSLIBS += $(ADDONS_LIBS_SHARED)
@@ -105,29 +152,61 @@ ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
endif
-
ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
TARGET_CFLAGS = -g
TARGET_LIBS = -lopenFrameworksDebug
TARGET_NAME = Debug
- BIN_NAME = $(APPNAME)_debug
- TARGET = bin/$(BIN_NAME)
endif
ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)
TARGET_LIBS = -lopenFrameworks
TARGET_NAME = Release
- BIN_NAME = $(APPNAME)
- TARGET = bin/$(BIN_NAME)
endif
-ifeq ($(MAKECMDGOALS),)
- TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)
- TARGET_LIBS = -lopenFrameworks
- TARGET_NAME = Release
- BIN_NAME = $(APPNAME)
- TARGET = bin/$(BIN_NAME)
+ifeq ($(ARCH),android)
+ ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
+ TARGET = libs/armeabi/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworksDebug
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
+ TARGET = libs/armeabi/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworks
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
+ TARGET_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfp
+ TARGET = libs/armeabi-v7a/libOFAndroidApp.so
+ TARGET_LIBS = -lopenFrameworks_arm7
+ LDFLAGS += -shared
+ endif
+
+ ifeq ($(findstring TestLink,$(MAKECMDGOALS)),TestLink)
+ TARGET_NAME = Debug
+ TARGET_LIBS = -lopenFrameworksDebug
+ LDFLAGS += -Wl,--entry=main
+ BIN_NAME = $(APPNAME)
+ TARGET = obj/$(BIN_NAME)
+ endif
+else
+ ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)
+ BIN_NAME = $(APPNAME)_debug
+ TARGET = bin/$(BIN_NAME)
+ endif
+
+ ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)
+ BIN_NAME = $(APPNAME)
+ TARGET = bin/$(BIN_NAME)
+ endif
+
+ ifeq ($(MAKECMDGOALS),)
+ TARGET_NAME = Release
+ BIN_NAME = $(APPNAME)
+ TARGET = bin/$(BIN_NAME)
+ endif
endif
ifeq ($(MAKECMDGOALS),clean)
@@ -143,7 +222,7 @@ ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)
DEPFILES += $(patsubst %.o,%.d,$(ADDONS_OBJS))
endif
-.PHONY: Debug Release all after
+.PHONY: Debug Release all after afterDebugAndroid afterReleaseAndroid
Release: $(TARGET) after
@@ -151,6 +230,24 @@ Debug: $(TARGET) after
all:
make Release
+
+
+
+DebugAndroid: $(TARGET)
+
+ReleaseAndroid: $(TARGET)
+
+Release_arm7Android: $(TARGET) afterReleaseAndroid
+
+TestLinkAndroid: $(TARGET) afterDebugAndroid
+
+AndroidDebug:
+ make DebugAndroid
+ make TestLinkAndroid
+
+AndroidRelease:
+ make ReleaseAndroid
+ make Release_arm7Android
#This rule does the compilation
@@ -177,12 +274,12 @@ $(OBJ_OUTPUT)%.o: ../../../%.c
$(CC) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $<
$(TARGET): $(OBJS) $(ADDONS_OBJS)
- @echo "linking" $(TARGET) $(GTK)
- $(CXX) -o $@ $(OBJS) $(ADDONS_OBJS) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(LIBS) $(ADDONSLIBS) $(USER_LIBS)
+ @echo "linking" $(TARGET)
+ $(CXX) -o $@ $(OBJS) $(ADDONS_OBJS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(ADDONSLIBS) $(USER_LIBS) $(LIBS)
-include $(DEPFILES)
-.PHONY: clean CleanDebug CleanRelease
+.PHONY: clean CleanDebug CleanRelease CleanAndroid
clean:
rm -Rf obj
rm -f -v $(TARGET)
@@ -191,8 +288,23 @@ clean:
$(CLEANTARGET):
rm -Rf -v $(OBJ_OUTPUT)
rm -f -v $(TARGET)
+
+CleanAndroid:
+ rm -Rf obj
+ rm -f -v libs/armeabi_v7a/libOFAndroidApp.so
+ rm -f -v libs/armeabi/libOFAndroidApp.so
+ rm -f -v obj/$(APPNAME)
+afterDebugAndroid:
+ if [ -f libs/armeabi_v7a/libOFAndroidApp.so ]; then rm libs/armeabi_v7a/libOFAndroidApp.so; fi
+ if [ -f obj/$(BINNAME) ]; then rm obj/$(BINNAME); fi
+ touch AndroidManifest.xml
+
+afterReleaseAndroid:
+ if [ -f obj/$(BINNAME) ]; then rm obj/$(BINNAME); fi
+ touch AndroidManifest.xml
+
after:
cp -r ../../../export/$(LIBSPATH)/libs bin/
@echo
View
184 apps/addonsExamples/networkUdpReceiverExample/makefile
@@ -25,7 +25,17 @@
# edit the following vars to customize the makefile
-COMPILER_OPTIMIZATION = -march=native -mtune=native -O3
+ifeq ($(findstring Android,$(MAKECMDGOALS)),Android)
+ ARCH = android
+endif
+
+ifeq ($(ARCH),android)
+ COMPILER_OPTIMIZATION = -O3
+ HOST_PLATFORM = linux-x86
+ NDK_PLATFORM = android-9
+else
+ COMPILER_OPTIMIZATION = -march=native -mtune=native -O3
+endif
EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj"
USER_CFLAGS =
USER_LD_FLAGS =
@@ -38,13 +48,32 @@ USER_LIBS =
SHELL = /bin/sh
-CXX = g++
-
-ARCH = $(shell uname -m)
-ifeq ($(ARCH),x86_64)
- LIBSPATH=linux64
+ifneq ($(ARCH),android)
+ CXX = g++
+ ARCH = $(shell uname -m)
+ ifeq ($(ARCH),x86_64)
+ LIBSPATH=linux64
+ else
+ LIBSPATH=linux
+ endif
else
- LIBSPATH=linux
+ ifeq ($(findstring Release_arm7,$(MAKECMDGOALS)),Release_arm7)
+ LIBSPATH =android/armeabi-v7a
+ else
+ LIBSPATH =android/armeabi
+ endif
+ NDK_ROOT = $(shell cat ../../../libs/openFrameworksCompiled/project/android/ndk_path.make)
+ SDK_ROOT = $(shell cat ../../../libs/openFrameworksCompiled/project/android/sdk_path.make)
+ TOOLCHAIN=arm-linux-androideabi-4.4.3
+ TOOLCHAIN_PATH=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/
+ ANDROID_PREFIX=arm-linux-androideabi-
+ CC=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)gcc
+ CXX=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)g++
+ AR=$(NDK_ROOT)/toolchains/$(TOOLCHAIN)/prebuilt/$(HOST_PLATFORM)/bin/$(ANDROID_PREFIX)ar
+ SYSROOT=$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/
+ CFLAGS += -nostdlib --sysroot=$(SYSROOT) -fno-short-enums
+ CFLAGS += -I"$(NDK_ROOT)/platforms/$(NDK_PLATFORM)/arch-arm/usr/include" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/include/" -I"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include"
+ CFLAGS += -DANDROID
endif
NODEPS = clean
@@ -55,42 +84,60 @@ OBJFILES = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES)))
APPNAME = $(shell basename `pwd`)
CORE_INCLUDES = $(shell find ../../../libs/openFrameworks/ -type d)
CORE_INCLUDE_FLAGS = $(addprefix -I,$(CORE_INCLUDES))
-INCLUDES = $(shell find ../../../libs/*/include -type d)
+INCLUDES = $(shell find ../../../libs/*/include -type d | grep -v glu)
INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))
+ifeq ($(ARCH),android)
+ INCLUDES_FLAGS += -I../../../libs/glu/include_android
+else
+ INCLUDES_FLAGS += -I../../../libs/glu/include
+ INCLUDES_FLAGS += $(shell pkg-config glew gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --cflags)
+ #check if gtk exists and add it
+ GTK = $(shell pkg-config gtk+-2.0 --exists; echo $$?)
+ ifeq ($(GTK),0)
+ CFLAGS += $(shell pkg-config gtk+-2.0 --cflags) -DOF_USING_GTK
+ LIBS += $(shell pkg-config gtk+-2.0 --libs)
+ endif
+endif
LIB_STATIC = $(shell ls ../../../libs/*/lib/$(LIBSPATH)/*.a | grep -v openFrameworksCompiled | grep -v poco| sed "s/.*\\/lib\([^/]*\)\.a/-l\1/")
LIB_SHARED = $(shell ls ../../../libs/*/lib/$(LIBSPATH)/*.so | grep -v openFrameworksCompiled| sed "s/.*\\/lib\([^/]*\)\.so/-l\1/")
LIB_STATIC += ../../../libs/poco/lib/$(LIBSPATH)/libPocoNet.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoXML.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoUtil.a ../../../libs/poco/lib/$(LIBSPATH)/libPocoFoundation.a
LIB_PATHS_FLAGS = $(shell ls -d ../../../libs/*/lib/$(LIBSPATH) | sed "s/\(\.*\)/-L\1/")
+ifeq ($(ARCH),android)
+ LIB_PATHS_FLAGS += -L../../../libs/openFrameworksCompiled/lib/android
+endif
-CFLAGS = -Wall -fexceptions
+CFLAGS += -Wall -fexceptions
CFLAGS += -I.
CFLAGS += $(INCLUDES_FLAGS)
CFLAGS += $(CORE_INCLUDE_FLAGS