You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.8 KiB

  1. # Copyright 2005-2014 Intel Corporation. All Rights Reserved.
  2. #
  3. # This file is part of Threading Building Blocks.
  4. #
  5. # Threading Building Blocks is free software; you can redistribute it
  6. # and/or modify it under the terms of the GNU General Public License
  7. # version 2 as published by the Free Software Foundation.
  8. #
  9. # Threading Building Blocks is distributed in the hope that it will be
  10. # useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  11. # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with Threading Building Blocks; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. #
  18. # As a special exception, you may use this file as part of a free software
  19. # library without restriction. Specifically, if other files instantiate
  20. # templates or use macros or inline functions from this file, or you compile
  21. # this file and link it with other files to produce an executable, this
  22. # file does not by itself cause the resulting executable to be covered by
  23. # the GNU General Public License. This exception does not however
  24. # invalidate any other reasons why the executable file might be covered by
  25. # the GNU General Public License.
  26. # The C++ compiler
  27. #CXX=g++
  28. # detecting MS Windows (for MinGW support)
  29. ifeq ($(OS), Windows_NT)
  30. RM = cmd /C del /Q /F
  31. RD = cmd /C rmdir
  32. UI = con
  33. EXE = $(NAME)$(SUFFIX).exe
  34. else
  35. RM = rm -f
  36. RD = rmdir -r
  37. # detecting 64-bit platform
  38. arch ?= $(shell uname -m)
  39. # Possible values of interest: intel64 x86_64 amd64 ia64 ppc64 sparc sparc64
  40. x64 ?= $(findstring 64,$(subst sparc,sparc64,$(arch)))
  41. # detecting UI ("mac", "x" or "con")
  42. ifeq ($(shell uname),Darwin)
  43. UI ?= mac
  44. else
  45. UI ?= $(shell sh -c "[ -f /usr/X11R6/lib$(x64)/libX11.so -o -f /usr/lib$(x64)/libX11.so ] && echo x || echo con")
  46. endif
  47. ifeq ($(UI),x)
  48. EXE = $(NAME)$(SUFFIX)
  49. UI_CXXFLAGS += -I/usr/X11R6/include
  50. LIBS += -lpthread -L/usr/X11R6/lib$(x64) -lX11
  51. # detect if libXext can be found
  52. ifeq ($(shell sh -c "[ -f /usr/X11R6/lib$(x64)/libXext.so -o -f /usr/lib$(x64)/libXext.so ] && echo 0"),0)
  53. LIBS += -lXext
  54. else # no libXext
  55. UI_CXXFLAGS += -DX_NOSHMEM
  56. endif # libXext
  57. else # ! X
  58. ifeq ($(UI),mac)
  59. CXX_UI?=g++
  60. LIBS += -framework OpenGL -framework Foundation -framework Cocoa
  61. MACUISOURCES = ../../common/gui/xcode/tbbExample/OpenGLView.m ../../common/gui/xcode/tbbExample/main.m ../../common/gui/xcode/tbbExample/tbbAppDelegate.m
  62. MACUIOBJS = OpenGLView.o main.o tbbAppDelegate.o
  63. APPRES = $(NAME)$(SUFFIX).app/Contents/Resources
  64. EXE = $(NAME)$(SUFFIX).app/Contents/MacOS/$(NAME)$(SUFFIX)
  65. else # ! OS X*
  66. UI = con
  67. EXE = $(NAME)$(SUFFIX)
  68. ifeq (file,$(origin UI))
  69. $(warning Note: no graphics output capability detected, building for console output.)
  70. endif
  71. endif # OS X*
  72. endif # X
  73. endif # Windows vs. other