Makefile 550 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
-include ../../Makefile.inc

CC=g++
NVCC=nvcc
CFLAGS=-O3 -I.

ARCH?=compute_20
CODE?=sm_21
NVFLAGS=$(CFLAGS) -gencode arch=$(ARCH),code=$(CODE)

CPPS=$(wildcard *.cpp)
CUS=$(wildcard *.cu)

CU_OBJS=$(patsubst %.cu,%.o,$(CUS) )

OBJECTS=$(patsubst %.cpp, %.o, $(CPPS) ) $(patsubst %.cu,%.o,$(CUS) )

all: EasyWave

EasyWave: $(OBJECTS) link.o
	$(NVCC) -o $@ $^

%.o: %.cpp *.h
	$(CC) -c $(CFLAGS) -o $@ $<
	
%.o: %.cu *.cuh *.h
	$(NVCC) -dc $(NVFLAGS) -x cu -o $@ $<

link.o: $(CU_OBJS)
	$(NVCC) -dlink $(NVFLAGS) -o $@ $^

clean:
	rm -f EasyWave *.o