📄 makefile_boinc
字号:
# Makefile for the BOINC program
#
# Unpack this in boinc/apps/aisystem and say 'make aisystem' to make
# a BOINC application which tests the BOINC graphics API.
# Can be built either using A) the directory in which BOINC was built,
# or B) the location where BOINC was installed. Uncomment accordingly.
#######################################################################
# By default we build the boinclet to test the graphics first.
default: aisystem
all: boinclet aisystem
# Version of app we are building (change as appropriate):
# (Major version of an app must match major version of BOINC core client!)
MAJOR_VERSION = 1
MINOR_VERSION = 00
#LINUX
BUILD_ARCH=i686-pc-linux-gnu
#MAC
#BUILD_ARCH=powerpc-apple-darwin
BIN_FILENAME = aisystem_$(MAJOR_VERSION).$(MINOR_VERSION)_$(BUILD_ARCH)
# A) Use BOINC_BUILD to point to where you built BOINC
# Use this if it was not yet installed in BOINC_PREFIX
BOINC_BUILD= /home/ovi/boinc
# B) Use BOINC_PREFIX to point to where you have installed BOINC
# There should be lib and include/BOINC directories under it.
BOINC_PREFIX=/home/ovi/boinc
# C) Use APP_BUILD to point to the directory where the application
# was installed
APP_BUILD=/home/ovi/source/aisystem/src
# D)
APP_SRC=..
# compiler custom flags (if you need these, eg. to enable graphics )
# Linux graphics apps need -D_REENTRANT for separate compute/graphics threads
# Need -DUSE_GLUT to be able to use GLUT text functions
#DEFS= -DHAVE_DIRENT_H
DEFS= -DBOINC_APP_GRAPHICS -D_REENTRANT
##################
# Header files:
#B)INCLUDES= -I$(BOINC_PREFIX)/include/BOINC
#A)
INCLUDES= -I$(BOINC_BUILD)/api -I$(BOINC_BUILD)/lib -I$(BOINC_BUILD) -I$(APP_BUILD)
##############
# Libraries:
# Flags to set static/dynamic loading of libraries for more portable apps
LDSTATIC=-Wl,-Bstatic
LDDYNAMIC=-Wl,-Bdynamic
# BOINC libraries, other stuff
#A)
LIBDIRS= -L. -L$(BOINC_BUILD)/api -L$(BOINC_BUILD)/lib -L/lib -L/usr/lib -L/usr/local/lib
#B)LIBDIRS= -L$(BOINC_PREFIX)/lib
LIBS= $(LIBDIRS) -lboinc_api -lboinc -ldl \
$(LDSTATIC) -lgcc -lstdc++ -lc -lm
# Libraries for graphics apps:
GLIBS= -L/usr/lib \
$(LDSTATIC) -lboinc_graphics_api -lboinc_graphics_lib \
$(LDSTATIC) -lboinc_graphics_impl \
$(LDDYNAMIC) -lGL -lGLU -lglut -ljpeg -lX11 -lXmu -lXext -lXi -lSM -lICE
# Libraries for everything, static or dynamic
LIBS2= $(LDSTATIC) -lstdc++ -lgcc $(LDDYNAMIC) -lc -lm
# How to invoke the C++ compiler:CC = gccCCLINK = $(CC) -o $@ $(LDFLAGS)
CXX = g++
CXXCPP = g++ -E
CXXFLAGS =
LDFLAGS = -pthread CCCOMPILE = $(CC) $(DEFS) $(INCLUDES) $(CFLAGS)
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)
CXXLINK = $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS)
#CXXLINK = $(CXX) $(LDFLAGS) -o $@ $+ $(LIBS)
# What we gotta make, and how to do it
OBJECTS= $(APP_SRC)/main_boinc.o
GRAPHICS= $(APP_SRC)/graphics.o
aisystem: $(OBJECTS) $(GRAPHICS)
$(CXXLINK) $+ $(LIBS) $(GLIBS)
strip $@
ln -f $@ $(BIN_FILENAME)
graphics.o: $(APP_SRC)/graphics.cpp
main_boinc.o: $(APP_SRC)/main_boinc.cpp
# How to compile.cpp.o: $(CXXCOMPILE) -c $< -o $@ .c.o:
$(CCCOMPILE) -c $< -o $@
# For testing dynamics loading:
ldd: clean aisystem
ldd aisystem
# You can run the app "standalone" if you create an output file
# called "out.txt" first:
out:
touch out.txt
# Cleaning removes the executable and object, also the long named
# executable, and any files left from running standalone
clean:
rm -f aisystem
rm -f aisystem.o $(APP_SRC)/graphics.o $(APP_SRC)/main_boinc.o
rm -f $(BIN_FILENAME) $(BIN_FILENAME).gz $(BIN_FILENAME).sig
rm -f boinc_finish_called boinc_lockfile init_data.xml
rm -f stderr.txt ckpt_state
rm -f aisystem_?.??_$(BUILD_ARCH)
cat /dev/null > out.txt
veryclean: clean
rm -f *.o
rm -f out.txt out
rm -f aisystem_*_i686-*-linux-gnu
rm -f aisystem_*_windows_intelx86.exe
rm -f aisystem_*_powerpc-apple-darwin
distclean: veryclean
rm -f *~
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -