boinc/samples/openclapp/Makefile_NVIDIA

45 lines
1.2 KiB
Plaintext

# makefile for openclapp BOINC example appication using NVIDIA GPU on Linux.
BOINC_DIR = ../..
BOINC_API_DIR = $(BOINC_DIR)/api
BOINC_LIB_DIR = $(BOINC_DIR)/lib
CXXFLAGS = -g \
-I$(BOINC_DIR) \
-I$(BOINC_LIB_DIR) \
-I$(BOINC_API_DIR) \
-I/usr/local/cuda/include \
-L$(BOINC_LIB_DIR) \
-L$(BOINC_API_DIR) \
-L. \
-L/usr/local/cuda/lib \
-L/lib/i386-linux-gnu
## The above 2 lines work around an Ubuntu LD_LIBRARY_PATH bug described in:
## <https://help.ubuntu.com/community/EnvironmentVariables#File-location_related_variables>
PROGS = openclapp \
all: $(PROGS)
libstdc++.a:
ln -s `g++ -print-file-name=libstdc++.a`
clean:
/bin/rm -f $(PROGS) *.o libstdc++.a
distclean:
/bin/rm -f $(PROGS) *.o libstdc++.a
install: openclapp
openclapp: openclapp.o boinc_opencl.o libstdc++.a
$(CXX) $(CXXFLAGS) -o openclapp openclapp.o boinc_opencl.o \
libstdc++.a -lOpenCL -lboinc_api -lboinc -lpthread
openclapp.o: openclapp.cpp openclapp.hpp
$(CXX) $(CXXFLAGS) -c openclapp.cpp
boinc_opencl.o: $(BOINC_API_DIR)/boinc_opencl.cpp $(BOINC_API_DIR)/boinc_opencl.h
$(CXX) $(CXXFLAGS) -c $(BOINC_API_DIR)/boinc_opencl.cpp