ifndef arch arch = 12 endif nvcc = nvcc ppc.cu -Xptxas=-v -arch=sm_$(arch) \ -O2 --use_fast_math --compiler-options=-O2,--fast-math gcpp = c++ ppc.cxx -O2 --fast-math mlib = -fPIC -DXLIB -c -o ppc.o && gcc -shared \ -fPIC -Wl,-soname,xppc ppc.o -o libxppc.so warn = 2>&1 | grep -v assuming all: true ... make gpu: compile the ppc executable for GPU true ... make cpu: compile the ppc executable for CPU true ... make glib: compile the libxppc library for GPU true ... make clib: compile the libxppc library for CPU gpu: $(nvcc) -o ppc $(warn) glib: $(nvcc),$(mlib) link: ln -s ppc.cu ppc.cxx || true ln -s pro.cu pro.cxx || true cpu: link $(gcpp) -o ppc --static clib: link $(gcpp) $(mlib) clean: rm ppc.o ppc libxppc.so ppc.cxx pro.cxx || true