Assuming the C program name in the PPU folder of project is knn_ppu.c and SPU folder of the project is knn_spu.c. Following are contents of make file for each programs:
Make File for knn_ppu.c contains the following content:
########################################################################
# Subdirectories
########################################################################
DIRS := spu
########################################################################
# Target
########################################################################
PROGRAM_ppu := knn_ppu
########################################################################
# Local Defines
########################################################################
IMPORTS = ../spu/lib_knn_spu.a -lspe2 -lpthread
INSTALL_DIR = $(EXP_SDKBIN)/tutorial
INSTALL_FILES = $(PROGRAM_ppu)
########################################################################
# buildutils/make.footer
########################################################################
include /opt/cell/sdk/buildutils/make.footer
Make File for knn_spu.c contains the following content:
########################################################################
# Subdirectories
########################################################################
########################################################################
# Target
########################################################################
PROGRAM_spu := knn_spu
LIBRARY_embed := lib_knn_spu.a
########################################################################
# Local Defines
########################################################################
IMPORTS := -lm
########################################################################
# buildutils/make.footer
########################################################################
include /opt/cell/sdk/buildutils/make.footer
Here IMPORTS is the part where we can give the execution options like “-lm” which is used for math functions.