| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 | # StarPU --- Runtime system for heterogeneous multicore architectures.## Copyright (C) 2009-2011  Université de Bordeaux# Copyright (C) 2010-2013  CNRS## StarPU is free software; you can redistribute it and/or modify# it under the terms of the GNU Lesser General Public License as published by# the Free Software Foundation; either version 2.1 of the License, or (at# your option) any later version.## StarPU is distributed in the hope that it will be useful, but# WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.## See the GNU Lesser General Public License in COPYING.LGPL for more details.STARPU		?=	undefinedEXAMPLE		?= 	undefinedTARGETS	=	hello_worldTARGETS +=	blockTARGETS	+=	multTARGETS	+=	variableTARGETS	+=	incrementerifeq ($(STARPU),undefined)all:	@echo	@echo "ERROR. You need to set the variable STARPU to the name of the pkg-config StarPU package"	@echoclean:; rm -f $(TARGETS) *.oelseifeq ($(EXAMPLE),undefined)all:	@echo	@echo "ERROR. You need to set the variable EXAMPLE to the directory hosting the example sources"	@echoclean:; rm -f $(TARGETS) *.oelseCFLAGS          +=      $$(pkg-config --cflags $(STARPU))LDFLAGS         +=      $$(pkg-config --libs $(STARPU))HAS_CUDA	=	$(shell pkg-config --libs $(STARPU) |grep -i cuda)NVCC		?=	nvccHAS_OPENCL	=	$(shell pkg-config --libs $(STARPU) |grep -i opencl)%.o: $(EXAMPLE)/basic_examples/%.cu	$(NVCC) $(CFLAGS) $< -c%.o: $(EXAMPLE)/basic_examples/%.c	$(CC) $(CFLAGS) $< -c%.o: $(EXAMPLE)/incrementer/%.cu	$(NVCC) $(CFLAGS) $< -c%.o: $(EXAMPLE)/incrementer/%.c	$(CC) $(CFLAGS) $< -call: $(TARGETS)BLOCK_PREREQUISITES	=	block.o block_cpu.oifneq ($(strip $(HAS_CUDA)),)BLOCK_PREREQUISITES	+=	block_cuda.oBLOCK_COMPILER		=	$(NVCC)elseBLOCK_COMPILER		=	$(CC)endififneq ($(strip $(HAS_OPENCL)),)BLOCK_PREREQUISITES    +=	block_opencl.oendifblock: $(BLOCK_PREREQUISITES)	$(BLOCK_COMPILER) $(LDFLAGS) $^ -o $@VARIABLE_PREREQUISITES	=	variable.o variable_kernels_cpu.oifneq ($(strip $(HAS_CUDA)),)VARIABLE_PREREQUISITES	+=	variable_kernels.oVARIABLE_COMPILER	=	$(NVCC)elseVARIABLE_COMPILER	=	$(CC)endififneq ($(strip $(HAS_OPENCL)),)VARIABLE_PREREQUISITES    +=	variable_kernels_opencl.oendifvariable: $(VARIABLE_PREREQUISITES)	$(VARIABLE_COMPILER) $(LDFLAGS) $^ -o $@INCREMENTER_PREREQUISITES	=	incrementer.oifneq ($(strip $(HAS_CUDA)),)INCREMENTER_PREREQUISITES	+=	incrementer_kernels.oINCREMENTER_COMPILER		=	$(NVCC)elseINCREMENTER_COMPILER		=	$(CC)endififneq ($(strip $(HAS_OPENCL)),)INCREMENTER_PREREQUISITES    +=	incrementer_kernels_opencl.oendifincrementer: $(INCREMENTER_PREREQUISITES)	$(INCREMENTER_COMPILER) $(LDFLAGS) $^ -o $@clean:; rm -f $(TARGETS) *.oendifendif
 |