Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2009-2011 Université de Bordeaux 1
  4. # Copyright (C) 2010, 2011 Centre National de la Recherche Scientifique
  5. #
  6. # Permission is granted to copy, distribute and/or modify this document
  7. # under the terms of the GNU Free Documentation License, Version 1.3
  8. # or any later version published by the Free Software Foundation;
  9. # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
  10. #
  11. # See the GNU Free Documentation License in COPYING.GFDL for more details.
  12. CFLAGS += $$(pkg-config --cflags libstarpu)
  13. LDFLAGS += $$(pkg-config --libs libstarpu)
  14. HAS_CUDA = $(shell pkg-config --libs libstarpu|grep -i cuda)
  15. NVCC ?= nvcc
  16. HAS_OPENCL = $(shell pkg-config --libs libstarpu|grep -i opencl)
  17. %.o: %.cu
  18. nvcc $(CFLAGS) $< -c
  19. all: hello_world vector_scal
  20. VECTOR_SCAL_PREREQUISITES = vector_scal.o vector_scal_cpu.o
  21. ifneq ($(strip $(HAS_CUDA)),)
  22. VECTOR_SCAL_PREREQUISITES += vector_scal_cuda.o
  23. VECTOR_SCAL_COMPILER = $(NVCC)
  24. else
  25. VECTOR_SCAL_COMPILER = $(CC)
  26. endif
  27. ifneq ($(strip $(HAS_OPENCL)),)
  28. VECTOR_SCAL_PREREQUISITES += vector_scal_opencl.o
  29. endif
  30. vector_scal: $(VECTOR_SCAL_PREREQUISITES)
  31. $(VECTOR_SCAL_COMPILER) $(LDFLAGS) $^ -o $@
  32. clean:
  33. rm -f hello_world vector_scal *.o