-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
33 lines (27 loc) · 798 Bytes
/
Makefile
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
TARGET = bfs
SRCDIR = src
OBJDIR = obj
BINDIR = bin
INClDIR = includes
CUDA_INSTALL_PATH := /Developer/NVIDIA/CUDA-7.5
GCC := $(CUDA_INSTALL_PATH)/bin/nvcc
LIBS := -I. -I$(SRCDIR) -I$(CUDA_INSTALL_PATH)/include -I$(INClDIR)
CUDA_LIBS := -L$(CUDA_INSTALL_PATH)/lib64 -lcudart
SOURCES := $(wildcard $(SRCDIR)/*.cu)
INCLUDES := $(wildcard $(INClDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.cu=$(OBJDIR)/%.o)
rm = rm -f
$(BINDIR)/$(TARGET) : $(OBJECTS)
mkdir -p $(BINDIR)
$(GCC) -o $@ $(OBJECTS)
@echo "Linking complete!"
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.cu
@$(GCC) $(LIBS) -c $(SRCDIR)/*.cu -odir $(OBJDIR)
@echo "Compiled "$<" successfully!"
.PHONEY: clean
clean:
@$(rm) $(OBJECTS)
@echo "Cleanup complete!"
remove: clean
@$(rm) $(BINDIR)/$(TARGET)
@echo "Executable removed!"