Makefile.am 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. #
  2. # Copyright (c) 2014 Intel Corporation. All Rights Reserved.
  3. #
  4. # Redistribution and use in source and binary forms, with or without
  5. # modification, are permitted provided that the following conditions
  6. # are met:
  7. #
  8. # * Redistributions of source code must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. # * Redistributions in binary form must reproduce the above copyright
  11. # notice, this list of conditions and the following disclaimer in the
  12. # documentation and/or other materials provided with the distribution.
  13. # * Neither the name of Intel Corporation nor the names of its
  14. # contributors may be used to endorse or promote products derived
  15. # from this software without specific prior written permission.
  16. #
  17. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  20. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  21. # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  22. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  23. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  24. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  25. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  27. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. #
  29. AUTOMAKE_OPTIONS = foreign
  30. ACLOCAL_AMFLAGS = -I .. -I ../config
  31. # Build plugin for Intel MIC
  32. SUBDIRS = . plugin
  33. # Directories.
  34. build_dir = $(top_builddir)
  35. coi_inc_dir = $(top_srcdir)/include/coi
  36. myo_inc_dir = $(top_srcdir)/include/myo
  37. libgomp_dir = $(build_dir)/../libgomp
  38. source_dir = $(top_srcdir)/runtime
  39. # May be used by toolexeclibdir.
  40. gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
  41. libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
  42. # Target list.
  43. if LIBOFFLOADMIC_HOST
  44. nodist_toolexeclib_HEADERS = liboffloadmic_host.spec
  45. toolexeclib_LTLIBRARIES = libcoi_host.la libmyo-client.la liboffloadmic_host.la
  46. nodist_libsubinclude_HEADERS = runtime/compiler_if_host.h
  47. ofld_obj =
  48. else # LIBOFFLOADMIC_TARGET
  49. nodist_toolexeclib_HEADERS = liboffloadmic_target.spec
  50. toolexeclib_LTLIBRARIES = libcoi_device.la libmyo-service.la liboffloadmic_target.la
  51. nodist_libsubinclude_HEADERS = runtime/compiler_if_target.h
  52. ofld_obj = ofldbegin.o ofldend.o
  53. endif
  54. # Liboffloadmic.
  55. liboffloadmic_sources = runtime/dv_util.cpp \
  56. runtime/liboffload_error.c \
  57. runtime/liboffload_msg.c \
  58. runtime/offload_common.cpp \
  59. runtime/offload_table.cpp \
  60. runtime/offload_trace.cpp \
  61. runtime/offload_util.cpp
  62. liboffloadmic_cppflags = -DLINUX -DCOI_LIBRARY_VERSION=2 -DMYO_SUPPORT -DOFFLOAD_DEBUG=1 -DSEP_SUPPORT -DTIMING_SUPPORT -I$(coi_inc_dir) -I$(myo_inc_dir) -I$(source_dir) -I$(libgomp_dir)
  63. liboffloadmic_host_la_SOURCES = $(liboffloadmic_sources) \
  64. runtime/cean_util.cpp \
  65. runtime/coi/coi_client.cpp \
  66. runtime/compiler_if_host.cpp \
  67. runtime/offload_engine.cpp \
  68. runtime/offload_env.cpp \
  69. runtime/offload_host.cpp \
  70. runtime/offload_myo_host.cpp \
  71. runtime/offload_omp_host.cpp \
  72. runtime/offload_orsl.cpp \
  73. runtime/offload_timer_host.cpp \
  74. runtime/orsl-lite/lib/orsl-lite.c
  75. liboffloadmic_host_la_CPPFLAGS = $(liboffloadmic_cppflags) -DHOST_LIBRARY=1
  76. liboffloadmic_host_la_LDFLAGS = @lt_cv_dlopen_libs@ -version-info 5:0:0
  77. liboffloadmic_host_la_LIBADD = libcoi_host.la libmyo-client.la
  78. liboffloadmic_host_la_DEPENDENCIES = $(liboffloadmic_host_la_LIBADD)
  79. liboffloadmic_target_la_SOURCES = $(liboffloadmic_sources) \
  80. runtime/coi/coi_server.cpp \
  81. runtime/compiler_if_target.cpp \
  82. runtime/offload_myo_target.cpp \
  83. runtime/offload_omp_target.cpp \
  84. runtime/offload_target.cpp \
  85. runtime/offload_timer_target.cpp
  86. liboffloadmic_target_la_CPPFLAGS = $(liboffloadmic_cppflags) -DHOST_LIBRARY=0
  87. liboffloadmic_target_la_LDFLAGS = @lt_cv_dlopen_libs@ -version-info 5:0:0
  88. liboffloadmic_target_la_LIBADD = libcoi_device.la libmyo-service.la
  89. liboffloadmic_target_la_DEPENDENCIES = $(liboffloadmic_target_la_LIBADD)
  90. # Emulator.
  91. libcoi_host_la_SOURCES = runtime/emulator/coi_host.cpp
  92. libcoi_device_la_SOURCES = runtime/emulator/coi_device.cpp
  93. libmyo_client_la_SOURCES = runtime/emulator/myo_client.cpp
  94. libmyo_service_la_SOURCES = runtime/emulator/myo_service.cpp
  95. libcoi_host_la_DEPENDENCIES = runtime/emulator/coi_version_linker_script.map
  96. libcoi_device_la_DEPENDENCIES = runtime/emulator/coi_version_linker_script.map
  97. libmyo_client_la_DEPENDENCIES = runtime/emulator/myo_version_linker_script.map
  98. libmyo_service_la_DEPENDENCIES = runtime/emulator/myo_version_linker_script.map
  99. libcoi_host_la_CPPFLAGS = -I$(coi_inc_dir)
  100. libcoi_device_la_CPPFLAGS = -I$(coi_inc_dir)
  101. libmyo_client_la_CPPFLAGS = -I$(myo_inc_dir)
  102. libmyo_service_la_CPPFLAGS = -I$(myo_inc_dir)
  103. libcoi_host_la_LDFLAGS = -lrt -Wl,--version-script=$(source_dir)/emulator/coi_version_linker_script.map
  104. libcoi_device_la_LDFLAGS = -lrt -Wl,--version-script=$(source_dir)/emulator/coi_version_linker_script.map
  105. libmyo_client_la_LDFLAGS = -lrt -Wl,--version-script=$(source_dir)/emulator/myo_version_linker_script.map
  106. libmyo_service_la_LDFLAGS = -lrt -Wl,--version-script=$(source_dir)/emulator/myo_version_linker_script.map
  107. # ofldbegin, ofldend
  108. all-local: $(ofld_obj)
  109. ofldbegin.o: runtime/ofldbegin.cpp
  110. $(CXXCOMPILE) $(liboffloadmic_target_la_CPPFLAGS) -c $< -o $@
  111. ofldend.o: runtime/ofldend.cpp
  112. $(CXXCOMPILE) $(liboffloadmic_target_la_CPPFLAGS) -c $< -o $@
  113. # Work around what appears to be a GNU make bug handling MAKEFLAGS
  114. # values defined in terms of make variables, as is the case for CC and
  115. # friends when we are called from the top level Makefile.
  116. AM_MAKEFLAGS = \
  117. "AR_FLAGS=$(AR_FLAGS)" \
  118. "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
  119. "CFLAGS=$(CFLAGS)" \
  120. "CXXFLAGS=$(CXXFLAGS)" \
  121. "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
  122. "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
  123. "INSTALL=$(INSTALL)" \
  124. "INSTALL_DATA=$(INSTALL_DATA)" \
  125. "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  126. "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
  127. "JC1FLAGS=$(JC1FLAGS)" \
  128. "LDFLAGS=$(LDFLAGS)" \
  129. "LIBCFLAGS=$(LIBCFLAGS)" \
  130. "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
  131. "MAKE=$(MAKE)" \
  132. "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
  133. "PICFLAG=$(PICFLAG)" \
  134. "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
  135. "SHELL=$(SHELL)" \
  136. "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
  137. "exec_prefix=$(exec_prefix)" \
  138. "infodir=$(infodir)" \
  139. "libdir=$(libdir)" \
  140. "prefix=$(prefix)" \
  141. "includedir=$(includedir)" \
  142. "AR=$(AR)" \
  143. "AS=$(AS)" \
  144. "LD=$(LD)" \
  145. "LIBCFLAGS=$(LIBCFLAGS)" \
  146. "NM=$(NM)" \
  147. "PICFLAG=$(PICFLAG)" \
  148. "RANLIB=$(RANLIB)" \
  149. "DESTDIR=$(DESTDIR)"
  150. MAKEOVERRIDES =