Guest User

Untitled

a guest
Jul 11th, 2012
122
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Makefile for linux
  2. # Could be extended to support Mac in future
  3.  
  4. rsync ?= yes
  5. CROSS_COMPILE = arm-angstrom-linux-gnueabi-
  6. gcc4-1 = yes
  7. platform = Vanilla
  8. devroot = /home/mark/bugkernel/bug20-2.6.35-linaro
  9.  
  10.  
  11.  
  12. ifeq ($(rsync),yes)
  13. cp = rsync -u
  14. else
  15. cp = cp -u
  16. endif
  17.  
  18. ifeq ($(debug),1)
  19. debug_specific_cflags = -g -O0
  20. build_dir = Debug
  21. else
  22. debug_specific_cflags = -O2
  23. build_dir = Release
  24. endif
  25.  
  26. MACHINE = $(shell uname -s)
  27. ifeq ($(MACHINE), Darwin)
  28. ifeq ($(mac-arm),1)
  29. # Darwin, ARM -> iOS
  30. platform ?= iOS
  31. linkopts_ohNet =
  32. #devroot=/Developer/Platforms/iPhoneOS.platform/Developer
  33. sdkroot=$(devroot)/SDKs/iPhoneOS5.0.sdk
  34. platform_cflags = -I$(sdkroot)/usr/lib/gcc/arm-apple-darwin10/4.2.1/include/ -I$(sdkroot)/usr/include/ -I/usr/bin/arm-apple-darwin10-gcc -miphoneos-version-min=2.2 -pipe -no-cpp-precomp -isysroot $(sdkroot) -DPLATFORM_MACOSX_GNU -DPLATFORM_IOS -I$(sdkroot)/usr/include/c++/4.2.1/armv6-apple-darwin10/
  35. # It seems a bit weird that iOS uses a sub-dir of Build/Obj/Mac, is that deliberate? --AW
  36. osbuilddir = Mac/arm
  37. objdir = Build/Obj/Mac/arm/$(build_dir)/
  38. platform_linkflags = -L$(sdkroot)/usr/lib/ -arch armv6 -L$(sdkroot)/usr/lib/system
  39. compiler = $(devroot)/usr/bin/llvm-gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -o $(objdir)
  40. # No support for linking Shared Objects for ARM MAC
  41. # link = $(devroot)/usr/bin/llvm-gcc-4.2 -pthread -Wl $(platform_linkflags)
  42. ar = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar rc $(objdir)
  43.  
  44. else
  45. # Darwin, not ARM -> Intel Mac
  46. platform ?= IntelMac
  47. linkopts_ohNet = -Wl,-install_name,@loader_path/libohNet.dylib
  48. ifeq ($(mac-64),1)
  49. platform_cflags = -DPLATFORM_MACOSX_GNU -arch x86_64 -mmacosx-version-min=10.4
  50. platform_linkflags = -arch x86_64 -framework CoreFoundation -framework SystemConfiguration
  51. else
  52. platform_cflags = -DPLATFORM_MACOSX_GNU -m32 -mmacosx-version-min=10.4
  53. platform_linkflags = -m32 -framework CoreFoundation -framework SystemConfiguration
  54. endif
  55.  
  56. osbuilddir = Mac
  57. objdir = Build/Obj/Mac/$(build_dir)/
  58. compiler = ${CROSS_COMPILE}gcc -fPIC -o $(objdir)
  59. link = ${CROSS_COMPILE}g++ -pthread $(platform_linkflags)
  60. ar = ${CROSS_COMPILE}ar rc $(objdir)
  61.  
  62. endif
  63. else
  64. # Not Darwin
  65. platform ?= Vanilla
  66. # At present, platform == Vanilla is used for Kirkwood, x86 and x64 Posix builds.
  67.  
  68. ifeq ($(platform), Core)
  69. # platform == Core
  70. freertoslwipdir ?= ${FREERTOSLWIP}
  71. platform_cflags = -I$(freertoslwipdir)/include/ -I$(freertoslwipdir)/include/FreeRTOS/ -I$(freertoslwipdir)/include/lwip/ -mcpu=403
  72. platform_linkflags = -B$(freertoslwipdir)/lib/ -specs bsp_specs -mcpu=403
  73. linkopts_ohNet =
  74. osbuilddir = Volkano2
  75. osdir = Volkano2
  76. endian = BIG
  77. native_only = yes
  78. endif
  79.  
  80. ifeq ($(gcc4-1), yes)
  81. version_specific_cflags =
  82. version_specific_linkflags = -B${CROSS_COMPILE} -L${CROSS_COMPILE}../../lib -L${CROSS_COMPILE}../lib
  83. version_specific_library_path = LD_LIBRARY_PATH=${CROSS_COMPILE}../lib
  84. version_specific_cflags_third_party = -Wno-non-virtual-dtor
  85. version_specific_includes = -I${CROSS_COMPILE}../include
  86. version_specific_java_cflags = -Wstrict-aliasing=0
  87. else
  88. # version_specific_cflags = -Wno-psabi
  89. version_specific_linkflags =
  90. version_specific_library_path =
  91. version_specific_cflags_third_party =
  92. version_specific_includes =
  93. version_specific_java_cflags =
  94. endif
  95.  
  96. ifeq ($(platform), Vanilla)
  97. # platform == Vanilla (i.e. Kirkwood, x86 or x64)
  98. platform_cflags = $(version_specific_cflags) -fPIC
  99. platform_linkflags = $(version_specific_linkflags) -pthread
  100. linkopts_ohNet = -Wl,-soname,libohNet.so
  101. osbuilddir = Posix
  102. osdir = Posix
  103. endian = LITTLE
  104. endif
  105.  
  106. # Continuing with the non-Darwin settings...
  107. objdir = Build/Obj/$(osdir)/$(build_dir)/
  108. compiler = ${CROSS_COMPILE}gcc -o $(objdir)
  109. link = $(version_specific_library_path) ${CROSS_COMPILE}g++ $(platform_linkflags)
  110. ar = $(version_specific_library_path) ${CROSS_COMPILE}ar rc $(objdir)
  111.  
  112. endif
  113.  
  114. # Macros used by Common.mak
  115. native_only ?= no
  116. endian ?= LITTLE
  117. cflags_base = -fexceptions -Wall $(version_specific_cflags_third_party) -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_$(endian)_ENDIAN -DDEFINE_TRACE $(debug_specific_cflags) -fvisibility=hidden $(platform_cflags)
  118. cflags_third_party = $(cflags_base) -Wno-int-to-pointer-cast
  119. cflags = $(cflags_base) -Werror
  120. inc_build = Build/Include
  121. includes = -IBuild/Include/ $(version_specific_includes)
  122. bundle_build = Build/Bundles
  123. osdir ?= Posix
  124. objext = o
  125. libprefix = lib
  126. libext = a
  127. sharedlibprefix = lib
  128. ifeq ($(MACHINE), Darwin)
  129. sharedlibext = dylib
  130. dllext = dylib
  131. else
  132. sharedlibext = so
  133. dllext = so
  134. endif
  135. exeext = elf
  136. linkoutput = -o
  137. dllprefix = lib
  138. link_dll = $(version_specific_library_path) ${CROSS_COMPILE}g++ -pthread $(platform_linkflags) -shared -shared-libgcc
  139. link_dll_service = $(version_specific_library_path) ${CROSS_COMPILE}g++ -pthread $(platform_linkflags) -shared -shared-libgcc -lohNet -L$(objdir)
  140. csharp = dmcs /nologo
  141. publicjavadir = OpenHome/Net/Bindings/Java/
  142.  
  143. ifeq ($(platform), IntelMac)
  144. includes_jni = -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/include/malloc
  145. link_jvm = /System/Library/Frameworks/JavaVM.framework/JavaVM
  146. javac = /usr/bin/javac
  147. jar = /usr/bin/jar
  148. else
  149. includes_jni = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
  150. libjvm_dir = /home/mark/arm-jvm/jvm/java-6-openjdk/jre/lib/arm/server
  151. link_jvm = $(libjvm_dir)/libjvm.so
  152. javac = $(JAVA_HOME)/bin/javac
  153. jar = $(JAVA_HOME)/bin/jar
  154. endif
  155.  
  156. java_cflags = -fexceptions -Wall $(version_specific_java_cflags) -Werror -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE $(debug_specific_cflags) $(platform_cflags)
  157. jarflags = cf
  158. dirsep = /
  159. prefix = /usr/local
  160. installlibdir = $(prefix)/lib/ohNet
  161. installincludedir = $(prefix)/include/ohNet
  162. installpkgconfdir = $(prefix)/lib/pkgconfig
  163. mkdir = mkdir -p
  164. rmdir = rm -rf
  165. uset4 = no
  166.  
  167. ifeq ($(native_only), yes)
  168. build_targets = $(native_targets)
  169. else
  170. build_targets = $(all_targets)
  171. endif
  172.  
  173. default : all
  174.  
  175.  
  176. ifeq (,$(findstring clean,$(MAKECMDGOALS)))
  177. # Include the rules to prepare the template engine and the macros to use it.
  178. ifeq ($(uset4), yes)
  179. include T4Linux.mak
  180. endif
  181.  
  182. # Actual building of code is shared between platforms
  183. include Common.mak
  184.  
  185. # Include the generated makefiles. Because nmake on Windows requires contortions to
  186. # include such files and handle their non-existance, these includes have to be at
  187. # the platform-specific level.
  188. ifeq ($(uset4),yes)
  189. include Generated/GenerateSourceFiles.mak
  190. endif
  191.  
  192. include Generated/Proxies.mak
  193. include Generated/Devices.mak
  194.  
  195. endif
  196. include UserTargets.mak
  197.  
  198. # Following macros must be provided by each file which wraps Common.mak
  199.  
  200. make_obj_dir:
  201. $(mkdir) $(objdir)
  202.  
  203. copy_build_includes:
  204. $(mkdir) $(inc_build)
  205. $(mkdir) $(inc_build)/OpenHome
  206. $(mkdir) $(inc_build)/OpenHome/Private
  207. $(mkdir) $(inc_build)/OpenHome/Net
  208. $(mkdir) $(inc_build)/OpenHome/Net/Private
  209. $(mkdir) $(inc_build)/OpenHome/Net/Core
  210. $(mkdir) $(inc_build)/OpenHome/Net/C
  211. $(mkdir) $(inc_build)/OpenHome/Net/Cpp
  212. $(mkdir) $(inc_build)/OpenHome/Net/Private/Js
  213. $(mkdir) $(inc_build)/OpenHome/Net/Private/Js/Tests
  214. $(mkdir) $(inc_build)/OpenHome/Net/Private/Js/Tests/lib
  215. $(mkdir) $(inc_build)/OpenHome/Net/Private/Js/Tests/proxies
  216. $(cp) OpenHome/*.h $(inc_build)/OpenHome/Private
  217. $(cp) OpenHome/Buffer.inl $(inc_build)/OpenHome
  218. rm $(inc_build)/OpenHome/Private/Buffer.h
  219. rm $(inc_build)/OpenHome/Private/Exception.h
  220. rm $(inc_build)/OpenHome/Private/Functor*.h
  221. rm $(inc_build)/OpenHome/Private/MimeTypes.h
  222. rm $(inc_build)/OpenHome/Private/OhNetDefines.h
  223. rm $(inc_build)/OpenHome/Private/OsTypes.h
  224. rm $(inc_build)/OpenHome/Private/OhNetTypes.h
  225. $(cp) OpenHome/Buffer.h $(inc_build)/OpenHome
  226. $(cp) OpenHome/Exception.h $(inc_build)/OpenHome
  227. $(cp) OpenHome/Functor*.h $(inc_build)/OpenHome
  228. $(cp) OpenHome/MimeTypes.h $(inc_build)/OpenHome
  229. $(cp) OpenHome/OhNetDefines.h $(inc_build)/OpenHome
  230. $(cp) OpenHome/OsTypes.h $(inc_build)/OpenHome
  231. $(cp) OpenHome/OhNetTypes.h $(inc_build)/OpenHome
  232. $(cp) OpenHome/TestFramework/*.h $(inc_build)/OpenHome/Private
  233. $(cp) OpenHome/Net/*.h $(inc_build)/OpenHome/Net/Private
  234. rm $(inc_build)/OpenHome/Net/Private/FunctorAsync.h
  235. rm $(inc_build)/OpenHome/Net/Private/OhNet.h
  236. $(cp) OpenHome/Net/FunctorAsync.h $(inc_build)/OpenHome/Net/Core
  237. $(cp) OpenHome/Net/FunctorAsync.h $(inc_build)/OpenHome/Net/Cpp
  238. $(cp) OpenHome/Net/OhNet.h $(inc_build)/OpenHome/Net/Core
  239. $(cp) OpenHome/Net/OhNet.h $(inc_build)/OpenHome/Net/Cpp
  240. $(cp) OpenHome/Net/Shell/*.h $(inc_build)/OpenHome/Net/Private
  241. $(cp) OpenHome/Net/ControlPoint/AsyncPrivate.h $(inc_build)/OpenHome/Net/Private
  242. $(cp) OpenHome/Net/ControlPoint/CpStack.h $(inc_build)/OpenHome/Net/Core
  243. $(cp) OpenHome/Net/ControlPoint/CpDevice.h $(inc_build)/OpenHome/Net/Core
  244. $(cp) OpenHome/Net/ControlPoint/CpDeviceDv.h $(inc_build)/OpenHome/Net/Core
  245. $(cp) OpenHome/Net/ControlPoint/CpDeviceUpnp.h $(inc_build)/OpenHome/Net/Core
  246. $(cp) OpenHome/Net/ControlPoint/CpProxy.h $(inc_build)/OpenHome/Net/Core
  247. $(cp) OpenHome/Net/ControlPoint/CpProxy.h $(inc_build)/OpenHome/Net/Cpp
  248. $(cp) OpenHome/Net/ControlPoint/FunctorCpDevice.h $(inc_build)/OpenHome/Net/Core
  249. $(cp) OpenHome/Net/ControlPoint/Cpi*.h $(inc_build)/OpenHome/Net/Private
  250. $(cp) OpenHome/Net/ControlPoint/FunctorCpiDevice.h $(inc_build)/OpenHome/Net/Private
  251. $(cp) OpenHome/Net/ControlPoint/Dv/CpiDeviceDv.h $(inc_build)/OpenHome/Net/Private
  252. $(cp) OpenHome/Net/ControlPoint/Proxies/*.h $(inc_build)/OpenHome/Net/Core
  253. $(cp) OpenHome/Net/ControlPoint/Upnp/*.h $(inc_build)/OpenHome/Net/Private
  254. $(cp) OpenHome/Net/Device/DvStack.h $(inc_build)/OpenHome/Net/Core
  255. $(cp) OpenHome/Net/Device/DvDevice.h $(inc_build)/OpenHome/Net/Core
  256. $(cp) OpenHome/Net/Device/DvInvocationResponse.h $(inc_build)/OpenHome/Net/Core
  257. $(cp) OpenHome/Net/Device/DvProvider.h $(inc_build)/OpenHome/Net/Core
  258. $(cp) OpenHome/Net/Device/DvProvider.h $(inc_build)/OpenHome/Net/Cpp
  259. $(cp) OpenHome/Net/Device/DvResourceWriter.h $(inc_build)/OpenHome/Net/Core
  260. $(cp) OpenHome/Net/Device/DvResourceWriter.h $(inc_build)/OpenHome/Net/Cpp
  261. $(cp) OpenHome/Net/Device/DvServerUpnp.h $(inc_build)/OpenHome/Net/Core
  262. $(cp) OpenHome/Net/Device/DvServerUpnp.h $(inc_build)/OpenHome/Net/Cpp
  263. $(cp) OpenHome/Net/Device/DviDevice.h $(inc_build)/OpenHome/Net/Private
  264. $(cp) OpenHome/Net/Device/DviServer.h $(inc_build)/OpenHome/Net/Private
  265. $(cp) OpenHome/Net/Device/DviService.h $(inc_build)/OpenHome/Net/Private
  266. $(cp) OpenHome/Net/Device/DviStack.h $(inc_build)/OpenHome/Net/Private
  267. $(cp) OpenHome/Net/Device/DviSubscription.h $(inc_build)/OpenHome/Net/Private
  268. $(cp) OpenHome/Net/Device/DviPropertyUpdateCollection.h $(inc_build)/OpenHome/Net/Private
  269. $(cp) OpenHome/Net/Device/FunctorDviInvocation.h $(inc_build)/OpenHome/Net/Private
  270. $(cp) OpenHome/Net/Device/DviProviderSubscriptionLongPoll.h $(inc_build)/OpenHome/Net/Private
  271. $(cp) OpenHome/Net/Device/Bonjour/*.h $(inc_build)/OpenHome/Net/Private
  272. $(cp) OpenHome/Net/Device/Bonjour/mDNSCore/*.h $(inc_build)/OpenHome/Net/Private
  273. $(cp) OpenHome/Net/Device/Providers/*.h $(inc_build)/OpenHome/Net/Core
  274. $(cp) OpenHome/Net/Device/Upnp/*.h $(inc_build)/OpenHome/Net/Private
  275. $(cp) OpenHome/Net/Bindings/C/*.h $(inc_build)/OpenHome/Net/C
  276. $(cp) OpenHome/Net/Bindings/C/ControlPoint/*.h $(inc_build)/OpenHome/Net/C
  277. $(cp) OpenHome/Net/Bindings/C/ControlPoint/Proxies/*.h $(inc_build)/OpenHome/Net/C
  278. $(cp) OpenHome/Net/Bindings/C/Device/*.h $(inc_build)/OpenHome/Net/C
  279. $(cp) OpenHome/Net/Bindings/C/Device/Providers/*.h $(inc_build)/OpenHome/Net/C
  280. $(cp) OpenHome/Net/Bindings/Cpp/ControlPoint/*.h $(inc_build)/OpenHome/Net/Cpp
  281. $(cp) OpenHome/Net/Bindings/Cpp/ControlPoint/Proxies/*.h $(inc_build)/OpenHome/Net/Cpp
  282. $(cp) OpenHome/Net/Bindings/Cpp/Device/*.h $(inc_build)/OpenHome/Net/Cpp
  283. $(cp) OpenHome/Net/Bindings/Cpp/Device/Providers/*.h $(inc_build)/OpenHome/Net/Cpp
  284. $(cp) -r OpenHome/Net/Bindings/Js/ControlPoint/Tests/*.* $(inc_build)/OpenHome/Net/Private/Js/Tests
  285. $(cp) OpenHome/Net/Bindings/Js/ControlPoint/lib/*.js $(inc_build)/OpenHome/Net/Private/Js/Tests/lib
  286. $(cp) OpenHome/Net/Bindings/Js/ControlPoint/Proxies/CpOpenhomeOrgTestBasic1.js $(inc_build)/OpenHome/Net/Private/Js/Tests/proxies
  287. $(cp) OpenHome/Net/Bindings/Js/ControlPoint/Proxies/CpOpenhomeOrgSubscriptionLongPoll1.js $(inc_build)/OpenHome/Net/Private/Js/Tests/proxies
  288. $(cp) Os/*.h $(inc_build)/OpenHome
  289. $(cp) Os/*.inl $(inc_build)/OpenHome
  290.  
  291. install : install-pkgconf install-libs install-includes
  292.  
  293. uninstall : uninstall-pkgconf uninstall-libs uninstall-includes
  294.  
  295. install-pkgconf : tt
  296. @echo "ERROR: no support for (un)install-pckconf yet"
  297. #@echo "see http://www.mono-project.com/Guidelines:Application_Deployment for an example of how to implement this"
  298.  
  299. install-libs :
  300. $(mkdir) $(installlibdir)
  301. $(cp) $(objdir)* $(installlibdir)
  302.  
  303. install-includes :
  304. $(mkdir) $(installincludedir)
  305. $(cp) -r $(inc_build)/* $(installincludedir)
  306.  
  307. uninstall-pkgconf :
  308. @echo "ERROR: no support for (un)install-pckconf yet"
  309. #@echo "see http://www.mono-project.com/Guidelines:Application_Deployment for an example of how to implement this"
  310.  
  311. uninstall-libs :
  312. $(rmdir) $(installlibdir)
  313.  
  314. uninstall-includes :
  315. $(rmdir) $(installincludedir)
  316.  
  317. java_packages = ohnet \
  318. openhome.net.controlpoint \
  319. openhome.net.controlpoint.proxies \
  320. openhome.net.core \
  321. org.openhome.net.device \
  322. org.openhome.net.test \
  323.  
  324. docs:
  325. rm -rf Build/Docs
  326. $(mkdir) Build/Docs
  327. $(mkdir) Build/Docs/C
  328. doxygen DoxyfileC
  329. $(mkdir) Build/Docs/CppCore
  330. doxygen DoxyfileCppCore
  331. $(mkdir) Build/Docs/CppStd
  332. doxygen DoxyfileCppStd
  333. $(mkdir) Build/Docs/Cs
  334. doxygen DoxyfileCs
  335. $(mkdir) Build/Docs/Java
  336. doxygen DoxyfileJava
  337. $(mkdir) Build/Docs/Js
  338. perl ./JsDoc/jsdoc.pl -d Build/Docs/Js OpenHome/Net/Bindings/Js/ControlPoint OpenHome/Net/Bindings/Js/ControlPoint/Proxies
  339.  
  340. bundle: tt
  341. $(mkdir) $(bundle_build)
  342. ifeq ($(targetplatform),)
  343. echo Usage: make bundle targetplatform=Linux-x86
  344. else
  345. python bundle_binaries.py $(osbuilddir) $(targetplatform) $(releasetype)
  346. endif
  347.  
  348. bundle-dev: tt
  349. mkdir -p $(bundle_build)
  350. ifeq ($(targetplatform),)
  351. echo Usage: make bundle-dev targetplatform=Linux-x86
  352. else
  353. python bundle_binaries.py --dev $(osbuilddir) $(targetplatform) $(releasetype)
  354. endif
RAW Paste Data