Makefile.mk 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2018 Alexis Juven
  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. CC = gcc
  17. CFLAGS += $(shell pkg-config --cflags starpu-1.3)
  18. LDFLAGS += $(shell pkg-config --libs starpu-1.3)
  19. all: libjlstarpu_c_wrapper.so build/mult build/extern_tasks.so build/generated_tasks.so
  20. libjlstarpu_c_wrapper.so: ../src/Wrapper/C/jlstarpu_task_submit.c ../src/Wrapper/C/jlstarpu_simple_functions.c ../src/Wrapper/C/jlstarpu_data_handles.c
  21. $(CC) -O3 -shared -fPIC $(CFLAGS) $^ -o $@ $(LDFLAGS)
  22. build/mult: mult.c build/cpu_mult.o build/gpu_mult.o
  23. $(CC) $(CFLAGS) -O3 $^ -o $@ $(LDFLAGS)
  24. build/gpu_mult.o: gpu_mult.cu
  25. nvcc -c -O3 $(CFLAGS) $^ -o $@
  26. build/cpu_mult.o: cpu_mult.c
  27. $(CC) -c $(CFLAGS) -O3 $^ -o $@ $(LDFLAGS)
  28. build/extern_tasks.so: build/cpu_mult.so build/gpu_mult.so
  29. gcc -shared -fPIC $^ -o $@
  30. build/cpu_mult.so: cpu_mult.c
  31. $(CC) -O3 -shared -fPIC $(CFLAGS) $^ -o $@ $(LDFLAGS)
  32. build/gpu_mult.so: gpu_mult.cu
  33. nvcc -O3 $(CFLAGS) $^ --shared --compiler-options '-fPIC' -o $@
  34. build/generated_tasks.so: cpu_cuda_mult.jl
  35. julia $^
  36. clean:
  37. rm build/* libjlstarpu_c_wrapper.so