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.

62 lines
2.6 KiB

  1. # Copyright 2005-2013 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. # Common Makefile that builds and runs example.
  27. # Just specify your program basename
  28. PROG=square
  29. ARGS=0 input.txt output.txt
  30. PERF_RUN_ARGS=auto input.txt output.txt silent
  31. # Trying to find if icl.exe is set
  32. CXX1 = $(TBB_CXX)-
  33. CXX2 = $(CXX1:icl.exe-=icl.exe)
  34. CXX = $(CXX2:-=cl.exe)
  35. # The C++ compiler options
  36. MYCXXFLAGS = /TP /EHsc /W3 /nologo /D _CONSOLE /D _MBCS /D WIN32 $(CXXFLAGS) /D _CRT_SECURE_NO_DEPRECATE /D _SECURE_SCL=0 /arch:sse2
  37. MYLDFLAGS =/INCREMENTAL:NO /NOLOGO /DEBUG /FIXED:NO $(LDFLAGS)
  38. SQUARE = square.cpp
  39. all: release test
  40. release: compiler_check
  41. $(CXX) $(SQUARE) /MD /O2 /D NDEBUG $(MYCXXFLAGS) /link tbb.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe
  42. debug: compiler_check
  43. $(CXX) $(SQUARE) /MDd /Od /Zi /D TBB_USE_DEBUG /D _DEBUG $(MYCXXFLAGS) /link tbb_debug.lib $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe
  44. clean:
  45. @cmd.exe /C del $(PROG).exe input.txt output.txt *.obj *.?db *.manifest gen_input.exe
  46. gen_input.exe: gen_input.cpp
  47. $(CXX) gen_input.cpp
  48. input.txt: gen_input.exe
  49. gen_input.exe > input.txt
  50. test: input.txt
  51. $(PROG) $(ARGS)
  52. compiler_check:
  53. @echo compiler_test>compiler_test && @$(CXX) /E compiler_test >nul 2>&1 || echo "$(CXX) command not found. Check if CXX=$(CXX) is set properly"
  54. @cmd.exe /C del compiler_test
  55. perf_build: release
  56. perf_run: input.txt
  57. $(PROG) $(PERF_RUN_ARGS)