I'm trying to specify rpath in my binary. My makefile looks like this-
CC=gcc
CFLAGS=-Wall
LDFLAGS= -rpath='../libs/'
main: main.c
gcc -o main main.c
clean:
rm -f main main.o
But when I query rpath using command readelf -a ./main | grep rpath
I get nothing
I've tried specifying rpath as LDFLAGS= "-rpath=../libs/"
but even that doesn't seem to work.
Can someone please post an example on how should I specify rpath in a makefile?
GCC and ld versions are-
gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
GNU ld (GNU Binutils for Ubuntu) 2.21.0.20110327