我有一个像这样的Makefile:
.SECONDARY:
NVCC = nvcc
NVCCFLAGS = --gpu-architecture compute_20
CXX = g++
CXXFLAGS = -O3 -std=c++0x -Wall
CXXLINT = python cpplint.py
CXXLINTFLAGS = --filter=-build/include,-readability/streams,-runtime/sizeof,-whitespace/parens
PROTOC = protoc
PROTOCFLAGS = --cpp_out=.
BINS = my_binary
LIBS = -lcublas -lcusparse
PROTOS = $(wildcard *.proto)
SOURCES = $(wildcard *.cu)
HEADERS = $(wildcard *.cuh)
PBS = $(PROTOS:%.proto=%.pb)
DEPS = $(SOURCES:%.cu=%.d)
TESTS = my_test
all: lint protos
all: deps
all: bins
protos: ${PBS}
deps: ${DEPS}
bins: ${BINS}
clean:
rm -rf *.o *.d *.pb.cc *.pb.h ${BINS} ${TESTS} …Run Code Online (Sandbox Code Playgroud)