makefile 819 B

123456789101112131415161718192021222324252627282930313233343536
  1. # GCC compiler
  2. CC=gcc-9
  3. CFLAGS += -O3 -mavx -mfma -fomit-frame-pointer -march=native -ffast-math $(shell pkg-config --cflags starpu-1.3)
  4. LDFLAGS +=$(shell pkg-config --libs starpu-1.3)
  5. EXTERNLIB=extern_tasks.dylib
  6. GENERATEDLIB=generated_tasks.dylib
  7. OBJECTS=$(patsubst %.c,%.o,$(wildcard gen*.c))
  8. LIBPATH=${PWD}/../StarPU.jl/lib
  9. all: ${EXTERNLIB}
  10. mult: mult.c cpu_mult.o #gpu_mult.o
  11. $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
  12. gpu_mult.o: gpu_mult.cu
  13. nvcc -c $(CFLAGS) $^ -o $@
  14. %.o: %.c
  15. $(CC) -c $(CFLAGS) $^ -o $@
  16. ${EXTERNLIB}: cpu_mandelbrot.o
  17. $(CC) -shared -fPIC $(LDFLAGS) $^ -o $@
  18. gpu_mult.so: gpu_mult.o
  19. nvcc $(CFLAGS) $^ --shared --compiler-options '-fPIC' -o $@ $(LDFLAGS)
  20. ${GENERATEDLIB}: ${OBJECTS}
  21. $(CC) -shared -fPIC $(LDFLAGS) $^ -o $@
  22. clean:
  23. rm *.so *.o *.dylib c_*.genc gencuda_*.cu *.dat