Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2009-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. #
  5. # StarPU is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU Lesser General Public License as published by
  7. # the Free Software Foundation; either version 2.1 of the License, or (at
  8. # your option) any later version.
  9. #
  10. # StarPU is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. #
  16. CFLAGS += $$(pkg-config --cflags starpu-1.1)
  17. LDLIBS += $$(pkg-config --libs starpu-1.1)
  18. HAS_CUDA = $(shell pkg-config --libs starpu-1.1 |grep -i cuda)
  19. NVCC ?= nvcc
  20. HAS_OPENCL = $(shell pkg-config --libs starpu-1.1 |grep -i opencl)
  21. %.o: %.cu
  22. nvcc $(CFLAGS) $< -c
  23. TARGETS = hello_world vector_scal vector_scal_task_insert
  24. all: $(TARGETS)
  25. VECTOR_SCAL_PREREQUISITES = vector_scal.o vector_scal_cpu.o
  26. ifneq ($(strip $(HAS_CUDA)),)
  27. VECTOR_SCAL_PREREQUISITES += vector_scal_cuda.o
  28. VECTOR_SCAL_COMPILER = $(NVCC)
  29. else
  30. VECTOR_SCAL_COMPILER = $(CC)
  31. endif
  32. ifneq ($(strip $(HAS_OPENCL)),)
  33. VECTOR_SCAL_PREREQUISITES += vector_scal_opencl.o
  34. endif
  35. vector_scal: $(VECTOR_SCAL_PREREQUISITES)
  36. $(VECTOR_SCAL_COMPILER) $^ $(LDLIBS) -o $@
  37. VECTOR_SCAL_TASK_INSERT_PREREQUISITES = vector_scal_task_insert.o vector_scal_cpu.o
  38. ifneq ($(strip $(HAS_CUDA)),)
  39. VECTOR_SCAL_TASK_INSERT_PREREQUISITES += vector_scal_cuda.o
  40. VECTOR_SCAL_TASK_INSERT_COMPILER = $(NVCC)
  41. else
  42. VECTOR_SCAL_TASK_INSERT_COMPILER = $(CC)
  43. endif
  44. ifneq ($(strip $(HAS_OPENCL)),)
  45. VECTOR_SCAL_TASK_INSERT_PREREQUISITES += vector_scal_opencl.o
  46. endif
  47. vector_scal_task_insert: $(VECTOR_SCAL_TASK_INSERT_PREREQUISITES)
  48. $(VECTOR_SCAL_TASK_INSERT_COMPILER) $^ $(LDLIBS) -o $@
  49. clean:
  50. rm -f $(TARGETS) *.o