Skip to content

Instantly share code, notes, and snippets.

@omerk
Created November 5, 2013 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omerk/7322909 to your computer and use it in GitHub Desktop.
Save omerk/7322909 to your computer and use it in GitHub Desktop.
Generic Makefile for the Parallella board.
ESDK=${EPIPHANY_HOME}
ELIBS=${ESDK}/tools/host/lib
EINCS=${ESDK}/tools/host/include
ELDF=${ESDK}/bsps/current/fast.ldf # Modify this for different linker options
EHDF=${EPIPHANY_HDF}
# Modify this to suit the name of your application.
# Host app should be: $APP.c and device app: e_$APP.c
APP=hello_world
all: host device convert
host:
gcc ${APP}.c -o ${APP}.elf -I ${EINCS} -L ${ELIBS} -le-hal -g
device:
e-gcc -T ${ELDF} e_${APP}.c -o e_${APP}.elf -le-lib -g
convert:
e-objcopy --srec-forceS3 --output-target srec e_${APP}.elf e_${APP}.srec
run:
sudo -E LD_LIBRARY_PATH=${ELIBS}:${LD_LIBRARY_PATH} EPIPHANY_HDF=${EHDF} ./${APP}.elf
debug:
sudo -E LD_LIBRARY_PATH=${ELIBS}:${LD_LIBRARY_PATH} EPIPHANY_HDF=${EHDF} gdb ./${APP}.elf
clean:
rm -f *.elf *.srec
@omerk
Copy link
Author

omerk commented Nov 8, 2013

Also useful (and related to the Makefile):

Save the following as /opt/adapteva/env.sh and source it in your .bashrc:

export EPIPHANY_HOME=/opt/adapteva/esdk
#change HDF if you're using the actual Parallella board (not the Zedboard prototype)
export EPIPHANY_HDF=${EPIPHANY_HOME}/bsps/zed_E16G3_512mb/zed_E16G3_512mb.hdf
export PATH=${EPIPHANY_HOME}/tools/e-gnu/bin:${PATH}
export LD_LIBRARY_PATH=${EPIPHANY_HOME}/tools/host/`arch`/lib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment