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.

66 lines
2.2 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. # GNU Makefile that builds and runs example.
  27. NAME=som
  28. EXE=$(NAME).exe
  29. ARGS=
  30. LIGHT_ARGS=4
  31. # The C++ compiler
  32. ifneq (,$(shell which icc 2>/dev/null))
  33. CXX=icc
  34. endif # icc
  35. override CXXFLAGS += $(UI_CXXFLAGS)
  36. SRCFILES = som_graph.cpp som.cpp
  37. ifeq ($(shell uname), Linux)
  38. LIBS+= -lrt
  39. endif
  40. all: release test
  41. release: $(SRCFILES)
  42. ifeq ($(compiler),xl)
  43. # Avoiding "1586-346 (U) An error occurred during code generation. The code generation return code was 40." with -O3.
  44. $(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) -ltbb -ltbbmalloc $(LIBS)
  45. else
  46. $(CXX) -O3 -DNDEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) -ltbb -ltbbmalloc $(LIBS)
  47. endif
  48. debug: $(SRCFILES)
  49. $(CXX) -g -O0 -DTBB_USE_DEBUG -D_DEBUG $(CXXFLAGS) -o $(EXE) $(SRCFILES) -ltbb_debug -ltbbmalloc_debug $(LIBS)
  50. clean:
  51. $(RM) $(EXE) *.o *.d
  52. test:
  53. $(run_cmd) ./$(EXE) $(ARGS)
  54. light_test:
  55. $(run_cmd) ./$(EXE) $(LIGHT_ARGS)